Skip to content

Commit

Permalink
Fix macros and hash parens
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 19, 2023
1 parent 1b570bc commit 3b260c7
Show file tree
Hide file tree
Showing 9 changed files with 1,725 additions and 1,578 deletions.
12 changes: 12 additions & 0 deletions src/Visp.Compiler/Parser.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ macro_body:
| LPAREN macro_name macro_body_list RPAREN
{ let mNameBody = SynMacroBody.Symbol($2)
SynMacroBody.Call(SynMacroCall($2, mNameBody :: $3, lhs parseState)) }
| HASH_PAREN macro_name RPAREN
{ let mNameBody = SynMacroBody.Symbol($2)
SynMacroBody.Call(SynMacroCall($2, [mNameBody], lhs parseState))}
| HASH_PAREN macro_name macro_body_list RPAREN
{ let mNameBody = SynMacroBody.Symbol($2)
SynMacroBody.Call(SynMacroCall($2, mNameBody :: $3, 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) }
Expand Down Expand Up @@ -577,8 +583,14 @@ dot_expr:
{ SynExpr.DotIndex(Syntax.parserRecoveryExpr (lhs parseState), [$2], lhs parseState)}
| DOT_PLUS symbol expr
{ SynExpr.DotProperty($3, $2, lhs parseState)}
| DOT_PLUS symbol
{ SynExpr.DotProperty(Syntax.parserRecoveryExpr (lhs parseState), $2, lhs parseState)}
| DOT_PLUS
{ SynExpr.DotProperty(Syntax.parserRecoveryExpr (lhs parseState), Syntax.parserRecoverySymbol (lhs parseState), lhs parseState)}
| prop_plus expr
{ SynExpr.DotProperty($2, $1, lhs parseState)}
| prop_plus
{ SynExpr.DotProperty(Syntax.parserRecoveryExpr (lhs parseState), $1, lhs parseState)}
| dot_method expr expr_list
{ SynExpr.DotMethod($2, $1, $3, DotMethodKind.Tuple, lhs parseState) }
| dot_method expr
Expand Down
Loading

0 comments on commit 3b260c7

Please sign in to comment.