Fix variable names with digits, ERL, update docs

- Tokenizer now copies entire identifier (letters+digits) when no
  keyword matches, fixing variables like K2, V1, AB3%
- ERL returns actual error line number instead of 0
- Update README and Sphinx docs for v0.5.0
This commit is contained in:
Eremey Valetov
2026-02-10 17:01:50 -05:00
parent 1f4c460f4f
commit 9ca23e5d10
4 changed files with 42 additions and 15 deletions
+1 -1
View File
@@ -833,7 +833,7 @@ static gw_value_t eval_atom(void)
gw_chrget();
gw_value_t v;
v.type = VT_INT;
v.ival = 0;
v.ival = gw.err_line_num;
return v;
}
if (tok == TOK_ERR) {
+11
View File
@@ -137,6 +137,17 @@ int gw_crunch(const char *text, uint8_t *out, int outsize)
in_data = 1;
continue;
}
/* Not a keyword: copy entire variable name (letters + digits) */
while (isalnum((unsigned char)text[ip]) || text[ip] == '.') {
out[op++] = text[ip++];
if (op >= outsize - 2) break;
}
/* Copy type suffix if present */
if (text[ip] == '%' || text[ip] == '!' ||
text[ip] == '#' || text[ip] == '$')
out[op++] = text[ip++];
continue;
}
/* &H hex, &O octal, & octal */