Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
shebang-line ::= '#!' [^#xa#xd#x85#x2028#x2029]*
comment ::= '//' [^#xa#xd#x85#x2028#x2029]*
operator ::= custom-operator |
special-operator
custom-operator ::= custom-additive-operator |
custom-multiplicative-operator |
custom-bitwise-operator |
custom-shift-operator
custom-additive-operator ::= [+-~] operator-part*
custom-multiplicative-operator ::= [*/%] operator-part*
custom-bitwise-operator ::= [&|^] operator-part*
custom-shift-operator ::= [><] operator-part*
operator-part ::= [+-~*/%&|^><]
special-operator ::= '=' |
'==' |
'!=' |
'>' |
'>=' |
'<' |
'<='
input ::= shebang-line? token*
token ::= blank |
comment |
operator |
punctuator |
keyword |
identifier |
literal
keyword ::= regular-keyword |
type-keyword |
reserved-keyword
regular-keyword ::= 'and' |
'as' |
'assert' |
'break' |
'catch' |
'cond' |
'const' |
'defer' |
'else' |
'err' |
'ext' |
'false' |
'fn' |
'for' |
'if' |
'in' |
'let' |
'match' |
'meta' |
'mod' |
'mut' |
'next' |
'nil' |
'not' |
'opaque' |
'or' |
'pub' |
'raise' |
'rec' |
'recv' |
'ret' |
'tail' |
'test' |
'this' |
'true' |
'try' |
'type' |
'use' |
'while' |
'with'
type-keyword ::= 'agent' |
'any' |
'atom' |
'bool' |
'handle' |
'int' |
'none' |
'real' |
'ref' |
'str' |
'unk'
reserved-keyword ::= 'friend' |
'macro' |
'quote' |
'unquote' |
'yield'
literal ::= nil-literal |
boolean-literal |
integer-literal |
real-literal |
atom-literal |
string-literal
nil-literal ::= 'nil'
boolean-literal ::= 'true' |
'false'
integer-literal ::= binary-integer-literal |
octal-integer-literal |
decimal-integer-literal |
hexadecimal-integer-literal
binary-integer-literal ::= '0' [bB] binary-digit ('_'* binary-digit)*
binary-digit ::= [0-1]
octal-integer-literal ::= '0' [oO] octal-digit ('_'* octal-digit)*
octal-digit ::= [0-7]
decimal-integer-literal ::= decimal-digit ('_'* decimal-digit)*
decimal-digit ::= [0-9]
hexadecimal-integer-literal ::= '0' [xX] hexadecimal-digit ('_'* hexadecimal-digit)*
hexadecimal-digit ::= [0-9a-fA-F]
real-literal ::= real-part '.' real-part ([eE] [+-]? real-part)?
real-part ::= decimal-digit ('_'* decimal-digit)*
atom-literal ::= ':' (upper-identifier |
lower-identifier |
discard-identifier)
string-literal ::= regular-string-literal |
verbatim-string-literal |
block-string-literal
regular-string-literal ::= '"' ([^#xa#xd#x85#x2028#x2029"\] |
regular-string-escape-sequence)* '"'
regular-string-escape-sequence ::= '\' (regular-string-escape-simple |
regular-string-escape-unicode)
regular-string-escape-simple ::= [0aAbBeEfFnNrRtTvV"\]
regular-string-escape-unicode ::= [uU] hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit
verbatim-string-literal ::= '"""' '"'* [^#xa#xd#x85#x2028#x2029]+ '"""' '"'*
block-string-literal ::= '"""' '"'* white-space* line-break block-string-line white-space* '"""' '"'*
block-string-line ::= [^#xa#xd#x85#x2028#x2029]* line-break
identifier ::= upper-identifier |
lower-identifier |
discard-identifier
upper-identifier ::= [A-Z] [0-9a-zA-Z]*
lower-identifier ::= [a-z] [_0-9a-z]*
discard-identifier ::= '_' [_0-9a-z]*
binding-identifier ::= discard-identifier |
code-identifier
code-identifier ::= lower-identifier |
type-keyword
punctuator ::= '.' |
'..' |
',' |
':' |
'::' |
';' |
'->' |
'@' |
'#' |
'?' |
'(' |
')' |
'[' |
']' |
'{' |
'}'