-
Notifications
You must be signed in to change notification settings - Fork 219
Remove pure parser #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove pure parser #1371
Changes from all commits
ed80668
ece60e2
4da1bef
36c41bb
d425206
52bdb87
efac9f9
67a1d82
e75208b
9060d7f
98b1434
bc7607e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,12 +8,9 @@ | |||||
| import libcst as cst | ||||||
| from libcst import parse_statement | ||||||
| from libcst._nodes.tests.base import CSTNodeTest | ||||||
| from libcst._parser.entrypoints import is_native | ||||||
| from libcst.testing.utils import data_provider | ||||||
|
|
||||||
| parser: Optional[Callable[[str], cst.CSTNode]] = ( | ||||||
| parse_statement if is_native() else None | ||||||
| ) | ||||||
| parser: Optional[Callable[[str], cst.CSTNode]] = parse_statement | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| class MatchTest(CSTNodeTest): | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
| import libcst as cst | ||
| from libcst import parse_module, parse_statement | ||
| from libcst._nodes.tests.base import CSTNodeTest | ||
| from libcst._parser.entrypoints import is_native | ||
| from libcst.metadata import CodeRange, MetadataWrapper, PositionProvider | ||
| from libcst.testing.utils import data_provider | ||
|
|
||
|
|
@@ -117,7 +116,7 @@ def test_code_for_node( | |
| def test_parser( | ||
| self, *, code: str, expected: cst.Module, enabled_for_native: bool = True | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| ) -> None: | ||
| if is_native() and not enabled_for_native: | ||
| if not enabled_for_native: | ||
| self.skipTest("Disabled for native parser") | ||
| self.assertEqual(parse_module(code), expected) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,13 +8,10 @@ | |||||
| import libcst as cst | ||||||
| from libcst import parse_statement | ||||||
| from libcst._nodes.tests.base import CSTNodeTest, DummyIndentedBlock | ||||||
| from libcst._parser.entrypoints import is_native | ||||||
| from libcst.metadata import CodeRange | ||||||
| from libcst.testing.utils import data_provider | ||||||
|
|
||||||
| native_parse_statement: Optional[Callable[[str], cst.CSTNode]] = ( | ||||||
| parse_statement if is_native() else None | ||||||
| ) | ||||||
| native_parse_statement: Optional[Callable[[str], cst.CSTNode]] = parse_statement | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| class TryTest(CSTNodeTest): | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
| import libcst as cst | ||
| from libcst import parse_statement | ||
| from libcst._nodes.tests.base import CSTNodeTest, parse_statement_as | ||
| from libcst._parser.entrypoints import is_native | ||
| from libcst.helpers import ensure_type | ||
| from libcst.metadata import CodeRange | ||
| from libcst.testing.utils import data_provider | ||
|
|
@@ -241,6 +240,6 @@ def test_valid( | |
| ) | ||
| ) | ||
| def test_versions(self, **kwargs: Any) -> None: | ||
| if is_native() and not kwargs.get("expect_success", True): | ||
| if not kwargs.get("expect_success", True): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should delete test cases that are marked with |
||
| self.skipTest("parse errors are disabled for native parser") | ||
| self.assert_parses(**kwargs) | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should clean these up too