summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-06-16 11:59:24 -0600
committerKarl Williamson <khw@cpan.org>2016-06-21 18:10:38 -0600
commitb0e24409fd3623db353286c203d33b56e622bae6 (patch)
treebfba4fb7ba71ee2c200933eb6ac850448345e30d /embed.h
parent6295dc14882a54531ce4542f1d80fa8ae7b4f8f0 (diff)
downloadperl-b0e24409fd3623db353286c203d33b56e622bae6.tar.gz
Prepare for Unicode 9.0
The major code changes needed to support Unicode 9.0 are to changes in the boundary (break) rules, for things like \b{lb}, \b{wb}. regen/mk_invlists.pl creates two-dimensional arrays for all these properties. To see if a given point in the target string is a break or not, regexec.c looks up the entry in the property's table whose row corresponds to the code point before the potential break, and whose column corresponds to the one after. Mostly this is completely determining, but for some cases, extra context is required, and the array entry indicates this, and there has to be specially crafted code in regexec.c to handle each such possibility. When a new release comes along, mk_invlists.pl has to be changed to handle any new or changed rules, and regexec.c has to be changed to handle any changes to the custom code. Unfortunately this is not a mature area of the Standard, and changes are fairly common in new releases. In part, this is because new types of code points come along, which need new rules. Sometimes it is because they realized the previous version didn't work as well as it could. An example of the latter is that Unicode now realizes that Regional Indicator (RI) characters come in pairs, and that one should be able to break between each pair, but not within a pair. Previous versions treated any run of them as unbreakable. (Regional Indicators are a fairly recent type that was added to the Standard in 6.0, and things are still getting shaken out.) The other main changes to these rules also involve a fairly new type of character, emojis. We can expect further changes to these in the next Unicode releases. \b{gcb} for the first time, now depends on context (in rarely encountered cases, like RI's), so the function had to be changed from a simple table look-up to be more like the functions handling the other break properties. Some years ago I revamped mktables in part to try to make it require as few manual interventions as possible when upgrading to a new version of Unicode. For example, a new data file in a release requires telling mktables about it, but as long as it follows the format of existing recent files, nothing else need be done to get whatever properties it describes to be included. Some of changes to mktables involved guessing, from existing limited data, what the underlying paradigm for that data was. The problem with that is there may not have been a paradigm, just something they did ad hoc, which can change at will; or I didn't understand their unstated thinking, and guessed wrong. Besides the boundary rule changes, the only change that the existing mktables couldn't cope with was the addition of the Tangut script, whose character names include the code point, like CJK UNIFIED IDEOGRAPH-3400 has always done. The paradigm for this wasn't clear, since CJK was the only script that had this characteristic, and so I hard-coded it into mktables. The way Tangut is structured may show that there is a paradigm emerging (but we only have two examples, and there may not be a paradigm at all), and so I have guessed one, and changed mktables to assume this guessed paradigm. If other scripts like this come along, and I have guessed correctly, mktables will cope with these automatically without manual intervention.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/embed.h b/embed.h
index f37b76b90c..f32f31733d 100644
--- a/embed.h
+++ b/embed.h
@@ -1111,13 +1111,14 @@
#define advance_one_LB(a,b,c) S_advance_one_LB(aTHX_ a,b,c)
#define advance_one_SB(a,b,c) S_advance_one_SB(aTHX_ a,b,c)
#define advance_one_WB(a,b,c,d) S_advance_one_WB(aTHX_ a,b,c,d)
+#define backup_one_GCB(a,b,c) S_backup_one_GCB(aTHX_ a,b,c)
#define backup_one_LB(a,b,c) S_backup_one_LB(aTHX_ a,b,c)
#define backup_one_SB(a,b,c) S_backup_one_SB(aTHX_ a,b,c)
#define backup_one_WB(a,b,c,d) S_backup_one_WB(aTHX_ a,b,c,d)
#define find_byclass(a,b,c,d,e) S_find_byclass(aTHX_ a,b,c,d,e)
#define isFOO_lc(a,b) S_isFOO_lc(aTHX_ a,b)
#define isFOO_utf8_lc(a,b) S_isFOO_utf8_lc(aTHX_ a,b)
-#define isGCB S_isGCB
+#define isGCB(a,b,c,d,e) S_isGCB(aTHX_ a,b,c,d,e)
#define isLB(a,b,c,d,e,f) S_isLB(aTHX_ a,b,c,d,e,f)
#define isSB(a,b,c,d,e,f) S_isSB(aTHX_ a,b,c,d,e,f)
#define isWB(a,b,c,d,e,f,g) S_isWB(aTHX_ a,b,c,d,e,f,g)