BitOrchestra.Parser.AcceptAssignment C# (CSharp) Method

AcceptAssignment() public static method

Tries parsing an assignment.
public static AcceptAssignment ( Expression>.Dictionary Variables, string Text, int &Index, string &Name, Expression &Value, int &ErrorIndex ) : bool
Variables Expression>.Dictionary
Text string
Index int
Name string
Value Expression
ErrorIndex int
return bool
        public static bool AcceptAssignment(Dictionary<string, Expression> Variables, string Text, ref int Index, ref string Name, ref Expression Value, out int ErrorIndex)
        {
            ErrorIndex = Index;
            int cur = Index;
            if (AcceptWord(Text, ref cur, ref Name))
            {
                AcceptExtendedWhitespace(Text, ref cur);
                if (AcceptString("=", Text, ref cur))
                {
                    AcceptExtendedWhitespace(Text, ref cur);
                    if (AcceptExpression(Variables, Text, ref cur, ref Value, out ErrorIndex))
                    {
                        AcceptExtendedWhitespace(Text, ref cur);
                        if (AcceptString(";", Text, ref cur))
                        {
                            Index = cur;
                            return true;
                        }
                    }
                }
            }
            return false;
        }