Esempio n. 1
0
        public SimpleRecResult Recognize(IdContainer Container, CodeString Code, GetIdOptions Options, ref Identifier Ret)
        {
            if (!Check(Container.State, Code))
            {
                return(SimpleRecResult.Failed);
            }

            var NewCode = Code.TrimBrackets(Container.State);

            if (!NewCode.IsValid)
            {
                return(SimpleRecResult.Failed);
            }
            if (NewCode.Length == Code.Length)
            {
                return(SimpleRecResult.Unknown);
            }

            Ret = Identifiers.Recognize(Container, NewCode, Options);
            return(Ret == null ? SimpleRecResult.Failed : SimpleRecResult.Succeeded);
        }
Esempio n. 2
0
        public ExprRecResult Recognize(CodeString Code, PluginRoot Plugin, ref ExpressionNode Ret)
        {
            if (!Check(Plugin.State, Code))
            {
                return(ExprRecResult.Failed);
            }

            var NewCode = Code.TrimBrackets(Plugin.State);

            if (!NewCode.IsValid)
            {
                return(ExprRecResult.Failed);
            }
            if (NewCode.Length == Code.Length)
            {
                return(ExprRecResult.Unknown);
            }

            Ret = Expressions.Recognize(NewCode, Plugin, true);
            return(Ret == null ? ExprRecResult.Failed : ExprRecResult.Ready);
        }