-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add _SAVE
& _SAVE_AS
for unnamed/named captures
#4
Comments
_CAPTURE
operator (both named and nameless)_SAVE
& _SAVE_AS
for unnamed/named captures
Just FTR:
|
xparq
added a commit
that referenced
this issue
Sep 5, 2023
Test: build-msvc test/OP_SAVE.cpp & OP_SAVE build-gcc test/OP_SAVE.cpp & a.exe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Requires #2)
Again, just like that of proper regexes... (Nameless ones just collecting into a
vector
, named ones into amap
. UPDATE: Well, not that simple, though, see task 2...)This could be a fundamental building block of subsequent parsing features.
Note: it should be used "wisely", i.e. to not nest capture ops carelessly. I mean it's fine, but probably makes little sense. E.g. I could detect it and issue a warning I guess...
this
as the key loses the "proper monotonic ordering for pseudo-indexing by enumeration" property!operator[](size_t index)
) for unnamed results (viaParser
)Rather than fiddling with auto-assigning contiguous indexes to multiple matching unnamed
_SAVE
rules, and having distinct (disjunct) capture-results collections for the two modes, just using the stringifiedthis
pointer for the unnamed ones seems better, with a thin iterator wrapper for enumerating them. They can even go into the very same results map, perhaps!["name"]
getters, and it can at least be a little simpler with numeric indexes and keeping the map ordered, and not having to slalom around the explicit name keys either.The text was updated successfully, but these errors were encountered: