Comments (7)
You can do child, = *node
. If this is not in the docs, it should be.
When do you use to_a.each
?
from ast.
hmm, i didn't know you could do that. Frankly looks weird, rather use my first.
each off course to go over children. you're saying i shouldn't have to. And maybe when i switch to the instance variable an your processor i won't. But now i still do and it seemed a sensible thing to have in there.
But i seem to be receiving a more is less attitude , yes ?
Always surprises me in ruby projects, ruby being known for having 7 ways of doing anything, but ok, i get it.
from ast.
you're saying i shouldn't have to
I'm not. I am specifically asking what your use case is, because I have no idea what is it. I.e. children are usually heterogeneous; what common action over them is desirable?
from ast.
ok, maybe the question was slightly ill formed then.
Because the answer to your question was so obvious.
If you're asking why i need to iterate. Other than off course, because i have a collection.
To process them.
from ast.
Like if you have a (list)
or a (hash)
? Yeah, that's reasonable. I would accept a PR with each
.
from ast.
sort of, i have an s(:expression_list , exp1 , exp2...) which is inside all statements, so common.
But i'll try that Processor with a stack now.
The code i'm talking about is temporarily here btw of almost nothing
from ast.
So, that processor / instance approach worked.
Quite like it even, so in total the switch to ast has bee great :-)
from ast.
Related Issues (11)
- #inspect should return valid Ruby code HOT 3
- How to get the parent of a node? HOT 2
- Documentation: missing a ` HOT 2
- It would be nice if inspect could include property keys or some subset of properties.
- Actualize changelog
- Local properties are not propagated HOT 2
- How do you handle node references? HOT 11
- Adding/ removing child nodes in existing AST HOT 6
- debug inspect HOT 12
- process context HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ast.