From d7455c8d8e95d43d76ba95d43f9e36fc119ca83f Mon Sep 17 00:00:00 2001 From: June 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') diff --git a/bin/hi.c b/bin/hi.c index c3644d30..7c791909 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 submit' value='search'/>
path: root/home/.config/git (unfollow)
Commit message (Collapse)Author
2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe
2021-01-12Remove hacky tagging from hilexJune McEnroe
God that makes the lexers so much simpler.
2021-01-12Add htagml -iJune McEnroe
2021-01-12Render tag index in HTMLJune McEnroe
2021-01-12Add htagml -xJune McEnroe
2021-01-12Prevent matching the same tag twiceJune McEnroe
2021-01-12Process htagml file line by lineJune McEnroe
This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future.
2021-01-12Split fields by tab onlyJune McEnroe
Also don't fail hard on non-forward-search definitions.
2021-01-12List both Makefile and html.sh under README.7June McEnroe
2021-01-12Add htagml exampleJune McEnroe
2021-01-12Use mandoc and htagml for bin htmlJune McEnroe
2021-01-12Add htagmlJune McEnroe
2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe
2021-01-11Publish "Using vi"June McEnroe
2021-01-11Enable diff.colorMovedJune McEnroe
2021-01-10Set less search case-insensitiveJune McEnroe
2021-01-10Set EXINITJune McEnroe
neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated.
2021-01-09Add c -t flag to print expression typeJune McEnroe
Also add missing float case.
2021-01-05Update taglineJune McEnroe