This adds support for applying overlapping patches to the same AST witho...
Fixes a bug that would otherwise occur if the node was null.
…thout having to do multiple passes on the entire file.
Added support of "with "statement.
Added spec test for the "with" node.
Use eval sourceURL, so stakc traces have real file names and line numbers, and add the filename that was being matched when a matcher throws and error.
Add some specs to verify token offsets Bump version
Commenting, rename variables, add a spec
Better debugging information including stack traces, nicer formatting, and nested exceptions.
The old method made the assumption that patches would be applied in source order, which shouldn't be a restriction. Also fixes a bug with replacing property initializers by mangling the AST. Adds some test cases to verify that the patcher works.
Untested, but I read Narcissus so I suspect it's accurate.
It was on my private repo
Removes a bunch of the examples to make it a shorter intro blurb.
This should hopefully make things easier for others..
Everything is Apache!
Factor out the getPatternFromPatch and getPatchedCode, useful for integration with other tools.
Bug: it was using node value, so replacing a string with a different one would remove the quotes. Precaution: make sure the value of the node matches, in addition to the type.
Run the program, verify the patch, run again with -i
Now it's a well-formed npm package, better organization, etc. Also --version flags.
Added support for if in patterns, fixed some whitespace errors in generated patches, added some more demos.
Now works on the token level after matching on the AST level. Needs testing!
Presently, sed mode is the best way to use this tool, because the patch file format is dumb.
Lets you write pseudo-patch-files, similar to those that spatch accepts.
jspatch works and emits diff files.
It wasn't properly verifying that pre/postfix was the same
Half-completed jspatch that just dumps the modified source code.
Rather than using an object property, let's name the method differently.
Testing jsgrep.jsgrep's various invocation methods.
Just some minor changes.
match scripts allow you to have fine-grained control over what you match while still being able to easily use the tool's configuration, etc.