summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-24 21:37:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-24 21:37:37 (GMT)
commit0bf016741ddaacffa48a2abeafe0dbc17b9cd7b8 (patch)
tree342c37051bcd6c1391fb68000870885797dcfd69 /generic/tclParse.c
parentadb2d1d9399a44ba950ed6f2c064c1509dffde87 (diff)
parentba884cc1dd1d227fad00c29309a5add78a73b2ba (diff)
downloadtcl-0bf016741ddaacffa48a2abeafe0dbc17b9cd7b8.zip
tcl-0bf016741ddaacffa48a2abeafe0dbc17b9cd7b8.tar.gz
tcl-0bf016741ddaacffa48a2abeafe0dbc17b9cd7b8.tar.bz2
Merge 8.6 (Except encoding-12.6 test-case still to be handled)
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index adc559d..e95768d 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -128,6 +128,8 @@ static int ParseWhiteSpace(const char *src, int numBytes,
int *incompletePtr, char *typePtr);
static int ParseAllWhiteSpace(const char *src, int numBytes,
int *incompletePtr);
+static int ParseHex(const char *src, int numBytes,
+ int *resultPtr);
/*
*----------------------------------------------------------------------
@@ -701,7 +703,7 @@ TclParseAllWhiteSpace(
/*
*----------------------------------------------------------------------
*
- * TclParseHex --
+ * ParseHex --
*
* Scans a hexadecimal number as a Tcl_UniChar value (e.g., for parsing
* \x and \u escape sequences). At most numBytes bytes are scanned.
@@ -721,7 +723,7 @@ TclParseAllWhiteSpace(
*/
int
-TclParseHex(
+ParseHex(
const char *src, /* First character to parse. */
int numBytes, /* Max number of byes to scan */
int *resultPtr) /* Points to storage provided by caller where
@@ -845,7 +847,7 @@ TclParseBackslash(
result = 0xB;
break;
case 'x':
- count += TclParseHex(p+1, (numBytes > 3) ? 2 : numBytes-2, &result);
+ count += ParseHex(p+1, (numBytes > 3) ? 2 : numBytes-2, &result);
if (count == 2) {
/*
* No hexdigits -> This is just "x".
@@ -860,7 +862,7 @@ TclParseBackslash(
}
break;
case 'u':
- count += TclParseHex(p+1, (numBytes > 5) ? 4 : numBytes-2, &result);
+ count += ParseHex(p+1, (numBytes > 5) ? 4 : numBytes-2, &result);
if (count == 2) {
/*
* No hexdigits -> This is just "u".
@@ -871,7 +873,7 @@ TclParseBackslash(
/* If high surrogate is immediately followed by a low surrogate
* escape, combine them into one character. */
int low;
- int count2 = TclParseHex(p+7, 4, &low);
+ int count2 = ParseHex(p+7, 4, &low);
if ((count2 == 4) && ((low & 0xDC00) == 0xDC00)) {
result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000;
count += count2 + 2;
@@ -879,7 +881,7 @@ TclParseBackslash(
}
break;
case 'U':
- count += TclParseHex(p+1, (numBytes > 9) ? 8 : numBytes-2, &result);
+ count += ParseHex(p+1, (numBytes > 9) ? 8 : numBytes-2, &result);
if (count == 2) {
/*
* No hexdigits -> This is just "U".