private void ProcessSingleByteToken(JsonTextTokenType jsonTextTokenType) { ////https://tools.ietf.org/html/rfc7159#section-2 ////These are the six structural characters: ////begin-array = ws %x5B ws ; [ left square bracket ////begin-object = ws %x7B ws ; { left curly bracket ////end-array = ws %x5D ws ; ] right square bracket ////end-object = ws %x7D ws ; } right curly bracket ////name-separator = ws %x3A ws ; : colon ////value-separator = ws %x2C ws ; , comma this.token.JsonTextTokenType = jsonTextTokenType; this.jsonTextBuffer.ReadCharacter(); this.RegisterToken(); }
private void ProcessIntegerToken(JsonTextTokenType jsonTextTokenType) { // Check for optional sign. if (this.jsonTextBuffer.PeekCharacter() == '-') { this.jsonTextBuffer.ReadCharacter(); } // There MUST best at least one digit if (!char.IsDigit(this.jsonTextBuffer.PeekCharacter())) { throw new JsonInvalidNumberException(); } // Read all digits while (char.IsDigit(this.jsonTextBuffer.PeekCharacter())) { this.jsonTextBuffer.ReadCharacter(); } this.token.JsonTextTokenType = jsonTextTokenType; this.RegisterToken(); }
private static JsonTokenType JsonTextToJsonTokenType(JsonTextTokenType jsonTextTokenType) { return((JsonTokenType)((int)jsonTextTokenType & 0xFFFF)); }