Example #1
0
        private static IEnumerable<ProtoCore.AST.Node> ParseUserCode(ProtoCore.Core core, string expression, string postfixGuid)
        {
            IEnumerable<ProtoCore.AST.Node> astNodes = new List<ProtoCore.AST.Node>();

            if (expression == null)
                return astNodes;

            expression = expression.Replace("\r\n", "\n");

            bool parseSuccess = false;
            try
            {
                return ParseUserCodeCore(core, expression, postfixGuid, ref parseSuccess);
            }
            catch
            {
                // For modifier blocks, language blocks, etc. that are currently ignored
                if (parseSuccess)
                    return astNodes;

                // Reset core above as we don't wish to propagate these errors - pratapa
                core.ResetForPrecompilation();

                // Use manual parsing for invalid functional associative statement errors like for "a+b;"
                return ParseNonAssignments(core, expression, postfixGuid);
            }
        }