match_class
function · lua · boundary
- Address
0x7fc930· 529 bytes, up to0x7fcb40- Meaning
- Tests a character against a % class letter, negated by a capital
- Confidence
- verified, proof one
- Finding
- lua/libs#pattern-classes
Finding: Pattern classes in lua: the libraries
The pattern matcher's character tests. luaI_classend finds the end of a single-character
class in a pattern, raising on a trailing % or a missing ]. luaI_singlematch tests one
character against a class: . matches any, %x goes to match_class, [...] to
matchbracketclass, anything else is compared. match_class handles a c d l p s u w x z and their
capital negations by C runtime tests, matchbracketclass ranges and negation, and matchbalance
the %b pair.
| function | name | decided by |
|---|---|---|
0x7fc820 | luaI_classend | % at 0x7fc827, [ at 0x7fc82f, the errors malformed pattern (ends with `%') (0x7fc87d) and (missing `]') (0x7fc84e) |
0x7fc890 | matchbracketclass | leading ^ (0x7fc898), % calls match_class (0x7fc8ce), range - (0x7fc8dc) |
0x7fc930 | match_class | switch on the lowered letter, _pctype masks 0x103, 0x20, 0x4, 0x2, 0x10, 0x8, 0x1, 0x107, 0x80; z tests 0 |
0x7fcb90 | luaI_singlematch | % (0x7fcb95) to match_class (0x7fcbca), . (0x7fcb99), [ (0x7fcb9d) to matchbracketclass (0x7fcbb4) |
0x7fcbe0 | matchbalance | unbalanced pattern (0x7fcbfc) when the pattern lacks two characters, nesting count |
The derivation is in the doc.
Callers 2
- matchbracketclass lua
- luaI_singlematch lua
Callees 2
Calls and jumps by a bare address, from tables/calls.tsv.