Skip to content

Commit

Permalink
Automatically fix imports in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikur-grid committed Jul 30, 2022
1 parent a8518f1 commit cf4d564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ nbactions*.xml
tmp/
**/generatedCode/*.interp
**/generatedCode/*.tokens
**/generatedCode/*.bak

# Configurable build files
bilder.py
Expand Down
4 changes: 2 additions & 2 deletions runtime/JavaScript/spec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ANTLR_JAR = .antlr/antlr-4.10.1-complete.jar

abc: abc.g4 .antlr/antlr-4.10.1-complete.jar
java -jar $(ANTLR_JAR) -Dlanguage=JavaScript -no-listener abc.g4 -o generatedCode/
sed -i.bak "s/import antlr4 from 'antlr4'/import antlr4 from '..\/..\/src\/antlr4\/index.js'/" generatedCode/abc.js

calc: calc.g4 .antlr/antlr-4.10.1-complete.jar
java -jar $(ANTLR_JAR) -Dlanguage=JavaScript -no-listener calc.g4 -o generatedCode/

# TODO: fix imports in generated *.js files
sed -i.bak "s/import antlr4 from 'antlr4'/import antlr4 from '..\/..\/src\/antlr4\/index.js'/" generatedCode/calc.js

0 comments on commit cf4d564

Please sign in to comment.