Remove the position_modifier from the parser.

This commit is contained in:
Dave Halter
2016-09-18 00:50:31 +02:00
parent ed71d05ed7
commit 885cf62a12
11 changed files with 62 additions and 67 deletions

View File

@@ -200,7 +200,7 @@ def test_for_on_one_line(differ):
def test_open_parentheses(differ):
func = 'def func():\n a'
func = 'def func():\n a\n'
code = 'isinstance(\n\n' + func
new_code = 'isinstance(\n' + func
differ.initialize(code)
@@ -208,10 +208,13 @@ def test_open_parentheses(differ):
differ.parse(new_code, parsers=1, expect_error_leafs=True)
new_code = 'a = 1\n' + new_code
differ.parse(new_code, parsers=2, expect_error_leafs=True)
differ.parse(new_code, copies=1, parsers=1, expect_error_leafs=True)
differ.initialize(new_code)
differ.parse('isinstance()\n' + func, parsers=2, copies=0)
func += 'def other_func():\n pass\n'
differ.initialize('isinstance(\n' + func)
# Cannot copy all, because the prefix of the function is once a newline and
# once not.
differ.parse('isinstance()\n' + func, parsers=2, copies=1)
def test_backslash(differ):