From 7e1b3772cc049edd75a5a217582e30fcfcf823bf Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 10 Feb 2019 16:58:47 -0500 Subject: Remove pattend from hi --- bin/hi.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'bin/hi.c') diff --git a/bin/hi.c b/bin/hi.c index e72b2756..fd3dd0a3 100644 --- a/bin/hi.c +++ b/bin/hi.c @@ -61,7 +61,6 @@ struct Syntax { bool newline; size_t subexp; const char *pattern; - const char *pattend; }; #define WB "(^|[^_[:alnum:]]|\n)" @@ -230,9 +229,6 @@ static void highlight(struct Language lang, enum Class *hi, const char *str) { for (size_t i = 0; i < lang.len; ++i) { struct Syntax syn = lang.syntax[i]; regex_t regex = compile(syn.pattern, syn.newline ? 0 : REG_NEWLINE); - regex_t regend = {0}; - if (syn.pattend) regend = compile(syn.pattend, 0); - assert(syn.subexp < SubsLen); assert(syn.subexp <= regex.re_nsub); regmatch_t subs[SubsLen] = {{0}}; @@ -242,18 +238,6 @@ static void highlight(struct Language lang, enum Class *hi, const char *str) { ); if (error == REG_NOMATCH) break; if (error) errx(EX_SOFTWARE, "regexec: %d", error); - - if (lang.syntax[i].pattend) { - regmatch_t end; - error = regexec( - ®end, &str[offset + subs[syn.subexp].rm_eo], - 1, &end, REG_NOTBOL - ); - if (error == REG_NOMATCH) break; - if (error) errx(EX_SOFTWARE, "regexec: %d", error); - subs[syn.subexp].rm_eo += end.rm_eo; - } - regmatch_t sub = subs[syn.subexp]; if (syn.parent) { if (~syn.parent & SET(hi[offset + sub.rm_so])) continue; @@ -263,7 +247,6 @@ static void highlight(struct Language lang, enum Class *hi, const char *str) { } } regfree(®ex); - if (lang.syntax[i].pattend) regfree(®end); } } @@ -281,10 +264,6 @@ static void check(void) { ); } regfree(®ex); - if (syn.pattend) { - regex = compile(syn.pattend, REG_NOSUB); - regfree(®ex); - } } } } -- cgit 1.4.1 lass='path'>path: root/listen.c (unfollow)
Commit message (Expand)Author
2019-10-26Do not require RPL_ISUPPORT for stateReadyJune McEnroe
2019-10-26Implement graceful shutdownJune McEnroe
2019-10-26Require PASS before USERJune McEnroe
2019-10-26Track channel topicsJune McEnroe
2019-10-26Set AWAY when no clients are connectedJune McEnroe
2019-10-26Add flags to request TOPIC and NAMES on client connectJune McEnroe
2019-10-26OopsJune McEnroe
2019-10-26Disconnect client on unknown commandJune McEnroe
2019-10-26Allow reading sensitive information from filesJune McEnroe
2019-10-26Add rc scriptJune McEnroe
2019-10-25Add install and uninstall targetsJune McEnroe
2019-10-25Expand documentationJune McEnroe
2019-10-25Add AGPLv3 notice on client registrationJune McEnroe
2019-10-25Rename project pounceJune McEnroe