Skip to content

Commit

Permalink
Added line continuation after '.', '?.', '->' inside identifier expre…
Browse files Browse the repository at this point in the history
…ssions

Signed-off-by: D-a-n-i-l-o <D-a-n-i-l-o@users.noreply.github.com>
  • Loading branch information
D-a-n-i-l-o committed Sep 19, 2021
1 parent 2b57869 commit dc6bcd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wake/parser.wx
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,7 @@ Class Parser
Select Toke
Case "?."
Bump()
CParseEol() ' optional line continuation after '?.'
Local ident:=ParseIdent()
If Toke="("
Local args:=ParseInvokeArgs()
Expand All @@ -1707,6 +1708,7 @@ Class Parser
Endif
Case "."
Bump()
CParseEol() ' optional line continuation after '.'
Local ident:String
If CParse( "new" )
ident="new"
Expand All @@ -1718,6 +1720,7 @@ Class Parser
expr=New MemberExpr( expr,ident,srcpos,EndPos )
Case "->"
Bump()
CParseEol() ' optional line continuation after '->'
Local ident:=ParseIdent()
Local zero:=New LiteralExpr( "0",TOKE_INTLIT,Null,srcpos,EndPos )
expr=New IndexExpr( expr,New Expr[]( zero ),srcpos,EndPos )
Expand Down Expand Up @@ -2131,6 +2134,9 @@ Class Parser

Else

'
' Line continuation chars
'
If _toker.TokeType=TOKE_EOL And (ptoke="(" Or ptoke="[" Or ptoke="," ) Continue

Endif
Expand Down

0 comments on commit dc6bcd3

Please sign in to comment.