summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2012-01-12 17:22:05 -0300
committerKarl Williamson <public@khwilliamson.com>2012-01-29 10:07:40 -0700
commit838f2281125c4e0f98e5d741f9058f09c8242d33 (patch)
tree6fa3458446be72105180d95d66cf87a1d3b7cf3b /opcode.h
parent2a4315f8fb099a3fd3bbd5d9994af3919a6c5b05 (diff)
downloadperl-838f2281125c4e0f98e5d741f9058f09c8242d33.tar.gz
Implement the fc keyword and the \F string escape.
Along with the simple_casefolding and full_casefolding features. fc() stands for foldcase, a sort of pseudo case (like lowercase), which is used to implement Unicode casefolding. It maps a string to a form where all case differences are erased, so it's a locale-independent way of checking if two strings are the same, regardless of case. This functionality was, and still is, available through the regular expression engine -- /i matches would use casefolding internally. The fc keyword merely exposes this for easier access. Previously, one could attempt to case-insensitively test two strings for equality by doing lc($a) eq lc($b) But that might get you wrong results, for example in the case of \x{DF}, LATIN SMALL LETTER SHARP S.
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/opcode.h b/opcode.h
index 5f242a01a3..0a9628da92 100644
--- a/opcode.h
+++ b/opcode.h
@@ -521,6 +521,7 @@ EXTCONST char* const PL_op_name[] = {
"rvalues",
"coreargs",
"runcv",
+ "fc",
};
#endif
@@ -901,6 +902,7 @@ EXTCONST char* const PL_op_desc[] = {
"values on reference",
"CORE:: subroutine",
"__SUB__",
+ "fc",
};
#endif
@@ -1295,6 +1297,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
Perl_pp_rvalues, /* implemented by Perl_pp_rkeys */
Perl_pp_coreargs,
Perl_pp_runcv,
+ Perl_pp_fc,
}
#endif
#ifdef PERL_PPADDR_INITED
@@ -1686,6 +1689,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
Perl_ck_each, /* rvalues */
Perl_ck_null, /* coreargs */
Perl_ck_null, /* runcv */
+ Perl_ck_fun, /* fc */
}
#endif
#ifdef PERL_CHECK_INITED
@@ -2071,6 +2075,7 @@ EXTCONST U32 PL_opargs[] = {
0x00001b08, /* rvalues */
0x00000600, /* coreargs */
0x00000004, /* runcv */
+ 0x00009b8e, /* fc */
};
#endif