summaryrefslogtreecommitdiff
path: root/regcharclass.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2012-10-03 19:05:03 +0200
committerKarl Williamson <public@khwilliamson.com>2012-10-03 17:58:49 -0600
commit9a3182e96982be7c86914c175a01f6ad478f76d2 (patch)
treefaacfce47f8b98231357bee428e08d65821f7f57 /regcharclass.h
parente405c23abd5bcb33c232ddf79ea3821ce1596bf7 (diff)
downloadperl-9a3182e96982be7c86914c175a01f6ad478f76d2.tar.gz
regen/regcharclass.pl: improved optree generation
Karl Williamson noticed that we dont always deal with common suffixes in the most efficient way. This change reworks how we convert a trie to an optree so that common suffixes are always grouped together.
Diffstat (limited to 'regcharclass.h')
-rw-r--r--regcharclass.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/regcharclass.h b/regcharclass.h
index 4326bb5064..a34b339e56 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -87,18 +87,18 @@
/*** GENERATED CODE ***/
#define is_LNBREAK_latin1(s) \
-( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
+( ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) || 0x85 == ((U8*)s)[0] ) ? 1\
: ( 0x0D == ((U8*)s)[0] ) ? \
( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
-: ( 0x85 == ((U8*)s)[0] ) )
+: 0 )
/*** GENERATED CODE ***/
#define is_LNBREAK_latin1_safe(s,e) \
( ((e)-(s) > 1) ? \
- ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
+ ( ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) || 0x85 == ((U8*)s)[0] ) ? 1\
: ( 0x0D == ((U8*)s)[0] ) ? \
( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
- : ( 0x85 == ((U8*)s)[0] ) ) \
+ : 0 ) \
: ((e)-(s) > 0) ? \
( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) || 0x85 == ((U8*)s)[0] )\
: 0 )
@@ -460,19 +460,13 @@
( ( ( 0x81 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x93 ) || ( 0x95 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xAF ) ) ? 3 : 0 )\
: ( 0x86 == ((U8*)s)[1] ) ? \
( ( ((U8*)s)[2] >= 0x90 ) ? 3 : 0 ) \
- : ( 0x87 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x90 ) ? \
+ : ( ( 0x87 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x90 ) || ( 0x94 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x9C ) || ( 0x9F <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xAF ) || ( ((U8*)s)[1] & 0xFE ) == 0xB8 ) ?\
3 \
: ( 0x91 == ((U8*)s)[1] ) ? \
( ( ((U8*)s)[2] <= 0x9F ) ? 3 : 0 ) \
- : ( 0x94 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x9C ) ? \
- 3 \
: ( 0x9D == ((U8*)s)[1] ) ? \
( ( ((U8*)s)[2] <= 0xB5 ) ? 3 : 0 ) \
- : ( 0x9E == ((U8*)s)[1] ) ? \
- ( ( ((U8*)s)[2] >= 0x94 ) ? 3 : 0 ) \
- : ( ( 0x9F <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xAF ) || ( ((U8*)s)[1] & 0xFE ) == 0xB8 ) ?\
- 3 \
- : 0 ) \
+ : ( ( 0x9E == ((U8*)s)[1] ) && ( ((U8*)s)[2] >= 0x94 ) ) ? 3 : 0 ) \
: ( 0xE3 == ((U8*)s)[0] ) ? \
( ( 0x80 == ((U8*)s)[1] ) ? \
( ( ( ((U8*)s)[2] <= 0x83 ) || ( 0x88 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA0 ) || 0xB0 == ((U8*)s)[2] ) ? 3 : 0 )\