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