merge branch 'fix_string_nl'
This commit is contained in:
commit
920b35f129
@ -50,7 +50,7 @@ partial_string = r'''(?x)
|
||||
" # start string
|
||||
(?:
|
||||
| [^"\\] # non-quote or backslash
|
||||
| \\. # or escaped single character
|
||||
| \\(.|\n) # or escaped single character or newline
|
||||
| \\x[0-9a-fA-F]{2} # or escaped raw character
|
||||
| \\u[0-9a-fA-F]{4} # or unicode escape
|
||||
| \\U[0-9a-fA-F]{8} # or long unicode escape
|
||||
|
@ -98,8 +98,14 @@ def test_lex_symbols():
|
||||
|
||||
def test_lex_strings():
|
||||
""" Make sure that strings are valid expressions"""
|
||||
objs = tokenize("\"foo\" ")
|
||||
objs = tokenize('"foo"')
|
||||
assert objs == [HyString("foo")]
|
||||
# Make sure backslash-escaped newlines work (see issue #831)
|
||||
objs = tokenize(r"""
|
||||
"a\
|
||||
bc"
|
||||
""")
|
||||
assert objs == [HyString("abc")]
|
||||
|
||||
|
||||
def test_lex_integers():
|
||||
|
Loading…
Reference in New Issue
Block a user