Updated the behavior of !=/== to only consider exact, full-text matches

instead of prefix matches
This commit is contained in:
Bruce Hill 2021-01-17 21:39:56 -08:00
parent 1110a0ce8b
commit 25346aa214
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;