Closed holtwick closed 13 years ago
I've now implemented this in the core as well as provided implementation for Array types. Check out and test https://github.com/rsms/move/commit/d47f880c4b7c6b29709a60fbb3a1edd98b3ddba8 (latest master as of writing this)
Well, reading/extracting slices from text is also implemented in a way, although we got it "for free". E.g.
print "hello"[1:3] # --> "el"
Implemented, tested and documented.
Awesome. Thanks! Here a little addition https://github.com/holtwick/move/commit/9e117dcfb4e130a71c1395ae201ac90f907a900a
You wrote about implementation of Slices:
"Slices would indeed be neat. Any suggestion on how this could be implemented? If you want to experiment, you want to create a new AST mutator (copy-paste one in lib/ast-mutators.js), enable it in the "compile" function (lib/index.js) and then hack in the support into the AST mutator. This provides a very flexible workflow as you can inspect the AST without, while and after your mutator applied."
I had a look at it and found out that we first need to modify the parser.js to get an AST with the needed information. I think you know the code better than I do, but I think we need something here:
After having the parser recognizing these cases:
or at least the first one, I could try to create the AST mutator. Maybe you could give me some help here? Thanks.