Grasp 0.2.0 has been released!
sed it searches the structure behind your code (the abstract syntax tree), rather than simply the text you’ve written - this allows you to:
- Search your code with unparalleled power
- Quickly and easily refactor your code
- Implement basic macros in a single line
This version fixes some bugs and adds new features which really make it easy to refactor your code using Grasp.
npm install -g grasp (or see install page).
npm update -g grasp.
I’m also happy to announce that a Sublime Text plugin has been developed for Grasp: sublime-grasp by joneshf. This has been added to the new tools section of the site. To any vi, Emacs, or other text editor/IDE plugin developers: create a plugin for Grasp and be featured in the next release post and in the tools section!
Questions? Comments? Join
#graspjs on Freenode and talk to
gkz or post an issue in the GitHub issues section.
- Added support for named wildcards in equery, both single and array types -
- Added filters feature for use during replacement
- Added an
graspwhen used as a library - this allows you to specify the input you want to search/replace as a string
- Added two helper functions,
grasp.replace, when using Grasp as a library
- Allowed searching for expression statements in equery when explicitly using a semicolon
- Created an object varient of each of the wildcards in equery - eg.
@attributesquery syntax, simply use
- Fixed issue #4 - Bug when replacing overlapping matches
- Fixed issue #5 - First level of quotes in replacements ignored
- Fixed issue #6 - Absolute paths are not supported on the command line
- Fixed an issue with getting the raw value of operators
Migrating from 0.1.0
- Change any use of the squery
- Change any equery bitwise OR (
|) searches to not be spaced, so they are not confused with the new filter syntax. Eg.
x | yshould become