Permalink
Browse files

Fix bug in parsing of hex code points constants.

This happened in both:

echo -e '_\u03bc_'

and

echo $'_\u03bc_'
  • Loading branch information...
Andy Chu
Andy Chu committed Jun 8, 2018
1 parent d5cbdc5 commit f238a6d37fc8390a4c5245f7a7352d6ae4b5aceb
Showing with 5 additions and 3 deletions.
  1. +1 −1 asdl/asdl_.py
  2. +2 −0 gold/echo-e.sh
  3. +2 −2 osh/lex.py
View
@@ -301,7 +301,7 @@ def Print(self, f, indent):
class Sum(AST):
def __init__(self, types, attributes=None):
self.types = types
self.types = types # List[Constructor]
self.attributes = attributes or []
def Print(self, f, indent):
View
@@ -17,6 +17,8 @@ echo -e 'abcd\x65f'
echo -e 'abcd\044e'
echo -e 'abcd\u0065f'
echo -e 'abcd\U00000065f'
echo -e '_\u03bc_'
echo -e '_\U000003bc_'
echo -en '\03777' | od -A n -t x1 | sed 's/ \+/ /g'
echo -en '\04000' | od -A n -t x1 | sed 's/ \+/ /g'
echo -e '\0777' | od -A n -t x1 | sed 's/ \+/ /g'
View
@@ -395,8 +395,8 @@ def IsKeyword(name):
# \x6 is valid in bash
R(r'\\x[0-9a-fA-F]{1,2}', Id.Char_Hex),
R(r'\\u[0-9]{1,4}', Id.Char_Unicode4),
R(r'\\U[0-9]{1,8}', Id.Char_Unicode8),
R(r'\\u[0-9a-fA-F]{1,4}', Id.Char_Unicode4),
R(r'\\U[0-9a-fA-F]{1,8}', Id.Char_Unicode8),
R(r'\\[0abeEfrtnv\\]', Id.Char_OneChar),

0 comments on commit f238a6d

Please sign in to comment.