private void skipWhitespace() {

        // if we are EOF, return
        if (numChars == -1)
            return;

        // read whitespace
        while (true) {

            // if we are at the end of the buffer, read more
            if (pos == numChars)
                readMore();

            // if we are EOF, return
            if (numChars == -1)
                return;

            switch (buffer[pos]) {
                // if it's whitespace, but not a newline, advance the read position and column counter
                case ' ': case '\t': case '\f': case '\r': ++pos; ++col; break;
                // if it's a newline, advance the read position and the line counter, and reset the column counter
                case '\n': ++pos; ++line; col=1; break;
                // not whitespace, return
                default: return;
            }

        }
    }