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:
+1
-1
@@ -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) {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user