Skip to content

Commit

Permalink
feat: generate grammar outside of build output
Browse files Browse the repository at this point in the history
Generates PEG.js grammar outside of build output. This allows running
tests without having to compile the project.

Signed-off-by: James Chen-Smith <[email protected]>
  • Loading branch information
James Chen-Smith committed Apr 7, 2021
1 parent 5a51484 commit 2b945bf
Show file tree
Hide file tree
Showing 104 changed files with 204,877 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
src/*/translation_alternates.ts
src/*/psalm_cb.ts

# Grammar files
src/*/grammar.js

# Spec files (for now)
src/*/spec.ts
2 changes: 1 addition & 1 deletion bin/02.compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ function add_peg(lang: string, prefix: string) {
throw new Error("Unreplaced options");
}

fs.writeFileSync(`js/${lang}/grammar.js`, peg);
fs.writeFileSync(`src/${lang}/grammar.js`, peg);
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
},
"homepage": "https://github.com/faithfulsource/bible-passage-reference-parser",
"scripts": {
"build": "tsc && ts-node bin/02.compile.ts",
"build": "tsc",
"format": "prettier --write .",
"format:check": "prettier --check .",
"gen:grammar": "ts-node bin/02.compile.ts",
"gen:lang": "ts-node bin/01.add_lang.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
Loading

0 comments on commit 2b945bf

Please sign in to comment.