Improvements, API changes and getting ready for 0.1

9 views
Skip to first unread message

Olov Lassus

unread,
May 25, 2011, 6:31:51 PM5/25/11
to JSShaper
I'm starting to think that it's time for the first versioned release of JSShaper. I'm not cutting the release just yet but I've prepared for it with a deprecation mechanism, a CHANGES file and a few API cleanups to stir things up a bit. This means that code outside my tree will break and needs adjustment, most of which should be painless. Please test it out and let me know of any issues. I have a few more things in mind before the 0.1 release, most notably a cleanup of the different stringify functions (Node methods tknString, toString, verboseString and printTree).

Short list of notable changes in the last couple of days:

Shaper.traverse replaces deprecated Shaper.traverseTree. Just a rename.

Shaper.insertBefore and Shaper.insertAfter replaces deprecated Shaper.insertArgument. insertBefore/After are more capable and can work on sequences other than LIST (arguments), for example SCRIPT and BLOCK. They take a Ref instead of a node and pos.

Shaper.remove is a new function. Pass it a Ref and it removes it from the sequence.

Shaper.parse replaces deprecated Shaper.parseExpression. parse is smarter and does what you mean. It returns an expression/statement node or a SCRIPT if the string contains many of them. It handles semicolon as good as it can right now. Semicolon can still cause issues which remains to be solved.

Ref.prop is renamed to Ref.properties

New plugin: var-splitter. Michael this is for you. It nicely demonstrates Shaper.insertAfter and Shaper.remove.

/Olov

Michael

unread,
May 26, 2011, 2:18:56 AM5/26/11
to JSShaper
These all sound like massive wins to me! I'm itching to try them all
out tonight. I'll be sure to post any feedback, but thanks so much for
all the hard work, Olov.
Reply all
Reply to author
Forward
0 new messages