diff --git a/MongoObjCDriver Tests/MODJsonParsingTestCase.m b/MongoObjCDriver Tests/MODJsonParsingTestCase.m index 03c98df7..1c33014e 100644 --- a/MongoObjCDriver Tests/MODJsonParsingTestCase.m +++ b/MongoObjCDriver Tests/MODJsonParsingTestCase.m @@ -368,4 +368,11 @@ - (void)testTrueFalseParsing shouldEqual:[MODSortedDictionary sortedDictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], @"false", [NSNumber numberWithBool:YES], @"true", nil]]; } +- (void)testInfinityAndNaN +{ + [self jsonTesterWithJsonToParse:@"{\"infinity\":Number.POSITIVE_INFINITY,\"-infinity\":Number.NEGATIVE_INFINITY,\"NaN\":Number.NaN}" + jsonExpected:nil + shouldEqual:[MODSortedDictionary sortedDictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:INFINITY], @"infinity", [NSNumber numberWithDouble:-INFINITY], @"-infinity", [NSNumber numberWithDouble:-NAN], @"NaN", nil]]; +} + @end diff --git a/Sources/MODClient_utils.m b/Sources/MODClient_utils.m index 650ace50..319f37a0 100644 --- a/Sources/MODClient_utils.m +++ b/Sources/MODClient_utils.m @@ -659,14 +659,23 @@ static void convertValueToJson(NSMutableString *result, int indent, id value, NS [result appendString:@"false"]; } } else if (strcmp([value objCType], @encode(double)) == 0 || strcmp([value objCType], @encode(float)) == 0) { - NSMutableString *stringValue; + NSString *stringValue; - // make sure a double always ends with .0 (at least) - stringValue = [NSMutableString stringWithFormat:@"%.20g", [value doubleValue]]; - if ([stringValue rangeOfString:@"."].location == NSNotFound) { - [stringValue appendString:@".0"]; - } - [result appendString:stringValue]; + if ([value doubleValue] == INFINITY) { + stringValue = @"Number.POSITIVE_INFINITY"; + } else if ([value doubleValue] == -INFINITY) { + stringValue = @"Number.NEGATIVE_INFINITY"; + } else if (isnan([value doubleValue])) { + stringValue = @"Number.NaN"; + } else { + // make sure a double always ends with .0 (at least) + NSMutableString *mutableStringValue = [NSMutableString stringWithFormat:@"%.20g", [value doubleValue]]; + if ([mutableStringValue rangeOfString:@"."].location == NSNotFound) { + [mutableStringValue appendString:@".0"]; + } + stringValue = mutableStringValue; + } + [result appendString:stringValue]; } else if (strcmp([value objCType], @encode(long long)) == 0 || strcmp([value objCType], @encode(unsigned long long)) == 0) { [result appendFormat:@"NumberLong(%@)", [value description]]; } else { diff --git a/Sources/MODRagelJsonParser.m b/Sources/MODRagelJsonParser.m index 680b6114..cdaa3a06 100644 --- a/Sources/MODRagelJsonParser.m +++ b/Sources/MODRagelJsonParser.m @@ -76,7 +76,7 @@ - (void)_makeErrorWithMessage:(NSString *)message atPosition:(const char *)posit } -#line 113 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 115 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" @@ -87,37 +87,56 @@ - (void)_makeErrorWithMessage:(NSString *)message atPosition:(const char *)posit 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, - 19, 1, 20 + 19, 1, 20, 1, 21, 1, 22, 1, + 23 }; static const char _JSON_value_key_offsets[] = { 0, 0, 20, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67 + 27, 28, 29, 30, 31, 32, 33, 34, + 35, 37, 39, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 78, + 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113 }; static const char _JSON_value_trans_keys[] = { 34, 39, 45, 47, 66, 68, 70, 77, 78, 79, 83, 84, 91, 102, 110, 116, 117, 123, 48, 57, 97, 105, 120, 75, - 101, 121, 110, 75, 101, 121, 99, 121, - 111, 112, 101, 70, 117, 110, 99, 116, - 105, 111, 110, 109, 98, 111, 108, 97, - 108, 115, 101, 101, 117, 119, 108, 108, - 114, 117, 101, 110, 100, 101, 102, 105, - 110, 101, 100, 0 + 101, 121, 110, 75, 101, 121, 117, 109, + 98, 101, 114, 46, 76, 78, 80, 69, + 97, 71, 65, 84, 73, 86, 69, 95, + 73, 78, 70, 73, 78, 73, 84, 89, + 78, 79, 83, 73, 84, 73, 86, 69, + 95, 73, 78, 70, 73, 78, 73, 84, + 89, 111, 110, 103, 99, 121, 111, 112, + 101, 70, 117, 110, 99, 116, 105, 111, + 110, 109, 98, 111, 108, 97, 108, 115, + 101, 101, 117, 119, 108, 108, 114, 117, + 101, 110, 100, 101, 102, 105, 110, 101, + 100, 0 }; static const char _JSON_value_single_lengths[] = { 0, 18, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0 }; static const char _JSON_value_range_lengths[] = { @@ -126,52 +145,86 @@ - (void)_makeErrorWithMessage:(NSString *)message atPosition:(const char *)posit 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0 }; -static const unsigned char _JSON_value_index_offsets[] = { +static const short _JSON_value_index_offsets[] = { 0, 0, 20, 23, 25, 27, 29, 31, - 33, 35, 37, 39, 42, 44, 46, 48, - 50, 52, 54, 56, 58, 60, 62, 64, - 66, 68, 70, 72, 74, 76, 78, 80, - 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111 + 33, 35, 37, 39, 41, 43, 45, 47, + 49, 52, 55, 58, 60, 62, 64, 66, + 68, 70, 72, 74, 76, 78, 80, 82, + 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, + 116, 118, 120, 122, 124, 126, 128, 131, + 133, 135, 137, 139, 141, 143, 145, 147, + 149, 151, 153, 155, 157, 159, 161, 163, + 165, 167, 169, 172, 174, 176, 178, 180, + 182, 184, 186, 188, 190, 192, 194, 196, + 198, 200 }; static const char _JSON_value_trans_targs[] = { - 46, 46, 46, 46, 46, 46, 46, 2, - 46, 46, 11, 46, 46, 27, 31, 35, - 38, 46, 46, 0, 3, 7, 0, 4, - 0, 5, 0, 6, 0, 46, 0, 8, - 0, 9, 0, 10, 0, 46, 0, 12, - 23, 0, 13, 0, 14, 0, 15, 0, - 16, 0, 17, 0, 18, 0, 19, 0, - 20, 0, 21, 0, 22, 0, 46, 0, - 24, 0, 25, 0, 26, 0, 46, 0, - 28, 0, 29, 0, 30, 0, 46, 0, - 32, 33, 0, 46, 0, 34, 0, 46, - 0, 36, 0, 37, 0, 46, 0, 39, - 0, 40, 0, 41, 0, 42, 0, 43, - 0, 44, 0, 45, 0, 46, 0, 0, - 0 + 89, 89, 89, 89, 89, 89, 89, 2, + 11, 89, 54, 89, 89, 70, 74, 78, + 81, 89, 89, 0, 3, 7, 0, 4, + 0, 5, 0, 6, 0, 89, 0, 8, + 0, 9, 0, 10, 0, 89, 0, 12, + 0, 13, 0, 14, 0, 15, 0, 16, + 0, 17, 51, 0, 18, 35, 0, 19, + 34, 0, 20, 0, 21, 0, 22, 0, + 23, 0, 24, 0, 25, 0, 26, 0, + 27, 0, 28, 0, 29, 0, 30, 0, + 31, 0, 32, 0, 33, 0, 89, 0, + 89, 0, 36, 0, 37, 0, 38, 0, + 39, 0, 40, 0, 41, 0, 42, 0, + 43, 0, 44, 0, 45, 0, 46, 0, + 47, 0, 48, 0, 49, 0, 50, 0, + 89, 0, 52, 0, 53, 0, 89, 0, + 55, 66, 0, 56, 0, 57, 0, 58, + 0, 59, 0, 60, 0, 61, 0, 62, + 0, 63, 0, 64, 0, 65, 0, 89, + 0, 67, 0, 68, 0, 69, 0, 89, + 0, 71, 0, 72, 0, 73, 0, 89, + 0, 75, 76, 0, 89, 0, 77, 0, + 89, 0, 79, 0, 80, 0, 89, 0, + 82, 0, 83, 0, 84, 0, 85, 0, + 86, 0, 87, 0, 88, 0, 89, 0, + 0, 0 }; static const char _JSON_value_trans_actions[] = { - 15, 15, 17, 23, 29, 35, 33, 0, - 25, 13, 0, 27, 19, 0, 0, 0, - 0, 21, 17, 0, 0, 0, 0, 0, + 21, 21, 23, 29, 35, 41, 39, 0, + 0, 19, 0, 33, 25, 0, 0, 0, + 0, 27, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, - 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 39, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 11, 0, 0, - 0 + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, + 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 31, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 43, + 0, 0, 0, 0, 0, 0, 0, 37, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 0, 45, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 0, + 0, 0 }; static const char _JSON_value_from_state_actions[] = { @@ -180,17 +233,23 @@ - (void)_makeErrorWithMessage:(NSString *)message atPosition:(const char *)posit 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41 + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 47 }; static const int JSON_value_start = 1; -static const int JSON_value_first_final = 46; +static const int JSON_value_first_final = 89; static const int JSON_value_error = 0; static const int JSON_value_en_main = 1; -#line 271 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 288 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *)pe result:(id *)result @@ -198,14 +257,14 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) int cs = 0; -#line 202 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 261 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_value_start; } -#line 278 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 295 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 209 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 268 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -222,11 +281,11 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) _nacts = (unsigned int) *_acts++; while ( _nacts-- > 0 ) { switch ( *_acts++ ) { - case 20: -#line 247 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 23: +#line 261 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 230 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 289 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -291,57 +350,75 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) switch ( *_acts++ ) { case 0: -#line 121 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 123 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = [NSNull null]; } break; case 1: -#line 124 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 126 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = [NSNumber numberWithBool:NO]; } break; case 2: -#line 127 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 129 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = [NSNumber numberWithBool:YES]; } break; case 3: -#line 131 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 133 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = MOD_AUTORELEASE([[MODMinKey alloc] init]); } break; case 4: -#line 135 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 137 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = MOD_AUTORELEASE([[MODMaxKey alloc] init]); } break; case 5: -#line 139 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 141 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { *result = MOD_AUTORELEASE([[MODUndefined alloc] init]); } break; case 6: -#line 143 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 145 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + { + *result = [NSNumber numberWithDouble:INFINITY]; + } + break; + case 7: +#line 149 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + { + *result = [NSNumber numberWithDouble:-INFINITY]; + } + break; + case 8: +#line 153 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + { + *result = [NSNumber numberWithDouble:NAN]; + } + break; + case 9: +#line 157 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseObjectIdWithPointer:p endPointer:pe result:result]; if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 7: -#line 148 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 10: +#line 162 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseStringWithPointer:p endPointer:pe result:result]; if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 8: -#line 153 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 11: +#line 167 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseFloatWithPointer:p endPointer:pe result:result]; @@ -351,8 +428,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) p--; {p++; goto _out; } } break; - case 9: -#line 162 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 12: +#line 176 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; _currentNesting++; @@ -361,8 +438,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 10: -#line 170 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 13: +#line 184 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; _currentNesting++; @@ -371,29 +448,29 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 11: -#line 178 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 14: +#line 192 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseRegexpWithPointer:p endPointer:pe result:result]; if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 12: -#line 183 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 15: +#line 197 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { - const char *np = [self _parseNumberLongWithPointer:p endPointer:pe result:result]; + const char *np = [self _parseNumberLongWithPointer:p - strlen("NumberLong") + 1 endPointer:pe result:result]; if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 13: -#line 188 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 16: +#line 202 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseTimestampWithPointer:p endPointer:pe result:result]; if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; - case 14: -#line 193 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 17: +#line 207 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseBinDataWithPointer:p endPointer:pe result:result]; if (np == NULL) { @@ -403,8 +480,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; - case 15: -#line 202 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 18: +#line 216 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseSymbolWithPointer:p - strlen("Symbol") + 1 endPointer:pe result:result]; if (np == NULL) { @@ -414,8 +491,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; - case 16: -#line 211 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 19: +#line 225 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseFunctionWithPointer:p endPointer:pe result:result]; if (np == NULL) { @@ -425,8 +502,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; - case 17: -#line 220 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 20: +#line 234 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseDBPointerWithPointer:p endPointer:pe result:result]; if (np == NULL) { @@ -436,8 +513,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; - case 18: -#line 229 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 21: +#line 243 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseScopeFunctionWithPointer:p - strlen("ScopeFunction") + 1 endPointer:pe result:result]; if (np == NULL) { @@ -447,8 +524,8 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; - case 19: -#line 238 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" + case 22: +#line 252 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np = [self _parseJavascriptObjectWithPointer:p - 2 endPointer:pe result:result]; if (np == NULL) { @@ -458,7 +535,7 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } } break; -#line 462 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 539 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -471,7 +548,7 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) _out: {} } -#line 279 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 296 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (*result == nil || cs < JSON_value_first_final) { [self _makeErrorWithMessage:@"cannot parse value" atPosition:p]; @@ -482,7 +559,7 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) } -#line 486 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 563 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_integer_actions[] = { 0, 1, 0 }; @@ -528,7 +605,7 @@ - (const char *)_parseValueWithPointer:(const char *)p endPointer:(const char *) static const int JSON_integer_en_main = 1; -#line 296 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 313 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char *)pe result:(NSNumber **)result @@ -537,15 +614,15 @@ - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char const char *memo; -#line 541 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 618 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_integer_start; } -#line 304 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 321 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" memo = p; -#line 549 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 626 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -620,10 +697,10 @@ - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char switch ( *_acts++ ) { case 0: -#line 293 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 310 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 627 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 704 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -636,7 +713,7 @@ - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char _out: {} } -#line 306 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 323 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_integer_first_final) { NSString *buffer; @@ -655,7 +732,7 @@ - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char } -#line 659 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 736 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_float_actions[] = { 0, 1, 0 }; @@ -713,7 +790,7 @@ - (const char *)_parseIntegerWithPointer:(const char *)p endPointer:(const char static const int JSON_float_en_main = 1; -#line 335 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 352 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *)pe result:(NSNumber **)result @@ -722,15 +799,15 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) const char *memo; -#line 726 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 803 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_float_start; } -#line 343 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 360 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" memo = p; -#line 734 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 811 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -805,10 +882,10 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) switch ( *_acts++ ) { case 0: -#line 329 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 346 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 812 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 889 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -821,7 +898,7 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) _out: {} } -#line 345 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 362 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_float_first_final) { NSUInteger length = p - memo; @@ -840,28 +917,28 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) } -#line 844 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 921 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_object_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; static const char _JSON_object_key_offsets[] = { - 0, 0, 1, 14, 19, 42, 48, 60 + 0, 0, 1, 14, 19, 41, 47, 59 }; static const char _JSON_object_trans_keys[] = { 123, 13, 32, 39, 95, 125, 9, 10, 34, 36, 65, 90, 97, 122, 13, 32, 58, 9, 10, 13, 32, 34, 39, 45, - 66, 68, 70, 73, 91, 102, 110, 123, - 9, 10, 47, 57, 77, 79, 83, 84, - 116, 117, 13, 32, 44, 125, 9, 10, - 13, 32, 39, 95, 9, 10, 34, 36, - 65, 90, 97, 122, 0 + 66, 68, 70, 91, 102, 110, 123, 9, + 10, 47, 57, 77, 79, 83, 84, 116, + 117, 13, 32, 44, 125, 9, 10, 13, + 32, 39, 95, 9, 10, 34, 36, 65, + 90, 97, 122, 0 }; static const char _JSON_object_single_lengths[] = { - 0, 1, 5, 3, 13, 4, 4, 0 + 0, 1, 5, 3, 12, 4, 4, 0 }; static const char _JSON_object_range_lengths[] = { @@ -869,17 +946,17 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) }; static const char _JSON_object_index_offsets[] = { - 0, 0, 2, 12, 17, 36, 42, 51 + 0, 0, 2, 12, 17, 35, 41, 50 }; static const char _JSON_object_indicies[] = { 0, 1, 0, 0, 2, 2, 3, 0, 2, 2, 2, 1, 4, 4, 5, 4, 1, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 5, 6, - 6, 6, 6, 1, 7, 7, 8, 3, - 7, 1, 8, 8, 2, 2, 8, 2, - 2, 2, 1, 1, 0 + 6, 6, 6, 6, 6, 5, 6, 6, + 6, 6, 1, 7, 7, 8, 3, 7, + 1, 8, 8, 2, 2, 8, 2, 2, + 2, 1, 1, 0 }; static const char _JSON_object_trans_targs[] = { @@ -899,7 +976,7 @@ - (const char *)_parseFloatWithPointer:(const char *)p endPointer:(const char *) static const int JSON_object_en_main = 1; -#line 399 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 416 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char *)pe result:(MODSortedDictionary **)result @@ -915,14 +992,14 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * dictionary = [MODSortedMutableDictionary sortedDictionary]; -#line 919 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 996 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_object_start; } -#line 414 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 431 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 926 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1003 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -997,7 +1074,7 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * switch ( *_acts++ ) { case 0: -#line 368 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 385 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { id value = nil; const char *np = [self _parseValueWithPointer:p endPointer:pe result:&value]; @@ -1010,7 +1087,7 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * } break; case 1: -#line 379 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 396 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; @@ -1022,10 +1099,10 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * } break; case 2: -#line 389 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 406 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 1029 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1106 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -1038,7 +1115,7 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * _out: {} } -#line 415 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 432 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_object_first_final) { MODSortedDictionary *tengen; @@ -1057,7 +1134,7 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * } -#line 1061 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1138 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_javascript_object_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; @@ -1129,7 +1206,7 @@ - (const char *)_parseObjectWithPointer:(const char *)p endPointer:(const char * static const int JSON_javascript_object_en_main = 1; -#line 473 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 490 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(const char *)pe result:(id *)result @@ -1138,14 +1215,14 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co NSMutableArray *parameters = [[NSMutableArray alloc] init]; -#line 1142 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1219 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_javascript_object_start; } -#line 481 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 498 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 1149 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1226 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -1220,7 +1297,7 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co switch ( *_acts++ ) { case 0: -#line 438 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 455 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; NSNumber *number; @@ -1235,7 +1312,7 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co } break; case 1: -#line 451 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 468 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; NSString *string = nil; @@ -1250,10 +1327,10 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co } break; case 2: -#line 464 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 481 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 1257 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1334 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -1266,7 +1343,7 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co _out: {} } -#line 482 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 499 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_javascript_object_first_final) { if (parameters.count == 1 && [[parameters objectAtIndex:0] isKindOfClass:NSString.class]) { @@ -1292,7 +1369,7 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co } -#line 1296 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1373 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_bin_data_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; @@ -1351,7 +1428,7 @@ - (const char *)_parseJavascriptObjectWithPointer:(const char *)p endPointer:(co static const int JSON_bin_data_en_main = 1; -#line 527 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 544 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char *)pe result:(MODBinary **)result @@ -1362,14 +1439,14 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char int cs = 0; -#line 1366 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1443 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_bin_data_start; } -#line 537 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 554 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 1373 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1450 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -1444,7 +1521,7 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char switch ( *_acts++ ) { case 0: -#line 512 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 529 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&dataStringValue]; @@ -1452,7 +1529,7 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char } break; case 1: -#line 518 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 535 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseIntegerWithPointer:p endPointer:pe result:&typeValue]; @@ -1460,10 +1537,10 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char } break; case 2: -#line 524 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 541 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 1467 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1544 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -1476,7 +1553,7 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char _out: {} } -#line 538 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 555 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" dataValue = dataStringValue.mod_dataFromBase64; if (cs >= JSON_bin_data_first_final && dataValue && [MODBinary isValidDataType:typeValue.unsignedCharValue] ) { @@ -1489,7 +1566,7 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char } -#line 1493 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1570 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_function_actions[] = { 0, 1, 0, 1, 1 }; @@ -1546,7 +1623,7 @@ - (const char *)_parseBinDataWithPointer:(const char *)p endPointer:(const char static const int JSON_function_en_main = 1; -#line 564 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 581 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char *)pe result:(MODFunction **)result @@ -1555,14 +1632,14 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char int cs = 0; -#line 1559 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1636 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_function_start; } -#line 572 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 589 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 1566 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1643 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -1637,7 +1714,7 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char switch ( *_acts++ ) { case 0: -#line 555 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 572 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&codeStringValue]; @@ -1645,10 +1722,10 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char } break; case 1: -#line 561 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 578 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 1652 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1729 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -1661,7 +1738,7 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char _out: {} } -#line 573 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 590 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_function_first_final && codeStringValue) { *result = MOD_AUTORELEASE([[MODFunction alloc] initWithFunction:codeStringValue]); @@ -1673,7 +1750,7 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char } -#line 1677 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1754 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_dbref_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; @@ -1734,7 +1811,7 @@ - (const char *)_parseFunctionWithPointer:(const char *)p endPointer:(const char static const int JSON_dbref_en_main = 1; -#line 614 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 631 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const char *)pe result:(MODDBPointer **)result @@ -1744,14 +1821,14 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha int cs = 0; -#line 1748 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1825 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_dbref_start; } -#line 623 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 640 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 1755 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1832 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -1826,7 +1903,7 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha switch ( *_acts++ ) { case 0: -#line 589 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 606 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&collectionName]; @@ -1834,7 +1911,7 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha } break; case 1: -#line 595 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 612 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; NSString *string = nil; @@ -1852,10 +1929,10 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha } break; case 2: -#line 611 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 628 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 1859 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1936 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -1868,7 +1945,7 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha _out: {} } -#line 624 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 641 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_dbref_first_final && collectionName && documentId) { *result = MOD_AUTORELEASE([[MODDBPointer alloc] initWithCollectionName:collectionName objectId:documentId]); @@ -1880,7 +1957,7 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha } -#line 1884 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 1961 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_scopefunction_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; @@ -1946,7 +2023,7 @@ - (const char *)_parseDBPointerWithPointer:(const char *)p endPointer:(const cha static const int JSON_scopefunction_en_main = 1; -#line 660 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 677 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const char *)pe result:(MODScopeFunction **)result @@ -1956,14 +2033,14 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const int cs = 0; -#line 1960 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2037 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_scopefunction_start; } -#line 669 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 686 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 1967 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2044 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -2038,7 +2115,7 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const switch ( *_acts++ ) { case 0: -#line 640 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 657 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&codeStringValue]; @@ -2046,7 +2123,7 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const } break; case 1: -#line 646 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 663 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; @@ -2059,10 +2136,10 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const } break; case 2: -#line 657 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 674 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 2066 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2143 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -2075,7 +2152,7 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const _out: {} } -#line 670 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 687 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_scopefunction_first_final && codeStringValue) { *result = MOD_AUTORELEASE([[MODScopeFunction alloc] initWithFunction:codeStringValue scope:scopeValue]); @@ -2087,7 +2164,7 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const } -#line 2091 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2168 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_object_id_actions[] = { 0, 1, 0, 1, 1 }; @@ -2144,7 +2221,7 @@ - (const char *)_parseScopeFunctionWithPointer:(const char *)p endPointer:(const static const int JSON_object_id_en_main = 1; -#line 695 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 712 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseObjectIdWithPointer:(const char *)p endPointer:(const char *)pe result:(MODObjectId **)result @@ -2153,14 +2230,14 @@ - (const char *)_parseObjectIdWithPointer:(const char *)p endPointer:(const char int cs = 0; -#line 2157 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2234 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_object_id_start; } -#line 703 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 720 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 2164 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2241 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -2235,7 +2312,7 @@ - (const char *)_parseObjectIdWithPointer:(const char *)p endPointer:(const char switch ( *_acts++ ) { case 0: -#line 686 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 703 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&idStringValue]; @@ -2243,10 +2320,10 @@ - (const char *)_parseObjectIdWithPointer:(const char *)p endPointer:(const char } break; case 1: -#line 692 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 709 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 2250 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2327 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -2259,7 +2336,7 @@ - (const char *)_parseObjectIdWithPointer:(const char *)p endPointer:(const char _out: {} } -#line 704 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 721 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_object_id_first_final && [MODObjectId isStringValid:idStringValue]) { *result = MOD_AUTORELEASE([[MODObjectId alloc] initWithString:idStringValue]); @@ -2309,7 +2386,7 @@ - (const char *)_parseRegexpWithPointer:(const char *)string endPointer:(const c } -#line 2313 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2390 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_numberlong_actions[] = { 0, 1, 0, 1, 1 }; @@ -2366,7 +2443,7 @@ - (const char *)_parseRegexpWithPointer:(const char *)string endPointer:(const c static const int JSON_numberlong_en_main = 1; -#line 772 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 789 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const char *)pe result:(NSNumber **)result @@ -2375,14 +2452,14 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch int cs = 0; -#line 2379 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2456 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_numberlong_start; } -#line 780 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 797 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 2386 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2463 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -2457,7 +2534,7 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch switch ( *_acts++ ) { case 0: -#line 758 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 775 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseIntegerWithPointer:p endPointer:pe result:&numberValue]; @@ -2469,10 +2546,10 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch } break; case 1: -#line 768 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 785 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 2476 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2553 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -2485,7 +2562,7 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch _out: {} } -#line 781 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 798 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_numberlong_first_final && numberValue) { *result = numberValue; @@ -2497,7 +2574,7 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch } -#line 2501 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2578 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_timestamp_actions[] = { 0, 1, 0, 1, 1, 1, 2 }; @@ -2558,7 +2635,7 @@ - (const char *)_parseNumberLongWithPointer:(const char *)p endPointer:(const ch static const int JSON_timestamp_en_main = 1; -#line 813 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 830 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const char *)pe result:(MODTimestamp **)result @@ -2568,14 +2645,14 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha int cs = 0; -#line 2572 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2649 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_timestamp_start; } -#line 822 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 839 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 2579 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2656 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -2650,7 +2727,7 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha switch ( *_acts++ ) { case 0: -#line 797 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 814 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseIntegerWithPointer:p endPointer:pe result:&timeNumber]; @@ -2659,7 +2736,7 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha } break; case 1: -#line 804 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 821 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseIntegerWithPointer:p endPointer:pe result:&incrementNumber]; @@ -2667,10 +2744,10 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha } break; case 2: -#line 810 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 827 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 2674 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2751 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -2683,7 +2760,7 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha _out: {} } -#line 823 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 840 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_timestamp_first_final && timeNumber && incrementNumber) { *result = MOD_AUTORELEASE([[MODTimestamp alloc] initWithTValue:timeNumber.intValue iValue:incrementNumber.intValue]); @@ -2695,7 +2772,7 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha } -#line 2699 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2776 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_symbol_actions[] = { 0, 1, 0, 1, 1 }; @@ -2750,7 +2827,7 @@ - (const char *)_parseTimestampWithPointer:(const char *)p endPointer:(const cha static const int JSON_symbol_en_main = 1; -#line 848 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 865 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseSymbolWithPointer:(const char *)p endPointer:(const char *)pe result:(MODSymbol **)result @@ -2759,14 +2836,14 @@ - (const char *)_parseSymbolWithPointer:(const char *)p endPointer:(const char * int cs = 0; -#line 2763 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2840 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_symbol_start; } -#line 856 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 873 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 2770 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2847 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -2841,7 +2918,7 @@ - (const char *)_parseSymbolWithPointer:(const char *)p endPointer:(const char * switch ( *_acts++ ) { case 0: -#line 839 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 856 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; np = [self _parseStringWithPointer:p endPointer:pe result:&symbol]; @@ -2849,10 +2926,10 @@ - (const char *)_parseSymbolWithPointer:(const char *)p endPointer:(const char * } break; case 1: -#line 845 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 862 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 2856 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 2933 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -2865,7 +2942,7 @@ - (const char *)_parseSymbolWithPointer:(const char *)p endPointer:(const char * _out: {} } -#line 857 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 874 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs >= JSON_symbol_first_final && symbol) { *result = MOD_AUTORELEASE([[MODSymbol alloc] initWithValue:symbol]); @@ -2971,27 +3048,27 @@ - (const char *)_parseStringWithPointer:(const char *)string endPointer:(const c } -#line 2975 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3052 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_array_actions[] = { 0, 1, 0, 1, 1 }; static const char _JSON_array_key_offsets[] = { - 0, 0, 1, 25, 31, 54 + 0, 0, 1, 24, 30, 52 }; static const char _JSON_array_trans_keys[] = { 91, 13, 32, 34, 39, 45, 66, 68, - 70, 73, 91, 93, 102, 110, 123, 9, - 10, 47, 57, 77, 79, 83, 84, 116, - 117, 13, 32, 44, 93, 9, 10, 13, - 32, 34, 39, 45, 66, 68, 70, 73, - 91, 102, 110, 123, 9, 10, 47, 57, - 77, 79, 83, 84, 116, 117, 0 + 70, 91, 93, 102, 110, 123, 9, 10, + 47, 57, 77, 79, 83, 84, 116, 117, + 13, 32, 44, 93, 9, 10, 13, 32, + 34, 39, 45, 66, 68, 70, 91, 102, + 110, 123, 9, 10, 47, 57, 77, 79, + 83, 84, 116, 117, 0 }; static const char _JSON_array_single_lengths[] = { - 0, 1, 14, 4, 13, 0 + 0, 1, 13, 4, 12, 0 }; static const char _JSON_array_range_lengths[] = { @@ -2999,17 +3076,16 @@ - (const char *)_parseStringWithPointer:(const char *)string endPointer:(const c }; static const char _JSON_array_index_offsets[] = { - 0, 0, 2, 22, 28, 47 + 0, 0, 2, 21, 27, 45 }; static const char _JSON_array_indicies[] = { 0, 1, 0, 0, 2, 2, 2, 2, - 2, 2, 2, 2, 3, 2, 2, 2, - 0, 2, 2, 2, 2, 1, 4, 4, - 5, 3, 4, 1, 5, 5, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 5, 2, 2, 2, 2, 1, 1, - 0 + 2, 2, 2, 3, 2, 2, 2, 0, + 2, 2, 2, 2, 1, 4, 4, 5, + 3, 4, 1, 5, 5, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 5, + 2, 2, 2, 2, 1, 1, 0 }; static const char _JSON_array_trans_targs[] = { @@ -3027,7 +3103,7 @@ - (const char *)_parseStringWithPointer:(const char *)string endPointer:(const c static const int JSON_array_en_main = 1; -#line 986 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1003 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *)pe result:(NSMutableArray **)result @@ -3040,14 +3116,14 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) *result = MOD_AUTORELEASE([[NSMutableArray alloc] init]); -#line 3044 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3120 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_array_start; } -#line 998 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1015 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" -#line 3051 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3127 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -3122,7 +3198,7 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) switch ( *_acts++ ) { case 0: -#line 967 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 984 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { id value; const char *np = [self _parseValueWithPointer:p endPointer:pe result:&value]; @@ -3135,10 +3211,10 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) } break; case 1: -#line 978 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 995 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { p--; {p++; goto _out; } } break; -#line 3142 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3218 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -3151,7 +3227,7 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) _out: {} } -#line 999 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1016 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if(cs >= JSON_array_first_final) { return p + 1; @@ -3162,7 +3238,7 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) } -#line 3166 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3242 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" static const char _JSON_actions[] = { 0, 1, 0, 1, 1 }; @@ -3205,7 +3281,7 @@ - (const char *)_parseArrayWithPointer:(const char *)p endPointer:(const char *) static const int JSON_en_main = 1; -#line 1033 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1050 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" - (id)parseJson:(NSString *)source withError:(NSError **)error @@ -3217,16 +3293,16 @@ - (id)parseJson:(NSString *)source withError:(NSError **)error self.error = nil; _cStringBuffer = [source UTF8String]; -#line 3221 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3297 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { cs = JSON_start; } -#line 1044 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1061 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" p = _cStringBuffer; pe = p + strlen(p); -#line 3230 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3306 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" { int _klen; unsigned int _trans; @@ -3300,7 +3376,7 @@ - (id)parseJson:(NSString *)source withError:(NSError **)error switch ( *_acts++ ) { case 0: -#line 1015 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1032 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; _currentNesting = 1; @@ -3309,7 +3385,7 @@ - (id)parseJson:(NSString *)source withError:(NSError **)error } break; case 1: -#line 1022 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1039 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" { const char *np; _currentNesting = 1; @@ -3317,7 +3393,7 @@ - (id)parseJson:(NSString *)source withError:(NSError **)error if (np == NULL) { p--; {p++; goto _out; } } else {p = (( np))-1;} } break; -#line 3321 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" +#line 3397 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.m" } } @@ -3330,7 +3406,7 @@ - (id)parseJson:(NSString *)source withError:(NSError **)error _out: {} } -#line 1047 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" +#line 1064 "/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Sources/MODRagelJsonParser.rl" if (cs < JSON_first_final || p != pe) { result = nil; diff --git a/Sources/MODRagelJsonParser.rl b/Sources/MODRagelJsonParser.rl index 1700b2c7..b4cf45b0 100644 --- a/Sources/MODRagelJsonParser.rl +++ b/Sources/MODRagelJsonParser.rl @@ -86,8 +86,11 @@ Vtrue = 'true'; VMinKey = 'MinKey'; VMaxKey = 'MaxKey'; + VNumberPosInfinity = 'Number.POSITIVE_INFINITY'; + VNumberNegInfinity = 'Number.NEGATIVE_INFINITY'; + VNumberNan = 'Number.NaN'; new_keyword = 'new'; - begin_value = [/unftTMFBOSD'\"\-\[\{NI] | digit; + begin_value = [/unftTMFBOSDN'\"\-\[\{] | digit; begin_object = '{'; end_object = '}'; begin_array = '['; @@ -98,7 +101,6 @@ begin_regexp = '/'; begin_object_id = 'O'; object_id_keyword = 'ObjectId'; - begin_numberlong = 'N'; numberlong_keyword = 'NumberLong'; begin_timestamp = 'T'; timestamp_keyword = 'Timestamp'; @@ -140,6 +142,18 @@ *result = MOD_AUTORELEASE([[MODUndefined alloc] init]); } + action parse_number_positive_infinity { + *result = [NSNumber numberWithDouble:INFINITY]; + } + + action parse_number_negative_infinity { + *result = [NSNumber numberWithDouble:-INFINITY]; + } + + action parse_number_nan { + *result = [NSNumber numberWithDouble:NAN]; + } + action parse_object_id { const char *np = [self _parseObjectIdWithPointer:fpc endPointer:pe result:result]; if (np == NULL) { fhold; fbreak; } else fexec np; @@ -181,7 +195,7 @@ } action parse_numberlong { - const char *np = [self _parseNumberLongWithPointer:fpc endPointer:pe result:result]; + const char *np = [self _parseNumberLongWithPointer:fpc - strlen("NumberLong") + 1 endPointer:pe result:result]; if (np == NULL) { fhold; fbreak; } else fexec np; } @@ -253,13 +267,16 @@ VMinKey @parse_min_key | VMaxKey @parse_max_key | Vundefined @parse_undefined | + VNumberPosInfinity @parse_number_positive_infinity | + VNumberNegInfinity @parse_number_negative_infinity | + VNumberNan @parse_number_nan | begin_object_id >parse_object_id | begin_number >parse_number | begin_string >parse_string | begin_array >parse_array | begin_object >parse_object | begin_regexp >parse_regexp | - begin_numberlong >parse_numberlong | + numberlong_keyword @parse_numberlong | begin_timestamp >parse_timestamp | begin_bindata >parse_bin_data | scopefunction_keyword @parse_scopefunction |