-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
More updates to v1.0 #964
More updates to v1.0 #964
Changes from all commits
9c975d9
ead7a04
d0f2598
ee75166
8aa4bfb
3e9e5d8
3f507fc
a8473e7
7719984
1457e01
0fddb7f
554835f
f83fd6b
a8900c1
343c22e
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
try: | ||
from future_builtins import filter # type: ignore | ||
except ImportError: | ||
|
@@ -6,10 +7,7 @@ | |
import sys | ||
from copy import deepcopy | ||
|
||
|
||
###{standalone | ||
from collections import OrderedDict | ||
from typing import List, Callable, Iterator, Union, Optional, Any, TYPE_CHECKING | ||
from typing import List, Callable, Iterator, Union, Optional, TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from .lexer import TerminalDef | ||
|
@@ -18,6 +16,9 @@ | |
else: | ||
from typing_extensions import Literal | ||
|
||
###{standalone | ||
from collections import OrderedDict | ||
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. Wasn't the goal to move all imports into 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. Not exactly, I was mostly concerned about repetitive imports. OrderedDict is only used once (and it a little meaningless in Python3, I just didn't think removing it fits into this PR) 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. Fair enough. (Also |
||
|
||
class Meta: | ||
|
||
empty: bool | ||
|
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.
Why?
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.
So it won't be part of the standalone code.
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.
I would suggest not splitting up the class. Instead move the complete class further down.
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.
It's also a bit strange to split the class in the middle. It breaks the indentation, and obfuscates the end of the standalone directive.
The only other place in Lark that happens is
tree.Tree
, and I'm not sure that it should stay that way.But my mind isn't made up. If you think splitting the class using inheritance is too weird, I'll accept it.