fCraft.SimpleParser.ReadTerm C# (CSharp) Method

ReadTerm() private static method

private static ReadTerm ( string s, int &pos ) : string
s string
pos int
return string
        private static string ReadTerm( string s, ref int pos )
        {
            ReadSpaces( s, ref pos );

            char ch = s[pos];
            if ( _operators.ContainsKey( ch ) || _soperators.ContainsKey( ch ) || _uoperators.ContainsKey( ch ) || /*tmp*/ch == '=' ) {
                string ret = new string( s[pos], 1 );
                ++pos;
                ReadSpaces( s, ref pos );
                return ret;
            }
            StringBuilder term = new StringBuilder();
            while ( pos < s.Length ) {
                if ( Char.IsLetterOrDigit( s[pos] ) || s[pos] == '.' ) //no support for exp number form!
                    term.Append( s[pos] );
                else
                    break;
                ++pos;
            }

            ReadSpaces( s, ref pos );

            return term.ToString();
        }