public static string TestStatementParser(string compiland, GlobalSymbolList symbols = null) { using (TestCompilerContext context = TestCompilerContext.Create(compiland, symbols, CompilationFlags.NoDebug)) { context.ParseStatement(); Assert.AreEqual(0, context.ErrorCount, context.FirstError.ToString()); return(context.GetCompilerOutput()); } }
public static string TestCompileProgram(string compiland, bool writeDebugInfo = false) { CompilationFlags flags = writeDebugInfo ? CompilationFlags.None : CompilationFlags.NoDebug; using (TestCompilerContext context = TestCompilerContext.Create(compiland, null, flags)) { context.ParseProgram(); Assert.AreEqual(0, context.ErrorCount, context.FirstError.ToString()); return(context.GetCompilerOutput()); } }