diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-17 14:08:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-17 14:08:22 -0300 |
commit | 24bf757183d8bd97f6f5b43d916814f3269c8347 (patch) | |
tree | 646cd65d6e2dab57691f98f83f15f25c70685ef8 /lptree.h | |
parent | 3f7797419e4d7493e1364290a5b127d1cb45e3bf (diff) | |
download | lpeg-24bf757183d8bd97f6f5b43d916814f3269c8347.tar.gz lpeg-24bf757183d8bd97f6f5b43d916814f3269c8347.tar.bz2 lpeg-24bf757183d8bd97f6f5b43d916814f3269c8347.zip |
Implementation of UTF-8 ranges
New constructor 'lpeg.utfR(from, to)' creates a pattern that matches
UTF-8 byte sequences representing code points in the range [from, to].
Diffstat (limited to 'lptree.h')
-rw-r--r-- | lptree.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -18,6 +18,9 @@ typedef enum TTag { | |||
18 | TAny, | 18 | TAny, |
19 | TTrue, | 19 | TTrue, |
20 | TFalse, | 20 | TFalse, |
21 | TUTFR, /* range of UTF-8 codepoints; 'n' has initial codepoint; | ||
22 | 'cap' has length; 'key' has first byte; | ||
23 | extra info is similar for end codepoint */ | ||
21 | TRep, /* 'sib1'* */ | 24 | TRep, /* 'sib1'* */ |
22 | TSeq, /* 'sib1' 'sib2' */ | 25 | TSeq, /* 'sib1' 'sib2' */ |
23 | TChoice, /* 'sib1' / 'sib2' */ | 26 | TChoice, /* 'sib1' / 'sib2' */ |
@@ -26,8 +29,9 @@ typedef enum TTag { | |||
26 | TCall, /* ktable[key] is rule's key; 'sib2' is rule being called */ | 29 | TCall, /* ktable[key] is rule's key; 'sib2' is rule being called */ |
27 | TOpenCall, /* ktable[key] is rule's key */ | 30 | TOpenCall, /* ktable[key] is rule's key */ |
28 | TRule, /* ktable[key] is rule's key (but key == 0 for unused rules); | 31 | TRule, /* ktable[key] is rule's key (but key == 0 for unused rules); |
29 | 'sib1' is rule's pattern pre-rule; 'sib2' is next rule; */ | 32 | 'sib1' is rule's pattern pre-rule; 'sib2' is next rule; |
30 | TXInfo, /* extra info; 'n' is rule's sequential number */ | 33 | extra info 'n' is rule's sequential number */ |
34 | TXInfo, /* extra info */ | ||
31 | TGrammar, /* 'sib1' is initial (and first) rule */ | 35 | TGrammar, /* 'sib1' is initial (and first) rule */ |
32 | TBehind, /* 'sib1' is pattern, 'n' is how much to go back */ | 36 | TBehind, /* 'sib1' is pattern, 'n' is how much to go back */ |
33 | TCapture, /* captures: 'cap' is kind of capture (enum 'CapKind'); | 37 | TCapture, /* captures: 'cap' is kind of capture (enum 'CapKind'); |