Updated the behavior of !=/== to only consider exact, full-text matches
instead of prefix matches
This commit is contained in:
parent
1110a0ce8b
commit
25346aa214
@ -40,7 +40,7 @@ brackets: `[..`] % (\n/brackets/string)
|
||||
braces: `{..`} % (\n/braces/string)
|
||||
parens: `(..`) % (\n/parens/string)
|
||||
string: `"..`" % (`\.) / `'..`' % (`\.)
|
||||
id: !<`a-z,A-Z,_,0-9 (`a-z,A-Z,_ *`a-z,A-Z,_,0-9)!=(keyword$)
|
||||
id: !<`a-z,A-Z,_,0-9 (`a-z,A-Z,_ *`a-z,A-Z,_,0-9)!=keyword
|
||||
id-char: `a-z,A-Z,_,0-9
|
||||
var: id
|
||||
keyword: !"" # No keywords defined by default
|
||||
|
2
match.c
2
match.c
@ -379,7 +379,7 @@ match_t *match(def_t *defs, file_t *f, const char *str, pat_t *pat, unsigned int
|
||||
.mmapped=f->mmapped,
|
||||
};
|
||||
match_t *m2 = match(defs, &inner, str, pat->args.multiple.second, ignorecase);
|
||||
if ((m2 == NULL) == (pat->type == BP_EQUAL)) {
|
||||
if ((m2 == NULL || m2->end != m1->end) == (pat->type == BP_EQUAL)) {
|
||||
recycle_if_unused(&m1);
|
||||
if (m2 != NULL) recycle_if_unused(&m2);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user