private void RunTest(string resourceName) { var t = new TestFile(); t.LoadFromString(LoadTextResource(resourceName)); // Compile the input script var c = new Compiler(); c.Formatted = t.Input.IndexOf("[Formatted]") >= 0; c.NoObfuscate = t.Input.IndexOf("[NoObfuscate]") >= 0; c.SymbolInfo = t.Input.IndexOf("[SymbolInfo]") >= 0; c.MinifyKind = t.Input.IndexOf("[CSS]") >= 0 ? MinifyKind.CSS : MinifyKind.JS; c.NoCredit = true; c.MaxLineLength = 0; c.AddScript(resourceName, t.Input, false); // Render it string strActual = c.CompileToString().Trim(); //string sep = new string('-', 15); //Console.WriteLine(sep + " input " + sep + "\n" + t.Input); //Console.WriteLine(sep + " actual " + sep + "\n" + strActual); //Console.WriteLine(sep + " expected" + sep + "\n" + t.Output); Assert.That(strActual, Is.EqualTo(t.Output)); }
// Constructor public SymbolAllocator(Compiler c) { m_Compiler = c; // Create the global scope m_ScopeStack.Add(new Scope()); CurrentScope.NextSymbol = "a"; }
// Constructor public Tokenizer(Compiler Compiler, string str, string strFileName, bool bWarnings) { this.Compiler=Compiler; // Prep the string scanner p = new StringScanner(); p.Reset(str); p.FileName = strFileName; m_bWarnings = bWarnings; // Used to detect line breaks between tokens for automatic // semicolon insertion m_bPreceededByLineBreak = true; // Queue up the first token m_prevToken = Token.eof; Next(); }
public CommandLine(Compiler c) { m_compiler = c; m_warnings = true; }
// Constructor public RenderContext(Compiler c, SymbolAllocator SymbolAllocator, SymbolAllocator MemberAllocator) { m_Compiler = c; m_SymbolAllocator = SymbolAllocator; m_MemberAllocator = MemberAllocator; }
// Constructor public SymbolScope(Compiler Compiler, ast.Node node, Accessibility defaultAccessibility) { m_Compiler = Compiler; Node = node; DefaultAccessibility = defaultAccessibility; }