public static StatementBlock Parse(string s) { var statements = new List<LuaStatement>(); var reader = new StringReader(s); var rootScope = new Scope(); var context = new ParserContext(rootScope); INextAwareEnumerator<Token> enumerator = Tokenizer.Parse(reader); while (enumerator.HasNext && enumerator.MoveNext()) { var statement = ReadStatement(enumerator, context); statements.Add(statement); } return new StatementBlock(statements); }
public IScope AcquireScope() { var scope = new Scope(CurrentScope); CurrentScope = scope; return scope; }