Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 62 lines (34 sloc) 1.321 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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/Grammar.y

This generates src/Language/JavaScript/Parser/Grammar.hs, delete this
when done with the debug version


UTF8/Unicode version

This requires https://github.com/jyp/Alex, in particular the utf8
branch, to generate the Lexer.hs file

$ git clone https://github.com/jyp/Alex.git
$ cd Alex
$ git checkout utf8
$ cabal install

This will put a utf8 enabled alex in ~/.cabal/bin

To switch back to the standard version,

$ cabal install --reinstall alex

Changes

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

Something went wrong with that request. Please try again.