mirror of
https://github.com/Cekis/SWG-ScriptConverter.git
synced 2026-09-11 22:44:59 -04:00
24 lines
646 B
C#
24 lines
646 B
C#
using ScriptConverter.Ast.Statements;
|
|
|
|
namespace ScriptConverter.Parser.Parselets.Statements
|
|
{
|
|
class DoParselet : IStatementParselet
|
|
{
|
|
public Statement Parse(ScriptParser parser, ScriptToken token, out bool trailingSemicolon)
|
|
{
|
|
trailingSemicolon = true;
|
|
|
|
var block = parser.ParseBlock();
|
|
|
|
parser.Take(ScriptTokenType.While);
|
|
parser.Take(ScriptTokenType.LeftParen);
|
|
|
|
var condition = parser.ParseExpression();
|
|
|
|
parser.Take(ScriptTokenType.RightParen);
|
|
|
|
return new DoStatement(token, parser.Previous, condition, block);
|
|
}
|
|
}
|
|
}
|