Skip to content

Commit

Permalink
added a command to generate the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jashmenn committed Jun 17, 2016
1 parent 58426ee commit 49703a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/mocha --compilers js:babel-core/register",
"watchtest": "./node_modules/.bin/mocha --compilers js:babel-core/register --watch"
"watchtest": "./node_modules/.bin/mocha --compilers js:babel-core/register --watch",
"generate-parser": "./node_modules/.bin/pegjs query.pegjs query-parser.js"
},
"author": "",
"license": "ISC",
Expand Down
9 changes: 7 additions & 2 deletions query.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
*/

{
let cq = require(__dirname + "/../../../index");
let NodeTypes = cq.NodeTypes;
// ideally we would load this from the other cq code, but this is less hassle for now
const NodeTypes = {
IDENTIFIER: 'IDENTIFIER',
RANGE: 'RANGE',
LINE_NUMBER: 'LINE_NUMBER',
EXTRA_LINES: 'EXTRA_LINES'
};
}

start
Expand Down

0 comments on commit 49703a2

Please sign in to comment.