Browse Source

fix fractions in weird bases

master
Martin Dørum 3 years ago
parent
commit
6f1bd65f67
1 changed files with 1 additions and 7 deletions
  1. 1
    7
      lib/parse/lex.c

+ 1
- 7
lib/parse/lex.c View File



read_ch(lexer); // '.' read_ch(lexer); // '.'


if (!is_numeric(peek_ch(lexer))) {
tok->kind = L2_TOK_ERROR;
tok->v.str = "Trailing dot in number literal";
return;
}

unsigned char buffer[32]; unsigned char buffer[32];
size_t fraction_len = 0; size_t fraction_len = 0;
while (fraction_len < sizeof(buffer)) { while (fraction_len < sizeof(buffer)) {


if (fraction_len < 1) { if (fraction_len < 1) {
tok->kind = L2_TOK_ERROR; tok->kind = L2_TOK_ERROR;
tok->v.str = "Fraction with no digits";
tok->v.str = "Trailing dot in number literal";
return; return;
} }



Loading…
Cancel
Save