@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
77
88 Written by Philip Hazel
99 Original API code Copyright (c) 1997-2012 University of Cambridge
10- New API code Copyright (c) 2016-2021 University of Cambridge
10+ New API code Copyright (c) 2016-2022 University of Cambridge
1111
1212-----------------------------------------------------------------------------
1313Redistribution and use in source and binary forms, with or without
@@ -123,18 +123,21 @@ opcode is used to select the column. The values are as follows:
123123*/
124124
125125static const uint8_t propposstab [PT_TABSIZE ][PT_TABSIZE ] = {
126- /* ANY LAMP GC PC SC ALNUM SPACE PXSPACE WORD CLIST UCNC */
127- { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_ANY */
128- { 0 , 3 , 0 , 0 , 0 , 3 , 1 , 1 , 0 , 0 , 0 }, /* PT_LAMP */
129- { 0 , 0 , 2 , 4 , 0 , 9 , 10 , 10 , 11 , 0 , 0 }, /* PT_GC */
130- { 0 , 0 , 5 , 2 , 0 , 15 , 16 , 16 , 17 , 0 , 0 }, /* PT_PC */
131- { 0 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_SC */
132- { 0 , 3 , 6 , 12 , 0 , 3 , 1 , 1 , 0 , 0 , 0 }, /* PT_ALNUM */
133- { 0 , 1 , 7 , 13 , 0 , 1 , 3 , 3 , 1 , 0 , 0 }, /* PT_SPACE */
134- { 0 , 1 , 7 , 13 , 0 , 1 , 3 , 3 , 1 , 0 , 0 }, /* PT_PXSPACE */
135- { 0 , 0 , 8 , 14 , 0 , 0 , 1 , 1 , 3 , 0 , 0 }, /* PT_WORD */
136- { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_CLIST */
137- { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 } /* PT_UCNC */
126+ /* ANY LAMP GC PC SC SCX ALNUM SPACE PXSPACE WORD CLIST UCNC BIDICL BOOL */
127+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_ANY */
128+ { 0 , 3 , 0 , 0 , 0 , 0 , 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 }, /* PT_LAMP */
129+ { 0 , 0 , 2 , 4 , 0 , 0 , 9 , 10 , 10 , 11 , 0 , 0 , 0 , 0 }, /* PT_GC */
130+ { 0 , 0 , 5 , 2 , 0 , 0 , 15 , 16 , 16 , 17 , 0 , 0 , 0 , 0 }, /* PT_PC */
131+ { 0 , 0 , 0 , 0 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_SC */
132+ { 0 , 0 , 0 , 0 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_SCX */
133+ { 0 , 3 , 6 , 12 , 0 , 0 , 3 , 1 , 1 , 0 , 0 , 0 , 0 , 0 }, /* PT_ALNUM */
134+ { 0 , 1 , 7 , 13 , 0 , 0 , 1 , 3 , 3 , 1 , 0 , 0 , 0 , 0 }, /* PT_SPACE */
135+ { 0 , 1 , 7 , 13 , 0 , 0 , 1 , 3 , 3 , 1 , 0 , 0 , 0 , 0 }, /* PT_PXSPACE */
136+ { 0 , 0 , 8 , 14 , 0 , 0 , 0 , 1 , 1 , 3 , 0 , 0 , 0 , 0 }, /* PT_WORD */
137+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_CLIST */
138+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 , 0 }, /* PT_UCNC */
139+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* PT_BIDICL */
140+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } /* PT_BOOL */
138141};
139142
140143/* This table is used to check whether auto-possessification is possible
@@ -196,6 +199,7 @@ static BOOL
196199check_char_prop (uint32_t c , unsigned int ptype , unsigned int pdata ,
197200 BOOL negated )
198201{
202+ BOOL ok ;
199203const uint32_t * p ;
200204const ucd_record * prop = GET_UCD (c );
201205
@@ -215,6 +219,11 @@ switch(ptype)
215219 case PT_SC :
216220 return (pdata == prop -> script ) == negated ;
217221
222+ case PT_SCX :
223+ ok = (pdata == prop -> script
224+ || MAPBIT (PRIV (ucd_script_sets ) + UCD_SCRIPTX_PROP (prop ), pdata ) != 0 );
225+ return ok == negated ;
226+
218227 /* These are specials */
219228
220229 case PT_ALNUM :
@@ -251,6 +260,14 @@ switch(ptype)
251260 if (c == * p ++ ) return negated ;
252261 }
253262 break ; /* Control never reaches here */
263+
264+ /* Haven't yet thought these through. */
265+
266+ case PT_BIDICL :
267+ return FALSE;
268+
269+ case PT_BOOL :
270+ return FALSE;
254271 }
255272
256273return FALSE;
0 commit comments