Commit Graph

67 Commits

Author SHA1 Message Date
04eb92153f WIP 2021-09-23 17:31:21 -07:00
fac3fd9772 Moving pattern lifetime tracking off of files and onto its own list of
allocated pats.
2021-09-23 15:24:08 -07:00
8e1e6572fe Moved type defs into their own files instead of types.h 2021-09-23 15:15:48 -07:00
d20afd10b6 API update: made new_pat() internal and added public bp_backref() to
cover that use case
2021-09-23 14:55:30 -07:00
744a927562 Deprecated (!)-errors 2021-09-23 13:42:23 -07:00
97b7befdc8 Moved capture retrieval logic into match.c and out of print.c 2021-09-22 20:44:01 -07:00
90c3c13a02 Moving cache logic into match, cleaner next_match() API, and slightly
less tightly coupled UTF8 API
2021-09-21 18:45:43 -07:00
ae7f21b531 Moved capture retrieval logic into print.c 2021-09-19 17:48:00 -07:00
3c51755050 Fixing memory leak 2021-09-04 14:02:43 -07:00
f8860c385e Style change: added cino=:0 (i.e. case statements on same indentation as
switch). Also fixed issue where $$ would fail to match with trailing
newline on file
2021-08-28 16:05:30 -07:00
d7e18968bb Bugfix for | not working at start of file 2021-08-25 13:13:47 -07:00
3d0c07a0b8 Fix memory leak 2021-08-02 12:55:14 -07:00
80a087e454 Minor cleanup 2021-08-01 19:01:19 -07:00
0b2de4721f Moved caching code onto the file, which fixed an issue with file slicing
having stale cache values.
2021-08-01 15:36:53 -07:00
994c9c973e Changed how definitions work 2021-08-01 12:40:27 -07:00
ba6ee18ded Added strict mode for upto operator: ..=Abc 2021-07-30 19:24:35 -07:00
18e8a131f5 xfree() -> delete() 2021-07-30 15:06:04 -07:00
3445982b16 Ergonomic improvement: xcalloc -> new(), xrealloc -> grow() 2021-07-30 14:44:00 -07:00
ad640caac6 Removing DEBUG_HEAP, just do a full cleanup all the time 2021-07-30 13:38:39 -07:00
f3954ac151 Linked list management cleanup 2021-07-30 13:36:29 -07:00
253bb1dbe1 Temporary fix for memory bug 2021-07-29 13:59:50 -07:00
bc813df3d7 Tweaks and optimizations 2021-07-29 12:45:37 -07:00
db969f34a9 Micro optimization (probably not necessary) 2021-07-27 00:16:15 -07:00
a5a456fab3 Caching micro-optimizations 2021-07-27 00:09:04 -07:00
f86f75d782 More caching performance tuning 2021-07-26 23:56:04 -07:00
afc07fb735 Performance improvements for caching 2021-07-26 23:29:51 -07:00
f23b9bc637 Introduced cache to greatly speed up many use cases 2021-07-26 20:59:45 -07:00
711fe47a7f Overhaul of word boundaries/edges. Now they use \b, which is implemented
in C, and the C code understands UTF8 id chars.
2021-07-19 19:40:43 -07:00
62e7d654bd Disable optimization when skip is non-null 2021-07-19 13:33:51 -07:00
debd5d886c Simplification 2021-07-17 16:47:05 -07:00
9f2d9d86de Improved optimization for finding next match 2021-07-17 16:01:18 -07:00
f2e47bb95f Bugfix for backrefs 2021-07-17 15:31:18 -07:00
85f6cb8e76 Performance optimization for common case where pattern starts with
string
2021-07-17 15:25:24 -07:00
378e94090f Factored debug visualization into its own file 2021-07-17 14:05:10 -07:00
0f05961578 Simplified backrefs by only doing direct substring matching instead of
accounting for replacement strings.
2021-07-17 13:54:26 -07:00
a67a257044 Fix compiler warning nits 2021-05-31 12:56:49 -07:00
da6c8857d6 Moved utf8 code into a C file, fixed some potential null deref issues 2021-05-31 12:38:42 -07:00
0443fbb063 Added warning flag for null derefs 2021-05-31 10:32:48 -07:00
9c8baf4434 Fixes for replacements with or without patterns/replacement strings 2021-05-22 13:23:10 -07:00
219f62ed3f Renamed file_t.contents -> file_t.start, added file_t.memory for
canonical tracking of memory for mmap, simplified json printing,
and added support for initiating searches on a specific line (and/or
column).
2021-05-20 18:31:28 -07:00
be198489e0 Cleanup, perf fixes, and setting an endpoint for backtrack matches (at
the current position).
2021-05-20 16:59:42 -07:00
8e712a83d4 Bugfixes 2021-05-20 16:21:33 -07:00
655ed12128 Mostly working version 2021-05-20 15:27:24 -07:00
d9f0a92839 Added (!) syntax for errors with proper opcode support 2021-05-20 00:33:11 -07:00
355e06a58e Added ~ and !~ operators as replacements for == and != 2021-05-19 23:41:57 -07:00
a93220972f Overhaul of |-word boundaries (| is deprecated), performance
improvements for repeating matches, tweaks to the logic of word vs. id
2021-05-11 12:38:58 -07:00
3359a804c8 Converted ^/^^/$/$$ into pattern types instead of builtin definitions 2021-05-11 11:39:42 -07:00
f1499c9a63 Fix for being unable to match patterns on zero-length files (or at the
end of a file)
2021-03-15 18:29:04 -07:00
889fd70ec7 Cleaned up some error code 2021-01-26 17:58:46 -08:00
de0fec8fcb Removed check() and replaced with err()/errx() 2021-01-26 17:54:23 -08:00