private void ScanInterpolation(LineProgress p, bool skipOnly)
        {
            while (!p.EndOfLine)
            {
                if (p.Char() == '$' && p.NextChar() == '@' && p.NextNextChar() == '"') // interpolated multiline string
                {
                    p.Advance(3);
                    ScanMultiLineString(p, true, true);
                }
                else if (p.Char() == '$' && p.NextChar() == '"') // interpolated string
                {
                    p.Advance(2);
                    ScanString(p, true, true);
                }
                else
                if (p.Char() == '@' && p.NextChar() == '"') // multi-line string
                {
                    p.Advance(2);
                    ScanMultiLineString(p, false, true);
                }
                else if (p.Char() == '"') // single-line string
                {
                    p.Advance();
                    ScanString(p, false, true);
                }
                else if (p.Char() == '\'') // character
                {
                    p.Advance();
                    ScanCharacter(p, true);
                }
                else if (p.Char() == '/' && p.NextChar() == '*') // multiline comment
                {
                    p.Advance();
                    ScanMultiLineComment(p, true); // note we do not support multiline comments spanning muliple lines.
                }
                else if (p.Char() == '}')          // end of interpolation.
                {
                    p.Advance();
                    if (!skipOnly)
                    {
                        p.EndStringInterpolation();
                    }
                    return;
                }
                else
                {
                    p.Advance();
                }
            }

            if (!skipOnly)
            {
                // end of line: note that we do not support interpolations spanning muliple lines.
                p.EndStringInterpolation();
            }
        }
 private void ScanDefault(LineProgress p)
 {
     while (!p.EndOfLine)
     {
         if (p.Char() == '$' && p.NextChar() == '@' && p.NextNextChar() == '"') // interpolated multiline string
         {
             p.Advance(3);
             p.StartString(State.InterpolatedMultiLineString);
             ScanMultiLineString(p, true);
         }
         else if (p.Char() == '$' && p.NextChar() == '"') // interpolated string
         {
             p.Advance(2);
             p.StartString(State.InterpolatedString);
             ScanString(p, true);
         }
         else
         if (p.Char() == '@' && p.NextChar() == '"') // multi-line string
         {
             p.Advance(2);
             p.StartString(State.MultiLineString);
             ScanMultiLineString(p, false);
         }
         else if (p.Char() == '"') // single-line string
         {
             p.Advance();
             p.StartString(State.String);
             ScanString(p, false);
         }
         else if (p.Char() == '\'') // character
         {
             p.Advance();
             ScanCharacter(p);
         }
         else if (p.Char() == '/' && p.NextChar() == '*') // multiline comment
         {
             p.Advance(2);
             p.State = State.MultilineComment;
             ScanMultiLineComment(p);
         }
         else if (p.Char() == '/' && p.NextChar() == '/') // single-line comment
         {
             p.AdvanceToEndOfLine();
         }
         else
         {
             p.Advance();
         }
     }
 }