1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 11:04:09 +03:00

Add missing productions (#2280)

This commit is contained in:
Poliorcetics 2024-07-28 00:11:52 +02:00 committed by GitHub
parent 044b00a90a
commit e20b62c164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ NEWLINE = \n|\r\n
RAW_STRING = '[^']*' RAW_STRING = '[^']*'
INDENTED_RAW_STRING = '''[^(''')]*''' INDENTED_RAW_STRING = '''[^(''')]*'''
STRING = "[^"]*" # also processes \n \r \t \" \\ escapes STRING = "[^"]*" # also processes \n \r \t \" \\ escapes
INDENTED_STRING = """[^("""]*""" # also processes \n \r \t \" \\ escapes INDENTED_STRING = """[^(""")]*""" # also processes \n \r \t \" \\ escapes
LINE_PREFIX = @-|-@|@|- LINE_PREFIX = @-|-@|@|-
TEXT = recipe text, only matches in a recipe body TEXT = recipe text, only matches in a recipe body
``` ```
@ -50,46 +50,55 @@ item : alias
| import | import
| module | module
| recipe | recipe
| setting | set
eol : NEWLINE eol : NEWLINE
| COMMENT NEWLINE | COMMENT NEWLINE
alias : 'alias' NAME ':=' NAME alias : 'alias' NAME ':=' NAME eol
assignment : NAME ':=' expression eol assignment : NAME ':=' expression eol
export : 'export' assignment export : 'export' assignment
setting : 'set' 'allow-duplicate-recipes' boolean? set : 'set' setting eol
| 'set' 'allow-duplicate-variables' boolean?
| 'set' 'dotenv-filename' ':=' string
| 'set' 'dotenv-load' boolean?
| 'set' 'dotenv-path' ':=' string
| 'set' 'export' boolean?
| 'set' 'fallback' boolean?
| 'set' 'ignore-comments' boolean?
| 'set' 'positional-arguments' boolean?
| 'set' 'quiet' boolean?
| 'set' 'shell' ':=' '[' string (',' string)* ','? ']'
| 'set' 'tempdir ':=' string
| 'set' 'windows-powershell' boolean?
| 'set' 'windows-shell' ':=' '[' string (',' string)* ','? ']'
import : 'import' '?'? string? setting : 'allow-duplicate-recipes' boolean?
| 'allow-duplicate-variables' boolean?
module : 'mod' '?'? NAME string? | 'dotenv-filename' ':=' string
| 'dotenv-load' boolean?
| 'dotenv-path' ':=' string
| 'dotenv-required' boolean?
| 'export' boolean?
| 'fallback' boolean?
| 'ignore-comments' boolean?
| 'positional-arguments' boolean?
| 'script-interpreter' ':=' string_list
| 'quiet' boolean?
| 'shell' ':=' string_list
| 'tempdir' ':=' string
| 'unstable' boolean?
| 'windows-powershell' boolean?
| 'windows-shell' ':=' string_list
boolean : ':=' ('true' | 'false') boolean : ':=' ('true' | 'false')
string_list : '[' string (',' string)* ','? ']'
import : 'import' '?'? string? eol
module : 'mod' '?'? NAME string? eol
expression : 'if' condition '{' expression '}' 'else' '{' expression '}' expression : 'if' condition '{' expression '}' 'else' '{' expression '}'
| 'assert' '(' condition ',' expression ')' | 'assert' '(' condition ',' expression ')'
| '/' expression
| value '/' expression | value '/' expression
| value '+' expression | value '+' expression
| value | value
condition : expression '==' expression condition : expression '==' expression
| expression '!=' expression | expression '!=' expression
| expression '=~' expression
value : NAME '(' sequence? ')' value : NAME '(' sequence? ')'
| BACKTICK | BACKTICK
@ -106,7 +115,7 @@ string : 'x'? STRING
sequence : expression ',' sequence sequence : expression ',' sequence
| expression ','? | expression ','?
recipe : attributes* '@'? NAME parameter* variadic? ':' dependency* body? recipe : attributes* '@'? NAME parameter* variadic? ':' dependency* eol body?
attributes : '[' attribute* ']' eol attributes : '[' attribute* ']' eol