internal UsualCompilation GetUsualCompiler(bool lVo) { if (Options.AllowOldStyleComments != lVo || usualCompiler == null) { options.AllowSingleQuotedStrings = lVo; usualCompiler = new UsualCompilation(options); objectCompiler = null; } return(usualCompiler); }
internal ObjectCompilation GetObjectCompiler(bool lVo) { if (Options.AllowOldStyleComments != lVo || objectCompiler == null) { options.AllowSingleQuotedStrings = lVo; objectCompiler = ObjectCompilation.Create(options); usualCompiler = null; } return(objectCompiler); }
public _Codeblock CompileCodeblock(string macro) { UsualCompilation compiler = GetUsualCompiler(true); var m = compiler.Compile(macro); if (m.Diagnostic != null) { throw m.Diagnostic; } return(new XSharp.MacroCompiler.UsualMacro.MacroCodeblock(m.Macro, m.ParamCount, macro, macro.Replace(" ", "").StartsWith("{|"))); }
public _Codeblock CompileCodeblock(string macro, bool lAllowSingleQuotes, Module module) { var isCodeblock = macro.Replace(" ", "").StartsWith("{|"); UsualCompilation compiler = GetUsualCompiler(lAllowSingleQuotes); var m = compiler.Compile(macro); if (m.Diagnostic != null) { throw m.Diagnostic; } if (m.CreatesAutoVars) { return(new XSharp.MacroCompiler.UsualMacro.MacroMemVarCodeblock(m.Macro, m.ParamCount, macro, isCodeblock)); } else { return(new XSharp.MacroCompiler.UsualMacro.MacroCodeblock(m.Macro, m.ParamCount, macro, isCodeblock)); } }