public void DefineVariableFromCode() { Tokenizer t = new Tokenizer(s_errorHandler, true); Parser p = new Parser(t.process(File.OpenText("code11.txt")), s_errorHandler); p.process(); ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler); scopeBuilder.process(); Scope globalScope = scopeBuilder.getGlobalScope(); Assert.IsNotNull(globalScope.resolve("x")); }
public void DefineFunction() { Tokenizer t = new Tokenizer(s_errorHandler, true); Parser p = new Parser(t.process(File.OpenText("code12.txt")), s_errorHandler); p.process(); ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler); scopeBuilder.process(); Scope globalScope = scopeBuilder.getGlobalScope(); Assert.IsNotNull(globalScope.resolve("foo")); }