We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f6e288 commit 562dcbdCopy full SHA for 562dcbd
parse.c
@@ -234,7 +234,17 @@ struct Token token_get(char *code, char **next) {
234
// Number
235
token.type = TOK_NUMBER;
236
token.data = code;
237
+
238
+ // Include the fractional part if present
239
+ if (code[length] == '.') length += scan_string(code + length + 1, char_is_num) + 1;
240
241
token.data_len = length;
242
243
+ // Parse the number
244
+ char boundary_char = code[length];
245
+ code[length] = '\0';
246
+ token.number = strtod(code, NULL);
247
+ code[length] = boundary_char;
248
} else if (chrcmp(*code, CHRSET_QUOTE, sizeof CHRSET_QUOTE)) {
249
// String
250
token.type = TOK_STRING;
0 commit comments