summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 66813e5ecb7..3a03a3e030d 100644
--- a/parse.y
+++ b/parse.y
@@ -6825,7 +6825,11 @@ read_escape(struct parser_params *p, int flags, rb_encoding **encp)
goto eof;
}
if ((c = nextc(p)) == '\\') {
- if (peek(p, 'u')) goto eof;
+ switch (peekc(p)) {
+ case 'u': case 'U':
+ nextc(p);
+ goto eof;
+ }
return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
}
else if (c == -1 || !ISASCII(c)) goto eof;
@@ -6850,7 +6854,11 @@ read_escape(struct parser_params *p, int flags, rb_encoding **encp)
case 'c':
if (flags & ESCAPE_CONTROL) goto eof;
if ((c = nextc(p))== '\\') {
- if (peek(p, 'u')) goto eof;
+ switch (peekc(p)) {
+ case 'u': case 'U':
+ nextc(p);
+ goto eof;
+ }
c = read_escape(p, flags|ESCAPE_CONTROL, encp);
}
else if (c == '?')