mirror of
https://github.com/Cekis/SWG-ScriptConverter.git
synced 2026-09-11 22:44:59 -04:00
Add code
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using ScriptConverter.Ast.Statements;
|
||||
|
||||
namespace ScriptConverter.Parser.Parselets.Statements
|
||||
{
|
||||
class BlockParselet : IStatementParselet
|
||||
{
|
||||
public Statement Parse(ScriptParser parser, ScriptToken token, out bool trailingSemicolon)
|
||||
{
|
||||
trailingSemicolon = false;
|
||||
|
||||
var statements = new List<Statement>();
|
||||
|
||||
while (!parser.Match(ScriptTokenType.RightBrace))
|
||||
{
|
||||
statements.Add(parser.ParseStatement());
|
||||
}
|
||||
|
||||
parser.Take(ScriptTokenType.RightBrace);
|
||||
|
||||
return new BlockStatement(token, parser.Previous, statements);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user