From: anon Date: Mon, 18 Sep 2023 19:38:37 +0000 (+0200) Subject: Merge branch 'master' of https://git.lain.church/emil/hl X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=5f2e4a612f61cd7acb52b2eeb4b6dff886f7feca;p=public-libhl.git Merge branch 'master' of https://git.lain.church/emil/hl --- 5f2e4a612f61cd7acb52b2eeb4b6dff886f7feca diff --cc include/hl.h index 00ed239,ce64a4b..dbad3b2 --- a/include/hl.h +++ b/include/hl.h @@@ -75,16 -82,20 +82,20 @@@ extern token_t * new_token(const cha const token_type_t t, hl_group_t * const g); + extern token_t * new_region_token(const char * start, + const char * end, + hl_group_t * g); + // TODO: ALIGN PROPERLY... -extern int token_fits(const token_t * const token, - const char * const to, - const int string_offset, +extern int token_fits(const token_t * const token, + const char * const to, + const int string_offset, const bool is_start_of_line, - int * match_offset); + int * match_offset); extern void render_string(const char * const string, - const char * const mode); + const char * const mode); extern int hl_init(void); extern int hl_deinit(void); diff --cc source/regex.c index 23db44d,c9dbc63..de553b2 --- a/source/regex.c +++ b/source/regex.c @@@ -561,9 -530,7 +561,10 @@@ regex_t * regex_compile(const char * co filter_blacklist(whitelist, blacklist, filtered_blacklist); HOOK_ALL(0, filtered_blacklist, HALT_AND_CATCH_FIRE, &cs); } + + long_continue: + cs.is_at_the_beginning = false; + long_continue:; } regex->accepting_state = state;