1
0
forked from VimPlug/jedi

Refactored the parser calls. Now it's possible to use jedi.parser.python.parse to quickly parse something.

This commit is contained in:
Dave Halter
2017-03-14 00:38:58 +01:00
parent 9b5e6d16da
commit 97fc3bc23c
23 changed files with 126 additions and 123 deletions

View File

@@ -7,16 +7,14 @@ import os
import sys
import textwrap
from .helpers import TestCase, cwd_at
import pytest
import jedi
from jedi._compatibility import u
from jedi import Script
from jedi import api
from jedi import common
from jedi.evaluate import imports
from jedi.parser import ParserWithRecovery, load_grammar
from jedi.parser.python import parse
from .helpers import TestCase, cwd_at
#jedi.set_debug_function()
@@ -102,9 +100,9 @@ class TestRegression(TestCase):
def test_end_pos_line(self):
# jedi issue #150
s = u("x()\nx( )\nx( )\nx ( )")
parser = ParserWithRecovery(load_grammar(), s)
for i, s in enumerate(parser.module.statements):
s = "x()\nx( )\nx( )\nx ( )"
module = parse(s)
for i, s in enumerate(module.statements):
assert s.end_pos == (i + 1, i + 3)
def check_definition_by_marker(self, source, after_cursor, names):