Beispiel #1
0
 private void ExpectStartOfLine(char c)
 {
     if (c == '\r')
     {
     }
     else if (c == '\n')
     {
         ++LineNumber;
     }
     else if (c == '[')
     {
         Buffer.Clear();
         NumberOfClosingBracketsExpected = 0;
         ParserState = ExpectKeyPath;
     }
     else if (c == '@')
     {
         CurrentValue = CurrentKey.FindOrCreateValue(null);
         ParserState = ExpectEqualSign;
     }
     else if (c == '"')
     {
         Buffer.Clear();
         ParserState = ExpectValueNameDefinition;
     }
     else if ((c == '#') && AllowHashtagComments)
     {
         Buffer.Clear();
         ParserState = ExpectCommentUntilEndOfLine;
     }
     else if ((c == ';') && AllowSemicolonComments)
     {
         Buffer.Clear();
         ParserState = ExpectCommentUntilEndOfLine;
     }
     else
     {
         throw SyntaxError("ERROR, don't support values yet; '{0}'", c);
     }
 }