log_warn((scanner)->ctx, "rules/%s:%d:%d: " fmt "\n", \
(scanner)->file_name, (loc)->line, (loc)->column, __VA_ARGS__)
+static inline bool
+is_ident(char ch)
+{
+ return is_graph(ch) && ch != '\\';
+}
+
static enum rules_token
lex(struct scanner *s, union lvalue *val, struct location *loc)
{
if (chr(s, '$')) {
val->string.start = s->s + s->pos;
val->string.len = 0;
- while (is_graph(peek(s))) {
+ while (is_ident(peek(s))) {
next(s);
val->string.len++;
}
}
/* Identifier. */
- if (is_graph(peek(s))) {
+ if (is_ident(peek(s))) {
val->string.start = s->s + s->pos;
val->string.len = 0;
- while (is_graph(peek(s))) {
+ while (is_ident(peek(s))) {
next(s);
val->string.len++;
}