Skip to content

Commit

Permalink
Optional semicolon in the require syntax (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth authored Sep 29, 2019
1 parent 2333d2e commit 4661656
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"library/foo/bar": {},
"executable": {
"imports": [
"Bar = require('@my-scope/pesy-npm/library/foo/bar')",
"Library = require('@my-scope/pesy-npm/library')"
"Bar = require('@my-scope/pesy-npm/library/foo/bar');",
"Library = require('@my-scope/pesy-npm/library');"
],
"bin": {
"pesy-npm-app.exe": "PesyNpmApp.re"
Expand Down
1 change: 1 addition & 0 deletions lib/Lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rule read = parse
[' ' '\t'] { read lexbuf } (* skip blanks *)
| ['('] { LPAREN }
| [')'] { RPAREN }
| [';'] { SEMICOLON }
| ['='] { ASSN }
| "require" { REQUIRE }
| ['\''] { SQUOTE }
Expand Down
5 changes: 3 additions & 2 deletions lib/Parser.mly
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
%token LPAREN RPAREN
%token LPAREN RPAREN SEMICOLON
%token EOL ASSN SQUOTE EOF REQUIRE
%token <string> MODULE_NAME
%token <string> MODULE_PATH
%start main /* the entry point */
%type <string * string> main
%%
main:
MODULE_NAME ASSN REQUIRE LPAREN SQUOTE MODULE_PATH SQUOTE RPAREN EOF { ($1, $6) }
MODULE_NAME ASSN REQUIRE LPAREN SQUOTE MODULE_PATH SQUOTE RPAREN EOF { ($1, $6) }
| MODULE_NAME ASSN REQUIRE LPAREN SQUOTE MODULE_PATH SQUOTE RPAREN SEMICOLON EOF { ($1, $6) }
;

0 comments on commit 4661656

Please sign in to comment.