capture_to_close
function · lua · boundary
- Address
0x7fcdb0· 47 bytes, up to0x7fcdde- Meaning
- Returns the index of the innermost capture that is still open
- Confidence
- verified, proof one
- Finding
- lua/libs#pattern-matching
Finding: Pattern matching in lua: the libraries
match tries a pattern at a position and answers the end of the match or null. It dispatches
on the pattern character: ( and ) to start_capture and end_capture, %b to
matchbalance, %f to a frontier test, %1 to %9 to match_capture, $ at the end, and a
single-character class followed by *, +, - or ? to max_expand, min_expand or a trial of
the rest. A pattern holds at most 32 captures. check_capture validates a %n index and
capture_to_close finds the open capture a ) closes.
| function | name | decided by |
|---|---|---|
0x7fc570 | match | dispatch on the pattern character (0x7fc584), the %b and %f cases (0x7fc59e, 0x7fc5a6) |
0x7fcc50 | max_expand | luaI_singlematch loop (0x7fcc71), match on the rest (0x7fcc9a) |
0x7fccc0 | min_expand | match first (0x7fccd1), then luaI_singlematch (0x7fccef) and match again (0x7fccfe) |
0x7fcd20 | start_capture | limit 32 (0x7fcd2b), too many captures (0x7fcd35), match (0x7fcd5a) |
0x7fcd70 | end_capture | capture_to_close (0x7fcd7a), match (0x7fcd95) |
0x7fcdb0 | capture_to_close | scans for a length of -1 (0x7fcdc0), invalid pattern capture (0x7fcdd0) |
0x7fcde0 | match_capture | check_capture (0x7fcdec), length compare and byte compare |
0x7fce20 | check_capture | index n - 0x31 below the level (0x7fce2c), invalid capture index (0x7fce36) |
The derivation is in the doc.
Callers 1
- end_capture lua
Callees 1
- luaL_error lua
Calls and jumps by a bare address, from tables/calls.tsv.