mirror of
https://https.git.savannah.gnu.org/git/gettext.git
synced 2026-01-26 15:39:11 +00:00
Support for escape sequences added in Lua 5.2.
This commit is contained in:
parent
7258f3aa1a
commit
97c6a77933
@ -1,3 +1,8 @@
|
||||
2013-04-16 Ľubomír Remák <lubomirr@lubomirr.eu>
|
||||
|
||||
Support for escape sequences added in Lua 5.2.
|
||||
* x-lua.c (phase3_get): Add \x and \z escape sequences.
|
||||
|
||||
2013-04-11 Ľubomír Remák <lubomirr@lubomirr.eu>
|
||||
|
||||
Support for Lua.
|
||||
|
||||
@ -619,7 +619,47 @@ phase3_get (token_ty *tp)
|
||||
case 'v':
|
||||
string_add ('\v');
|
||||
break;
|
||||
case 'x':
|
||||
{
|
||||
int num = 0;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
c = phase1_getc ();
|
||||
if (c >= '0' && c <= '9')
|
||||
num += c - '0';
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
num += c - 'a' + 10;
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
num += c - 'A' + 10;
|
||||
else
|
||||
{
|
||||
phase1_ungetc (c);
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
num *= 16;
|
||||
}
|
||||
|
||||
if (i == 2)
|
||||
string_add (num);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'z':
|
||||
/* Ignore the following whitespace. */
|
||||
do
|
||||
{
|
||||
c = phase1_getc ();
|
||||
}
|
||||
while (c == ' ' || c == '\n' || c == '\t' || c == '\r'
|
||||
|| c == '\f' || c == '\v');
|
||||
|
||||
phase1_ungetc (c);
|
||||
|
||||
break;
|
||||
default:
|
||||
/* Check if it's a '\ddd' sequence. */
|
||||
if (c >= '0' && c <= '9')
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
2013-04-16 Ľubomír Remák <lubomirr@lubomirr.eu>
|
||||
|
||||
Support for escape sequences added in Lua 5.2.
|
||||
* xgettext-lua-1: New test cases for \x and \z escape sequences.
|
||||
|
||||
2013-04-11 Ľubomír Remák <lubomirr@lubomirr.eu>
|
||||
|
||||
Support for Lua.
|
||||
|
||||
@ -19,6 +19,8 @@ print(_(hmm["nope"]))
|
||||
print({_"yep"})
|
||||
print(_["nope"])
|
||||
print(_("\097"))
|
||||
print(_("\x3F\z
|
||||
\x2a"))
|
||||
EOF
|
||||
|
||||
tmpfiles="$tmpfiles xg-lu-1.tmp.po xg-lu-1.po"
|
||||
@ -60,6 +62,9 @@ msgstr ""
|
||||
|
||||
msgid "a"
|
||||
msgstr ""
|
||||
|
||||
msgid "?*"
|
||||
msgstr ""
|
||||
EOF
|
||||
|
||||
: ${DIFF=diff}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user