This commit is contained in:
Rohan Singh
2019-01-23 22:52:45 -05:00
parent 3f69ec7987
commit ad50a19057
103 changed files with 5734 additions and 1 deletions
@@ -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);
}
}
}