Example #1
0
        private bool readEndOfString(StringScanner scanner, out StringToken result)
        {
            if (scanner.EndReached)
            {
                result = new MathFormatToken(MathFormatTokenType.EndOfString);
            }
            else
            {
                result = default;
            }

            return(false);
        }
Example #2
0
        private bool readWhitespace(StringScanner scanner, out StringToken result)
        {
            using (var token = scanner.SaveIndex())
            {
                while (char.IsWhiteSpace(scanner.CurrentChar))
                {
                    scanner.Increment();
                }

                if (scanner.GetRelativeIndex(token) > 0)
                {
                    result = new MathFormatToken(MathFormatTokenType.WhiteSpace);
                    return(true);
                }

                result = default;
                return(false);
            }
        }