Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

70 lines (36 sloc) 1.766 kb
Parser for JavaScript
---------------------
Based (loosely) on language-python
How to build
------------
Library:
cabal clean && cabal configure && cabal build
Tests:
cabal clean && cabal configure -fbuildtests && cabal build
Running the tests
./dist/build/runtests/runtests
To debug the grammar
happy -iparse.txt -g -a -d src/Language/JavaScript/Parser/Grammar5.y
This generates src/Language/JavaScript/Parser/Grammar.hs, delete this
when done with the debug version
UTF8/Unicode version
Alex 3.0 now supports unicode natively, and has been included as a
dependency in the cabal file.
Changes
0.4.5 Update cabal file and docs for Alex 3.0, giving out of the box unicode support
0.4.4 Allow unicode characters in comments
0.4.3 correct lexer for decimalToken, only leading digit needs to be non-zero.
0.4.2 Expose SrcSpan
0.4.1 Expose AST.Node as well.
0.4.0 Updated JSNode to include location information, and made the parse more true to the original by leaving blocks as such, not replacing with ';'.
0.3.0 ECMA-262 edition 5 compliance. Required adding JSFunctionExpression and JSPropertyAccessor to the AST.
0.2.2 Heading toward compliance with edition 5. Trailing commas allowed in array literals too.
0.2.1 Allow trailing comma in object literal
0.2.0 ECMAScript 3 allows function expressions to have names, AST.JSFunctionExpression now reflects this
0.1.0 Simplified AST by removing JSElement and JSElementList components
0.0.3 Support for unicode in source. At the moment it only supports
UTF8 encoding, does not recognise byte order marks or UTF-16/UTF-32
0.0.2 Multiline comments were processed in greedy form, now end of
comment recognised properly. Thanks to Tony Morris for reporting this.
0.0.1 Initial release
EOF
Jump to Line
Something went wrong with that request. Please try again.