@@ -5372,7 +5372,8 @@ EXTCONST char *const PL_phase_names[];
5372
5372
# define PL_amagic_generation PL_na
5373
5373
#endif /* !PERL_CORE */
5374
5374
5375
- #define PL_hints PL_compiling.cop_hints
5375
+ #define PL_hints PL_compiling.cop_hints
5376
+ #define PL_hints_hash PL_compiling.cop_hints_hash
5376
5377
5377
5378
END_EXTERN_C
5378
5379
@@ -5409,7 +5410,7 @@ END_EXTERN_C
5409
5410
#define HINT_STRICT_REFS 0x00000002 /* strict pragma */
5410
5411
#define HINT_LOCALE 0x00000004 /* locale pragma */
5411
5412
#define HINT_BYTES 0x00000008 /* bytes pragma */
5412
- #define HINT_LOCALE_PARTIAL 0x00000004 /* ignored. was a subset of categories */
5413
+ #define HINT_LOCALE_PARTIAL 0x00000004 /* ignored. was 0x10 categories subset */
5413
5414
#define HINT_EXACT_ARITH 0x00000010 /* exact_arith pragma */
5414
5415
5415
5416
#define HINT_EXPLICIT_STRICT_REFS 0x00000020 /* strict.pm */
@@ -6379,39 +6380,48 @@ typedef struct am_table_short AMTS;
6379
6380
6380
6381
/* Returns TRUE if the plain locale pragma without a parameter is in effect
6381
6382
*/
6382
- # define IN_LOCALE_RUNTIME (PL_curcop \
6383
- && CopHINTS_get (PL_curcop) & HINT_LOCALE)
6383
+ # define IN_LOCALE_RUNTIME \
6384
+ (PL_curcop \
6385
+ && CopHINTS_get (PL_curcop) & HINT_LOCALE \
6386
+ && !SvIVX (cophh_fetch_pvs (PL_curcop->cop_hints_hash , " locale" , 0 )) \
6387
+ )
6384
6388
6385
- /* Returns TRUE if either form of the locale pragma is in effect */
6389
+ /* Returns TRUE if either form of the locale pragma is in effect (unused) */
6386
6390
# define IN_SOME_LOCALE_FORM_RUNTIME \
6387
- cBOOL (CopHINTS_get (PL_curcop) & ( HINT_LOCALE|HINT_LOCALE_PARTIAL) )
6391
+ cBOOL (CopHINTS_get (PL_curcop) & HINT_LOCALE)
6388
6392
6389
- # define IN_LOCALE_COMPILETIME cBOOL (PL_hints & HINT_LOCALE)
6393
+ /* (used) */
6394
+ # define IN_LOCALE_COMPILETIME \
6395
+ cBOOL (PL_hints & HINT_LOCALE \
6396
+ && !SvIVX (cophh_fetch_pvs (PL_hints_hash, " locale" , 0 )))
6397
+ /* (unused) */
6390
6398
# define IN_SOME_LOCALE_FORM_COMPILETIME \
6391
- cBOOL (PL_hints & ( HINT_LOCALE|HINT_LOCALE_PARTIAL) )
6399
+ cBOOL (PL_hints & HINT_LOCALE)
6392
6400
6401
+ /* Only for use locale; (used) */
6393
6402
# define IN_LOCALE \
6394
6403
(IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
6404
+ /* use locale ... ; (unused) */
6395
6405
# define IN_SOME_LOCALE_FORM \
6396
6406
(IN_PERL_COMPILETIME ? IN_SOME_LOCALE_FORM_COMPILETIME \
6397
6407
: IN_SOME_LOCALE_FORM_RUNTIME)
6398
6408
6399
6409
# define IN_LC_ALL_COMPILETIME IN_LOCALE_COMPILETIME
6400
6410
# define IN_LC_ALL_RUNTIME IN_LOCALE_RUNTIME
6401
6411
6412
+ /* the next 5 are actually used */
6402
6413
# define IN_LC_PARTIAL_COMPILETIME \
6403
- cBOOL (PL_hints & HINT_LOCALE_PARTIAL)
6414
+ cBOOL (PL_hints & HINT_LOCALE_PARTIAL)
6404
6415
# define IN_LC_PARTIAL_RUNTIME \
6405
- (PL_curcop && CopHINTS_get (PL_curcop) & HINT_LOCALE_PARTIAL)
6406
-
6407
- # define IN_LC_COMPILETIME (category ) \
6408
- (IN_LC_ALL_COMPILETIME || (IN_LC_PARTIAL_COMPILETIME \
6409
- && Perl__is_in_locale_category (aTHX_ TRUE , (category))))
6410
- # define IN_LC_RUNTIME (category ) \
6411
- (IN_LC_ALL_RUNTIME || (IN_LC_PARTIAL_RUNTIME \
6412
- && Perl__is_in_locale_category (aTHX_ FALSE , (category))))
6416
+ cBOOL (PL_curcop && CopHINTS_get (PL_curcop) & HINT_LOCALE_PARTIAL)
6417
+
6418
+ # define IN_LC_COMPILETIME (category ) \
6419
+ (IN_LC_PARTIAL_COMPILETIME && Perl__is_in_locale_category (aTHX_ TRUE , (category)))
6420
+ # define IN_LC_RUNTIME (category ) \
6421
+ (IN_LC_PARTIAL_RUNTIME && Perl__is_in_locale_category (aTHX_ FALSE , (category)))
6413
6422
# define IN_LC (category ) \
6414
- (IN_LC_COMPILETIME (category) || IN_LC_RUNTIME (category))
6423
+ (IN_LC_COMPILETIME (category) || IN_LC_RUNTIME (category))
6424
+
6415
6425
6416
6426
# if defined (PERL_CORE) || defined (PERL_IN_XSUB_RE)
6417
6427
0 commit comments