diff options
| author | dgp <dgp@users.sourceforge.net> | 2020-04-24 22:02:09 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2020-04-24 22:02:09 (GMT) |
| commit | 09ad9bf8c84c95afe8b857898b55033fbf6181e8 (patch) | |
| tree | 38fdd1dfb2e07fd56bf02632a84a536897e70499 /generic/tclParse.c | |
| parent | 3cfbf71c405ae6dab1f3354263b7bee0698dff97 (diff) | |
| parent | 9b3252ab93bb1eda4a7f82664832fb03a04b41b9 (diff) | |
| download | tcl-09ad9bf8c84c95afe8b857898b55033fbf6181e8.zip tcl-09ad9bf8c84c95afe8b857898b55033fbf6181e8.tar.gz tcl-09ad9bf8c84c95afe8b857898b55033fbf6181e8.tar.bz2 | |
WIP merging more from 8.6; little separation left.
Diffstat (limited to 'generic/tclParse.c')
| -rw-r--r-- | generic/tclParse.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index 4d7e6b8..f834480 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -167,6 +167,8 @@ static int ParseTokens(const char *src, int numBytes, int mask, int flags, Tcl_Parse *parsePtr); static int ParseWhiteSpace(const char *src, int numBytes, int *incompletePtr, char *typePtr); +static int ParseHex(const char *src, int numBytes, + int *resultPtr); /* *---------------------------------------------------------------------- @@ -754,7 +756,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. @@ -774,7 +776,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 @@ -899,7 +901,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 hexadigits -> This is just "x". @@ -914,7 +916,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 hexadigits -> This is just "u". @@ -926,7 +928,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; @@ -935,7 +937,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 hexadigits -> This is just "U". |
