Permalink
Browse files

Parser: Expression improvements

Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information...
penberg committed Apr 1, 2013
1 parent 92dc5f6 commit 43eb5c9aea65840cbfa131cfb73de30da5044f43
Showing with 38 additions and 32 deletions.
  1. +38 −32 src/main/antlr3/fjord/compiler/Fsharp.g
@@ -130,40 +130,46 @@ typarConstraints
*/
expr
- : constant
+ : ( constant
+ | LParen expr RParen
+ | Begin expr End
+ | longIdentOrOp
+ | prefixOp expr
+ | New type expr
+ | Lazy expr
+ | Null
+ | Upcast expr
+ | Downcast expr
+/*
+ | '{' 'new baseCall' objectMembers interfaceImpls '}'
+ | '{' fieldInitializers '}'
+ | '{' expr 'with' fieldInitializers '}'
+ | '[' expr (';' expr)* '|'
+ | '[|' expr (';' expr)* '|]'
+ | '[' compOrRangeExpr ']'
+ | '[|' compOrRangeExpr '|]'
+*/
+ )
+ ( Dot longIdentOrOp
+ | expr
+ | LParen expr RParen
+ | '<' types '>'
+ | infixOp expr
+ | Dot '[' expr ']'
/*
- | '(' expr ')'
- | 'begin' expr 'end'
- | longIdentOrOp
- | expr Dot longIdentOrOp
- | expr expr
- | expr '(' expr ')'
- | expr '<' types '>'
- | expr infixOp expr
- | prefixOp expr
- | expr Dot '[' expr ']'
- | expr Dot '[' sliceRange ']'
- | expr Dot '[' sliceRange ',' sliceRange ']'
- | expr '<-' expr
- | expr (',' expr)+
- | 'new' type expr
- | '{' 'new baseCall' objectMembers interfaceImpls '}'
- | '{' fieldInitializers '}'
- | '{' expr 'with' fieldInitializers '}'
- | '[' expr (';' expr)* '|'
- | '[|' expr (';' expr)* '|]'
- | expr '{' compOrRangeExpr '}'
- | '[' compOrRangeExpr ']'
- | '[|' compOrRangeExpr '|]'
- | 'lazy' expr
- | 'null'
- | expr ':' type
- | expr ':>' type
- | expr ':?' type
- | expr ':?>' type
- | 'upcast' expr
- | 'downcast' expr
+ | Dot '[' sliceRange ']'
+ | Dot '[' sliceRange ',' sliceRange ']'
*/
+ | LArrow expr
+ | (',' expr)+
+/*
+ | '{' compOrRangeExpr '}'
+*/
+ | Colon type
+ | ColonGreater type
+ | ColonQMark type
+ | ColonQMarkGreater type
+ )?
;
functionOrValueDefn

0 comments on commit 43eb5c9

Please sign in to comment.