Esempio n. 1
0
        internal MultiStatement GetVariableValue(string variableName, TextObject parent)
        {
            TextObject  variable    = (TextObject)null;
            MBTextModel mbTextModel = (MBTextModel)null;

            if (parent == null || !parent.GetVariableValue(variableName, out variable))
            {
                this._variables.TryGetValue(variableName, out variable);
            }
            if (variable != null)
            {
                mbTextModel = MBTextParser.Parse(MBTextManager.Tokenizer.Tokenize(variable.ToString()));
            }
            if (mbTextModel == null)
            {
                return((MultiStatement)null);
            }
            return(mbTextModel.RootExpressions.Count == 1 && mbTextModel.RootExpressions[0] is MultiStatement ? new MultiStatement((IEnumerable <TextExpression>)(mbTextModel.RootExpressions[0] as MultiStatement).SubStatements) : new MultiStatement((IEnumerable <TextExpression>)mbTextModel.RootExpressions));
        }
Esempio n. 2
0
        internal MultiStatement GetArrayAccess(string variableName, int index)
        {
            TextObject textObject;

            return(this._variables.TryGetValue(variableName + ":" + (object)index, out textObject) ? new MultiStatement((IEnumerable <TextExpression>)MBTextParser.Parse(MBTextManager.Tokenizer.Tokenize(textObject.ToString())).RootExpressions) : (MultiStatement)null);
        }