Example #1
0
        internal Object doRead(LocTextReader t, Boolean firstInForm)
        {
            Int32 ch = t.Read();

            while (Char.IsWhiteSpace((Char)ch))
            {
                ch = t.Read();
            }
            if (ch == -1)
            {
                //return null;
                //return Symbol.EOF;
                return(EOF_MARKER);
            }
            if (ch == '#')
            {
                eatMultiComment(t);
                return(doRead(t, firstInForm));
            }
            if (ch == ';')
            {
                eatComment(t);
                return(doRead(t, firstInForm));
            }
            ReaderMacro rm = (ReaderMacro)macroTable[(Char)ch];

            if (rm != null)
            {
                return(rm.func(t, (Char)ch));
            }
            else
            {
                return(readSymbolOrNumber(t, ch, firstInForm));
            }
        }
Example #2
0
        internal Object doRead(LocTextReader t, Boolean firstInForm)
        {
            //MEH: Converted the following from a while loop, and avoid checked build issues with ((Char)-1).
            Int32 ch;    // = t.Read();

            do
            {
                ch = t.Read();
                if (ch == -1)
                {
                    //return null;
                    //return Symbol.EOF;
                    return(EOF_MARKER);
                }
            }while(Char.IsWhiteSpace((Char)ch));
            if (ch == '#')
            {
                eatMultiComment(t);
                return(doRead(t, firstInForm));
            }
            if (ch == ';')
            {
                eatComment(t);
                return(doRead(t, firstInForm));
            }
            ReaderMacro rm = (ReaderMacro)macroTable[(Char)ch];

            if (rm != null)
            {
                return(rm.func(t, (Char)ch));
            }
            else
            {
                return(readSymbolOrNumber(t, ch, firstInForm));
            }
        }