src/sys/dotnet/fanx/serial/Tokenizer.cs
/// <summary>
/// Parse a string literal token.
/// </summary>
Parse a string literal token.
Parse a string literal token .
private int str()
    {
      consume();  
      StringBuilder s = new StringBuilder();
      bool loop = true;
      while (loop)
      {
        switch (cur)
        {
          case '"':   consume(); loop = false; break;
          case -1:    throw err("Unexpected end of string");
          case '$':   throw err("Interpolated strings unsupported");
          case '\\':  s.Append(escape()); break;
          case '\r':  s.Append('\n'); consume(); break;
          default:    s.Append((char)cur); consume(); break;
        }
      }
      m_val = s.ToString();
      return Token.STR_LITERAL;
    }
private int str ( ) { consume ( ) ; StringBuilder s = new StringBuilder ( ) ; bool loop = true ; while ( loop ) { switch ( cur ) { case ' ' : consume ( ) ; loop = false ; break ; case - 1 : throw err ( " " ) ; case ' ' : throw err ( " " ) ; case ' \\ ' : s . Append ( escape ( ) ) ; break ; case ' \r ' : s . Append ( ' \n ' ) ; consume ( ) ; break ; default : s . Append ( ( char ) cur ) ; consume ( ) ; break ; } } m_val = s . ToString ( ) ; return Token . STR_LITERAL ; }
Parse a string literal token.
Parse a string literal token .
// opening quote