-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Lua-CSharp/src/Lua/CodeAnalysis/Syntax/Parser.cs
Lines 115 to 143 in ad6a5a1
| case SyntaxTokenType.Local: | |
| { | |
| // skip 'local' keyword | |
| CheckCurrentAndSkip(ref enumerator, SyntaxTokenType.Local, out var localToken); | |
| // local function | |
| if (enumerator.Current.Type is SyntaxTokenType.Function) | |
| { | |
| // skip 'function' keyword | |
| CheckCurrentAndSkip(ref enumerator, SyntaxTokenType.Function, out var functionToken); | |
| enumerator.SkipEoL(); | |
| return ParseLocalFunctionDeclarationStatement(ref enumerator, functionToken); | |
| } | |
| CheckCurrent(ref enumerator, SyntaxTokenType.Identifier); | |
| var nextType = enumerator.GetNext().Type; | |
| if (nextType is SyntaxTokenType.Comma or SyntaxTokenType.Assignment) | |
| { | |
| return ParseLocalAssignmentStatement(ref enumerator, localToken); | |
| } | |
| else if (nextType is SyntaxTokenType.EndOfLine or SyntaxTokenType.SemiColon) | |
| { | |
| return new LocalAssignmentStatementNode([new IdentifierNode(enumerator.Current.Text, enumerator.Current.Position)], [], localToken.Position); | |
| } | |
| } | |
| break; |
Hi,
In standard Lua, the following code is valid:
local a
= 3
But in this implementation, it throws a syntax error.
Is there a reason this form isn’t supported?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels