ww: hare-feature batch (_, const, [_]T, ..., size/offset, assert, for-else)
This commit is contained in:
@@ -317,6 +317,11 @@ lexident(Lex *l, Pos start)
|
||||
lget(l);
|
||||
u64 n = l->pos - begin;
|
||||
const char *p = l->src + begin;
|
||||
/* bare '_' is the discard marker. `_x`, `_1` are normal idents. */
|
||||
if (n == 1 && p[0] == '_') {
|
||||
Tok t = (Tok){ TK_UNDER, start, astrndup(l->a, p, n), n, {0}, TK_NONE };
|
||||
return t;
|
||||
}
|
||||
Tkind k = kwlookup(p, n);
|
||||
Tok t = (Tok){ k != TK_NONE ? k : TK_IDENT, start,
|
||||
astrndup(l->a, p, n), n, {0}, TK_NONE };
|
||||
|
||||
Reference in New Issue
Block a user