Commit Graph

82 Commits

Author SHA1 Message Date
e6e482054d Deprecate '-p' flag and replace backslash interpolation with curly brace
interpolation
2023-11-25 14:57:19 -05:00
6f5bb02b92 Use tagged union style for extra safety and concision 2023-05-06 13:43:32 -04:00
9e07e08a48 Microoptimizations 2022-10-26 13:38:38 -04:00
23c64e386c Changed how tags work, changed Lua API for handling match captures 2022-05-14 22:43:13 -04:00
5fd2f6b8c5 Bugfix for (Foo: :X blah) parsing as (Foo:: X blah) 2022-05-14 16:04:07 -04:00
563ecf332e Allow optional colon for :Tag:foo 2022-05-14 15:21:05 -04:00
2988080c32 Added :tag 2022-05-14 15:18:54 -04:00
56da250d69 Split backref/named captures into separate concepts for performance
reasons.
2022-05-12 12:11:28 -04:00
52d022fc2f Fix for source code ranges of suffix patterns 2022-05-05 00:45:57 -04:00
af668004e8 Updated Make rules so default is bp 2022-05-02 17:25:18 -04:00
206e1fa68f Added tagged definitions: foo:: blah 2022-04-30 15:23:02 -04:00
24ed834317 Simplified things by passing a def argument to next_match instead of
chaining defs together. Also simplified `..` by just using a lookahead
instead of retconning it. Immutability invariants are now enforced
better.
2022-04-30 14:19:08 -04:00
8b88c1784e Later-chained defs take precedence over more recently chained defs 2022-04-27 19:12:28 -04:00
ef07c8a22e Made NULL end values default to strlen() 2022-04-21 12:54:09 -04:00
a61efe2cf0 Hardening utils (added *end param to avoid going past the end of
unterminated strings)
2021-09-28 16:59:01 -07:00
911827fac3 Removed definitions as a separate type and instead encode that value in
the patterns themselves. This simplifies memory management a lot and
speeds up performance.
2021-09-27 20:36:10 -07:00
77d9007a88 Refactor of pat_t memory management to use doubly linked lists, and
moving the recursive freeing code from Lua/lbp.c into pattern.c
2021-09-26 13:12:02 -07:00
ee0174001b Minor cleanups 2021-09-26 12:57:04 -07:00
0c5c4124a2 Bugfix 2021-09-24 22:54:54 -07:00
c81601729e Patterns no longer need files.h 2021-09-23 15:42:50 -07:00
ce915a5433 Patterns don't need to reference a separate start value anymore 2021-09-23 15:40:45 -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
89c5888dd6 Switched to using an optional type 2021-09-23 14:38:46 -07:00
e938ecbdcc Merge branch 'master' into setjmp 2021-09-23 13:42:46 -07:00
744a927562 Deprecated (!)-errors 2021-09-23 13:42:23 -07:00
cf99abb852 WIP implementation of setjmp/longjmp recovery 2021-09-23 13:38:20 -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
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
7e04f59554 Add support for {strings} 2021-08-23 12:43:18 -07:00
1eab8af155 Bugfix for postfix operators 2021-08-02 12:52:58 -07:00
d3c1526f71 Cleanup of space/line skipping code 2021-08-01 13:41:13 -07:00
994c9c973e Changed how definitions work 2021-08-01 12:40:27 -07:00
9c05f880b0 Added | as alias for \b 2021-07-30 20:23:18 -07:00
ba6ee18ded Added strict mode for upto operator: ..=Abc 2021-07-30 19:24:35 -07:00
3445982b16 Ergonomic improvement: xcalloc -> new(), xrealloc -> grow() 2021-07-30 14:44:00 -07:00
ca08ebfc45 Fix for bug in char pattern start pos 2021-07-29 12:52:32 -07:00
bc813df3d7 Tweaks and optimizations 2021-07-29 12:45:37 -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
8c351922f4 Error reporting bugfix 2021-07-19 20:00:35 -07:00
cc84c3d791 Made escape sequence handling stricter: no longer supporting arbitrary
characters, only special escapes like \n, hex sequences like \x0a, octal
sequences like \012, and backslashes \\
2021-07-19 19:57:59 -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
ad85fb1da5 Added support for multiple escape sequences: \n,r,t 2021-07-17 14:19:55 -07:00
315aedc7cb Minor splint fixes 2021-05-22 22:02:22 -07:00
9c8baf4434 Fixes for replacements with or without patterns/replacement strings 2021-05-22 13:23:10 -07:00
cc6e25a06f Fix for broken escapes 2021-05-20 18:30:30 -07:00
78695e2aee Fixed backslash escape for single utf8 chars. 2021-05-20 17:39:27 -07:00
ec1a3e0835 Fixes for char sets/ranges and cleanups 2021-05-20 16:46:14 -07:00