Skip to content

Commit 42ab48a

Browse files
committed
Revert "Basic %ignore implementation"
This reverts commit 22e2fe9
1 parent 7e955fa commit 42ab48a

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

lark/load_grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ def rule_dependencies(symbol):
12701270
self._definitions = {k: v for k, v in self._definitions.items() if k in _used}
12711271

12721272

1273-
def resolve_import(self, dotted_path: Tuple[str, ...], base_path: Optional[str]) -> Tuple[str, Union[str, PackageResource]]:
1273+
def resolve_import(self, dotted_path: Tuple[str, ...], base_path: Optional[str]) -> tuple[str, Union[str, PackageResource]]:
12741274
assert dotted_path
12751275
grammar_path = os.path.join(*dotted_path) + EXT
12761276
to_try = self.import_paths + ([base_path] if base_path is not None else []) + [stdlib_loader]

tests/test_grammar.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,6 @@ def test_import_custom_sources3(self):
164164
x = p.parse('12 capybaras')
165165
self.assertEqual(x.children, ['12', 'capybaras'])
166166

167-
def test_include(self):
168-
grammar = """
169-
start: startab
170-
%include .grammars.ab
171-
"""
172-
p = Lark(grammar, source_path=__file__)
173-
self.assertEqual(p.parse('ab'),
174-
Tree('start', [Tree('startab', [Tree('expr', [Token('A', 'a'), Token('B', 'b')])])]))
175-
176167
def test_find_grammar_errors(self):
177168
text = """
178169
a: rule

tests/test_nearley/nearley

0 commit comments

Comments
 (0)