Skip to content

Commit

Permalink
Fix (| |) syntax in macros
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 19, 2023
1 parent c004cb7 commit 1b570bc
Show file tree
Hide file tree
Showing 8 changed files with 1,613 additions and 1,621 deletions.
12 changes: 3 additions & 9 deletions src/Visp.Compiler/Parser.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,7 @@ collection_close_kind:
| RBRACE { () }
| BAR_BRACE { () }
| BAR_BRACKET { () }

macro_close_kind:
| RPAREN { () }
| RBRACKET { () }
| RBRACE { () }
| BAR_BRACE { () }
| BAR_BRACKET { () }
| BAR_PAREN { () }

macro_body:
| constant { SynMacroBody.Const(fst $1, snd $1) }
Expand All @@ -495,8 +489,8 @@ macro_body:
{ let mNameBody = SynMacroBody.Symbol($2)
SynMacroBody.Call(SynMacroCall($2, mNameBody :: $3, lhs parseState)) }

| macro_open_kind macro_close_kind { SynMacroBody.List($1, [], lhs parseState) }
| macro_open_kind macro_body_list macro_close_kind { SynMacroBody.List($1, $2, lhs parseState) }
| macro_open_kind collection_close_kind { SynMacroBody.List($1, [], lhs parseState) }
| macro_open_kind macro_body_list collection_close_kind { SynMacroBody.List($1, $2, lhs parseState) }

| DOT { SynMacroBody.Trivia(SynMacroTriviaKind.Dot, lhs parseState) }
| COMMA { SynMacroBody.Trivia(SynMacroTriviaKind.Comma, lhs parseState) }
Expand Down
Loading

0 comments on commit 1b570bc

Please sign in to comment.