Ejemplo n.º 1
0
        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("{|")));
        }
Ejemplo n.º 2
0
        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));
            }
        }