-
-
Save ehuss/dcbde9df0157feda44b4e40774ac81a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expr = | |
| Literal:LITERAL | |
| Paren:{ "(" expr:Expr ")" } | |
| Borrow:{ "&" mutable:"mut"? expr:Expr } | |
| Box:{ "box" expr:Expr } | |
| Try:{ expr:Expr "?" } | |
| Range:{ start:Expr? ".." end:Expr? } | |
| RangeInclusive:{ start:Expr? "..=" end:Expr } | |
| Cast:{ expr:Expr "as" ty:IDENT } | |
| Index:{ base:Expr "[" index:Expr "]" } | |
| Array:{ "[" exprs:Expr* % "," ","? "]" } | |
| Repeat:{ "[" elem:Expr ";" count:Expr "]" } | |
| Tuple:{ "(" exprs:Expr* % "," ","? ")" } | |
| Call:{ callee:Expr "(" args:Expr* % "," ","? ")" } | |
| MethodCall:{ receiver:Expr "." method:IDENT "(" args:Expr* % "," ","? ")" } | |
| Continue:{ "continue" } | |
| Break:{ "break" value:Expr? } | |
| Return:{ "return" value:Expr? } | |
; | |
ModuleContents = items:Expr*; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment