esprima.jsx
Synopsis
JSX wrapper for Esprima that is a high performance, standard-compliant ECMAScript parser.
Code Example
;; static : void { var tokens = esprima; console; }
Motivation
You can create JS code modify/analyse code with awesome static type checking of JSX.
Installation
Type following command in your JSX project (if you don't create package.json
, omit --save
parameter):
$ npm install esprima.jsx --save$ npm install esprima --save
Adds the following statement in your code:
;
API Reference
-
esprima.parse(sourcecode : string) : EsprimaToken
Return tokens.
-
esprima.parse(sourcecode : string, option : Map.<boolean>) : EsprimaToken
Return tokens with options.
var tokens = esprimaloc
: Nodes have line and column-based location inforange
: Nodes have an index-based location range (array)raw
: Literals have extra property which stores the verbatim sourcetokens
: An extra array containing all found tokenscomment
: An extra array containing all line and block commentstolerant
: An extra array containing all errors found, attempts to continue parsing when an error is encountered
Development
Repository
- Repository: git@github.com:shibukawa/esprima.jsx.git
- Issues: https://github.org/shibukawa/esprima/issues
Run Test
$ grunt test
Build
# Generate API reference $ grunt doc # Build application or library for JS project $ grunt build
Author
- shibukawa / yoshiki@shibu.jp
License
BSD-2-Clause
Complete license is written in LICENSE.md
.