Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplifying ruleset
  • Loading branch information
T-Gro committed Nov 9, 2023
commit e94708663e6fa1ec7cecfcd852c79311d14c9bbf
9 changes: 0 additions & 9 deletions src/Compiler/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -4884,15 +4884,6 @@ atomicExpr:
let expr, hpa = $3
let trivia: SynExprDotLambdaTrivia = { UnderscoreRange = mUnderscore ; DotRange = mDot }
SynExpr.DotLambda(expr, unionRanges mUnderscore expr.Range, trivia), false }

| UNDERSCORE DOT appExpr %prec dot_lambda
{ let mUnderscore = rhs parseState 1
let mDot = rhs parseState 2
parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AccessorFunctionShorthand (unionRanges mUnderscore mDot )
reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnderScoreDotLambdaNonAtomic())
let expr = $3
let trivia: SynExprDotLambdaTrivia = { UnderscoreRange = mUnderscore ; DotRange = mDot }
SynExpr.DotLambda(expr, unionRanges mUnderscore expr.Range, trivia), false }

| atomicExpr HIGH_PRECEDENCE_BRACK_APP atomicExpr
{ let arg1, _ = $1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ ImplFile
None),
Named (SynIdent (myFunc, None), false, None, (1,4--1,10)),
None,
DotLambda
(App
(NonAtomic, false, Ident MyMethodCall,
Const (Unit, (1,28--1,30)), (1,15--1,30)), (1,13--1,30),
{ UnderscoreRange = (1,13--1,14)
DotRange = (1,14--1,15) }), (1,4--1,10), Yes (1,0--1,30),
App
(NonAtomic, false,
DotLambda
(Ident MyMethodCall, (1,13--1,27),
{ UnderscoreRange = (1,13--1,14)
DotRange = (1,14--1,15) }), Const (Unit, (1,28--1,30)),
(1,13--1,30)), (1,4--1,10), Yes (1,0--1,30),
{ LeadingKeyword = Let (1,0--1,3)
InlineKeyword = None
EqualsRange = Some (1,11--1,12) })], (1,0--1,30))],
PreXmlDocEmpty, [], None, (1,0--1,30), { LeadingKeyword = None })],
(true, true), { ConditionalDirectives = []
CodeComments = [] }, set []))

(1,0)-(1,30) parse error Incomplete structured construct at or before this point in expression
(1,13)-(1,14) parse error _. shorthand syntax for lambda functions can only be used with atomic expressions. That means expressions with no whitespace unless enclosed in parentheses.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@ ImplFile
None),
Named (SynIdent (myFunc, None), false, None, (1,4--1,10)),
None,
DotLambda
(App
App
(NonAtomic, false,
App
(NonAtomic, false,
App
(NonAtomic, false,
App
(NonAtomic, false, Ident ThisIsMyFunction, Ident a,
(1,15--1,33)), Ident b, (1,15--1,35)), Ident c,
(1,15--1,37)), (1,13--1,37),
{ UnderscoreRange = (1,13--1,14)
DotRange = (1,14--1,15) }), (1,4--1,10), Yes (1,0--1,37),
DotLambda
(Ident ThisIsMyFunction, (1,13--1,31),
{ UnderscoreRange = (1,13--1,14)
DotRange = (1,14--1,15) }), Ident a,
(1,13--1,33)), Ident b, (1,13--1,35)), Ident c,
(1,13--1,37)), (1,4--1,10), Yes (1,0--1,37),
{ LeadingKeyword = Let (1,0--1,3)
InlineKeyword = None
EqualsRange = Some (1,11--1,12) })], (1,0--1,37))],
PreXmlDocEmpty, [], None, (1,0--1,37), { LeadingKeyword = None })],
(true, true), { ConditionalDirectives = []
CodeComments = [] }, set []))

(1,0)-(1,37) parse error Incomplete structured construct at or before this point in expression
(1,13)-(1,14) parse error _. shorthand syntax for lambda functions can only be used with atomic expressions. That means expressions with no whitespace unless enclosed in parentheses.