-
-
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
Conversation
Codecov Report
@@ Coverage Diff @@
## v1.0 #964 +/- ##
=======================================
Coverage 87.63% 87.63%
=======================================
Files 49 49
Lines 6888 6893 +5
=======================================
+ Hits 6036 6041 +5
Misses 852 852
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The Python3 grammar has been updated for compatibility with Lark.js |
def deserialize(self, data, memo, lexer_conf, callbacks, options): | ||
parser_conf = ParserConf.deserialize(data['parser_conf'], memo) | ||
parser = LALR_Parser.deserialize(data['parser'], memo, callbacks, options.debug) | ||
parser_conf.callbacks = callbacks | ||
return ParsingFrontend(lexer_conf, parser_conf, options, parser=parser) | ||
|
||
|
||
# ... Continued later in the module |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the goal to move all imports into standalone.py
?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. (Also OrderedDict
is still needed for 3.6
on non-CPython.)
Hopefully it's set up right this time.