Skip to content

Commit e154e5c

Browse files
committed
Merge pull request #1373 from drewwells/feature/jsonpreprocessor
move methods from directives to functions
2 parents 7ed376f + b0f37d0 commit e154e5c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/json.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,8 @@ static void to_surrogate_pair(uint32_t unicode, uint16_t *uc, uint16_t *lc)
357357
*lc = (n & 0x3FF) | 0xDC00;
358358
}
359359

360-
#define is_space(c) ((c) == '\t' || (c) == '\n' || (c) == '\r' || (c) == ' ')
361-
#define is_digit(c) ((c) >= '0' && (c) <= '9')
362-
360+
bool is_space (const char *c);
361+
bool is_digit (const char *c);
363362
static bool parse_value (const char **sp, JsonNode **out);
364363
static bool parse_string (const char **sp, char **out);
365364
static bool parse_number (const char **sp, double *out);
@@ -937,6 +936,14 @@ bool parse_string(const char **sp, char **out)
937936
return false;
938937
}
939938

939+
bool is_space(const char& c) {
940+
return ((c) == '\t' || (c) == '\n' || (c) == '\r' || (c) == ' ');
941+
}
942+
943+
bool is_digit(const char& c){
944+
return ((c) >= '0' && (c) <= '9');
945+
}
946+
940947
/*
941948
* The JSON spec says that a number shall follow this precise pattern
942949
* (spaces and quotes added for readability):

0 commit comments

Comments
 (0)