public StatementBlock ParseBlock(INextAwareEnumerator<Token> reader, IParserContext context, out Token terminationToken) { var statements = new List<LuaStatement>(); while (!_terminatingTokens.Contains(reader.Current.Value)) { statements.Add(SyntaxParser.ReadStatement(reader, context)); while (string.IsNullOrEmpty(reader.Current.Value) || reader.Current.Value == "\n") reader.MoveNext(); } terminationToken = reader.Current; reader.VerifyExpectedTokenAndMoveNext(_terminatingTokens); return new StatementBlock(statements); }
public UnexpectedTokenException(Token token) :base($"{token.Position}: '{token.Value}' was unexpected at this time") { }
public UnexpectedTokenException(Token token, params string[] expectedTokens) : base($"{token.Position}: '{token.Value}' was unexpected at this time, expected '{string.Join("' or '", expectedTokens)}'") { }