Parser for JavaScript, in Haskell
Haskell Yacc Logos Other
Latest commit 070c9b4 Nov 6, 2016 @erikd Version 0.6.0.9
Permalink
Failed to load latest commit information.
Tests Test.Minify: Accpet changes in test output Nov 6, 2016
src/Language/JavaScript
test Initial fix for ECMAScript 3 allowing named function expressions. Jan 5, 2011
unicode Worked in rest of unicode for identifiers as per language spec. Ready… Dec 28, 2010
.ghci
.gitignore
.travis.yml .travis.yml: Add /opt/cabal/bin to $PATH Nov 6, 2016
LICENSE WIP. Aiming at getting parsing infrastructure in place, based on lang… Nov 21, 2010
Makefile Makefile: Remove profiling, cleanup May 29, 2016
README.md README.md: Add 'Two Versions' text Mar 18, 2016
Setup.hs WIP. Aiming at getting parsing infrastructure in place, based on lang… Nov 21, 2010
TODO.txt Working in comment processing. Feb 29, 2012
buildall.sh runalex.sh no longer required Jul 26, 2015
ecmascript3.txt Preparatory work before sweep through Parser to check ECMAScript edit… Jan 5, 2011
ecmascript5.txt Heading toward compliance with edition 5. Trailing commas allowed in … Jan 7, 2011
language-javascript.cabal Version 0.6.0.9 Nov 6, 2016
quickcheck.hs
testsuite.hs Split up the testsuite a bit more Mar 17, 2016

README.md

Parser for JavaScript

Build Status

Based (loosely) on language-python

Two Versions

There are currently two versions:

  • 0.5 series : Is a continuation of the 0.5.X.Y series, from the master branch of this github repository.

  • 0.6 series : This has a vastly different and improved AST which makes if far more difficult to build an non-sensical Javascript AST. This code is in the new-ast branch of this github repository.

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/Grammar5.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.

Note: The generation of the lexical analyser has been separated out, to remove the install-time dependency on Alex. If any changes need to be made to the lexer, the Lexer.x source lies in src-dev, and the runalex.sh script will invoke Alex with the appropriate directories.