コード例 #1
0
        public ICodeblock Compile(string macro)
        {
            ObjectCompilation compiler = GetObjectCompiler(true);
            var m = compiler.Compile(macro);

            if (m.Diagnostic != null)
            {
                throw m.Diagnostic;
            }
            return(new XSharp.MacroCompiler.ObjectMacro.MacroCodeblock(m.Macro, m.ParamCount));
        }
コード例 #2
0
        public ICodeblock Compile(string macro, bool lAllowSingleQuotes, Module module, out bool isCodeblock, out bool addsMemVars)

        {
            isCodeblock = macro.Replace(" ", "").StartsWith("{|");
            addsMemVars = false;
            ObjectCompilation compiler = GetObjectCompiler(lAllowSingleQuotes);
            var m = compiler.Compile(macro);

            if (m.Diagnostic != null)
            {
                throw m.Diagnostic;
            }
            if (m.CreatesAutoVars)
            {
                addsMemVars = false;
                return(new XSharp.MacroCompiler.ObjectMacro.MacroMemVarCodeblock(m.Macro, m.ParamCount));
            }
            else
            {
                return(new XSharp.MacroCompiler.ObjectMacro.MacroCodeblock(m.Macro, m.ParamCount));
            }
        }