mirror of
https://github.com/davidhalter/parso.git
synced 2026-02-03 00:23:01 +08:00
Remove the remove_newline hack and build that stuff into error recovery instead.
Tests are passing except for diff parser tests.
This commit is contained in:
@@ -81,7 +81,7 @@ def test_incomplete_list_comprehension():
|
||||
# parser only valid statements generate one.
|
||||
children = parse('(1 for def').children
|
||||
assert [c.type for c in children] == \
|
||||
['error_node', 'error_node', 'newline', 'endmarker']
|
||||
['error_node', 'error_node', 'endmarker']
|
||||
|
||||
|
||||
def test_newline_positions():
|
||||
@@ -153,7 +153,7 @@ def test_python2_octal():
|
||||
def test_python3_octal():
|
||||
module = parse('0o660')
|
||||
if py_version >= 30:
|
||||
assert module.children[0].children[0].type == 'number'
|
||||
assert module.children[0].type == 'number'
|
||||
else:
|
||||
assert module.children[0].type == 'error_node'
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class TestsFunctionAndLambdaParsing(object):
|
||||
|
||||
def test_end_pos_line():
|
||||
# jedi issue #150
|
||||
s = "x()\nx( )\nx( )\nx ( )"
|
||||
s = "x()\nx( )\nx( )\nx ( )\n"
|
||||
module = parse(s)
|
||||
for i, simple_stmt in enumerate(module.children[:-1]):
|
||||
expr_stmt = simple_stmt.children[0]
|
||||
|
||||
@@ -12,7 +12,6 @@ import parso
|
||||
(' \f ', [' ', '\f', ' ']),
|
||||
(' \f ', [' ', '\f', ' ']),
|
||||
(' \r\n', [' ', '\r\n']),
|
||||
('\\', ['\\']),
|
||||
('\\\n', ['\\\n']),
|
||||
('\\\r\n', ['\\\r\n']),
|
||||
('\t\t\n\t', ['\t\t', '\n', '\t']),
|
||||
@@ -43,7 +42,6 @@ def test_simple_prefix_splitting(string, tokens):
|
||||
('\r\n', ['newline']),
|
||||
('\f', ['formfeed']),
|
||||
('\\\n', ['backslash']),
|
||||
('\r', ['newline']),
|
||||
])
|
||||
def test_prefix_splitting_types(string, types):
|
||||
tree = parso.parse(string)
|
||||
|
||||
Reference in New Issue
Block a user