Skip to content

Commit

Permalink
Support multidimensional array slices
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 14, 2023
1 parent 0cfbd76 commit 039fd02
Show file tree
Hide file tree
Showing 8 changed files with 1,293 additions and 1,203 deletions.
3 changes: 3 additions & 0 deletions src/Visp.Compiler/Parser.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,16 @@ prop_plus:
expr_comma_list: rev_expr_comma_list { List.rev $1 }
rev_expr_comma_list:
| expr { [$1] }
| OP_MULT { [(Syntax.mkSynSymbolExpr "*" (rhs parseState 1))] }
| rev_expr_comma_list COMMA expr { $3 :: $1 }

dot_bracket_expr_raw:
| DOT_BRACKET expr RBRACKET
{ [$2] }
| DOT_BRACKET expr COMMA rev_expr_comma_list RBRACKET
{ $2 :: $4 }
| DOT_BRACKET OP_MULT COMMA rev_expr_comma_list RBRACKET
{ (Syntax.mkSynSymbolExpr "*" (rhs parseState 2)) :: $4 }

dot_expr:
| dot_bracket_expr_raw expr
Expand Down
Loading

0 comments on commit 039fd02

Please sign in to comment.