Update lexer to allow ' in numbers
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Successful in 14s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Successful in 14s
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Failing after 13s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Failing after 18s
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Failing after 16s
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Failing after 15s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-01 03:18:14 +03:00
parent 1a2b697349
commit 2ec675a320
2 changed files with 7 additions and 7 deletions

View File

@@ -8,6 +8,6 @@ fn lib = {
partitions = { partitions = {
automount = [ 'boot' 'root' ] automount = [ 'boot' 'root' ]
swap.enable = true swap.enable = true
swap.size = 2g swap.size = 2_000_000_000
} }
} }

View File

@@ -76,7 +76,7 @@ int64_t dcfg_strtoll(const char *s, char **end, int base)
size_t w = 0; size_t w = 0;
for (size_t r = 0; r < n && s[r]; ++r) for (size_t r = 0; r < n && s[r]; ++r)
if (s[r] != '_') if (s[r] != '_' && s[r] != '\'')
clean[w++] = s[r]; clean[w++] = s[r];
clean[w] = '\0'; clean[w] = '\0';
@@ -87,7 +87,7 @@ int64_t dcfg_strtoll(const char *s, char **end, int base)
size_t consumed = (size_t)(tmp_end - clean); size_t consumed = (size_t)(tmp_end - clean);
size_t i = 0, c = 0; size_t i = 0, c = 0;
while (i < n && c < consumed) { while (i < n && c < consumed) {
if (s[i] != '_') if (s[i] != '_' && s[i] != '\'')
++c; ++c;
++i; ++i;
} }
@@ -110,7 +110,7 @@ double dcfg_strtod(char const *s, char **end)
size_t w = 0; size_t w = 0;
for (size_t r = 0; r < n && s[r]; ++r) for (size_t r = 0; r < n && s[r]; ++r)
if (s[r] != '_') if (s[r] != '_' && s[r] != '\'')
clean[w++] = s[r]; clean[w++] = s[r];
clean[w] = '\0'; clean[w] = '\0';
@@ -121,7 +121,7 @@ double dcfg_strtod(char const *s, char **end)
size_t consumed = (size_t)(tmp_end - clean); size_t consumed = (size_t)(tmp_end - clean);
size_t i = 0, c = 0; size_t i = 0, c = 0;
while (i < n && c < consumed) { while (i < n && c < consumed) {
if (s[i] != '_') if (s[i] != '_' && s[i] != '\'')
++c; ++c;
++i; ++i;
} }
@@ -573,12 +573,12 @@ static Token lex_number(Lexer *lx)
int start = lx->offset; int start = lx->offset;
bool real = false; bool real = false;
while (isdigit_cp(lx->ch) || lx->ch == '_') while (isdigit_cp(lx->ch) || lx->ch == '_' || lx->ch == '\'')
lex_advance(lx); lex_advance(lx);
if (lx->ch == '.') { if (lx->ch == '.') {
real = true; real = true;
lex_advance(lx); lex_advance(lx);
while (isdigit_cp(lx->ch) || lx->ch == '_') while (isdigit_cp(lx->ch) || lx->ch == '_' || lx->ch == '\'')
lex_advance(lx); lex_advance(lx);
} }
return make_token( return make_token(