readme: add neatvi ref, pike: misc style fixes

This commit is contained in:
Kyryl Melekhin
2021-08-14 13:43:32 +00:00
parent 81f0ff252d
commit 158a03c4be
2 changed files with 16 additions and 13 deletions

3
README
View File

@@ -43,6 +43,9 @@ or class is a space we want to match not assert at. But the code for it was too
dirty and I scrapped it. Syntax for word assertions are like posix C library, not dirty and I scrapped it. Syntax for word assertions are like posix C library, not
the pcre "\b" which can be used both in front or back of the word, because there is the pcre "\b" which can be used both in front or back of the word, because there is
no distinction, it makes the implementation potentially even uglier. no distinction, it makes the implementation potentially even uglier.
* Assert flags like REG_ICASE,REG_NOTEOL,REG_NOTBOL and lookahead inside
negated bracket are implemented here (also shows use case in real world project):
https://github.com/kyx0r/neatvi/blob/pikevm/regex.c
NOTES NOTES
===== =====

2
pike.c
View File

@@ -490,10 +490,10 @@ goto next##nn; \
fastrec(nn, list, listidx) \ fastrec(nn, list, listidx) \
case SAVE: \ case SAVE: \
if (sub->ref > 1) { \ if (sub->ref > 1) { \
sub->ref--; \
newsub() \ newsub() \
for (j = 0; j < nsubp; j++) \ for (j = 0; j < nsubp; j++) \
s1->sub[j] = sub->sub[j]; \ s1->sub[j] = sub->sub[j]; \
sub->ref--; \
sub = s1; \ sub = s1; \
sub->ref = 1; \ sub->ref = 1; \
} \ } \