Skip to content

Commit e20b62c

Browse files
authored
Add missing productions (#2280)
1 parent 044b00a commit e20b62c

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

GRAMMAR.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NEWLINE = \n|\r\n
2121
RAW_STRING = '[^']*'
2222
INDENTED_RAW_STRING = '''[^(''')]*'''
2323
STRING = "[^"]*" # also processes \n \r \t \" \\ escapes
24-
INDENTED_STRING = """[^("""]*""" # also processes \n \r \t \" \\ escapes
24+
INDENTED_STRING = """[^(""")]*""" # also processes \n \r \t \" \\ escapes
2525
LINE_PREFIX = @-|-@|@|-
2626
TEXT = recipe text, only matches in a recipe body
2727
```
@@ -50,46 +50,55 @@ item : alias
5050
| import
5151
| module
5252
| recipe
53-
| setting
53+
| set
5454
5555
eol : NEWLINE
5656
| COMMENT NEWLINE
5757
58-
alias : 'alias' NAME ':=' NAME
58+
alias : 'alias' NAME ':=' NAME eol
5959
6060
assignment : NAME ':=' expression eol
6161
6262
export : 'export' assignment
6363
64-
setting : 'set' 'allow-duplicate-recipes' boolean?
65-
| 'set' 'allow-duplicate-variables' boolean?
66-
| 'set' 'dotenv-filename' ':=' string
67-
| 'set' 'dotenv-load' boolean?
68-
| 'set' 'dotenv-path' ':=' string
69-
| 'set' 'export' boolean?
70-
| 'set' 'fallback' boolean?
71-
| 'set' 'ignore-comments' boolean?
72-
| 'set' 'positional-arguments' boolean?
73-
| 'set' 'quiet' boolean?
74-
| 'set' 'shell' ':=' '[' string (',' string)* ','? ']'
75-
| 'set' 'tempdir ':=' string
76-
| 'set' 'windows-powershell' boolean?
77-
| 'set' 'windows-shell' ':=' '[' string (',' string)* ','? ']'
78-
79-
import : 'import' '?'? string?
80-
81-
module : 'mod' '?'? NAME string?
64+
set : 'set' setting eol
65+
66+
setting : 'allow-duplicate-recipes' boolean?
67+
| 'allow-duplicate-variables' boolean?
68+
| 'dotenv-filename' ':=' string
69+
| 'dotenv-load' boolean?
70+
| 'dotenv-path' ':=' string
71+
| 'dotenv-required' boolean?
72+
| 'export' boolean?
73+
| 'fallback' boolean?
74+
| 'ignore-comments' boolean?
75+
| 'positional-arguments' boolean?
76+
| 'script-interpreter' ':=' string_list
77+
| 'quiet' boolean?
78+
| 'shell' ':=' string_list
79+
| 'tempdir' ':=' string
80+
| 'unstable' boolean?
81+
| 'windows-powershell' boolean?
82+
| 'windows-shell' ':=' string_list
8283
8384
boolean : ':=' ('true' | 'false')
8485
86+
string_list : '[' string (',' string)* ','? ']'
87+
88+
import : 'import' '?'? string? eol
89+
90+
module : 'mod' '?'? NAME string? eol
91+
8592
expression : 'if' condition '{' expression '}' 'else' '{' expression '}'
8693
| 'assert' '(' condition ',' expression ')'
94+
| '/' expression
8795
| value '/' expression
8896
| value '+' expression
8997
| value
9098
9199
condition : expression '==' expression
92100
| expression '!=' expression
101+
| expression '=~' expression
93102
94103
value : NAME '(' sequence? ')'
95104
| BACKTICK
@@ -106,7 +115,7 @@ string : 'x'? STRING
106115
sequence : expression ',' sequence
107116
| expression ','?
108117
109-
recipe : attributes* '@'? NAME parameter* variadic? ':' dependency* body?
118+
recipe : attributes* '@'? NAME parameter* variadic? ':' dependency* eol body?
110119
111120
attributes : '[' attribute* ']' eol
112121

0 commit comments

Comments
 (0)