-
Notifications
You must be signed in to change notification settings - Fork 368
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
Increase code quality and fix test #1124
base: master
Are you sure you want to change the base?
Conversation
Ruff E,W, defalts
--ignore F405,F403,F401,RET504,RET505 --exclude tests/ --select E,W,R,PIE,R
minor changes
- minor lint fixes
if scope: | ||
pass | ||
else: | ||
msg = "behavior name: " + name + " is not defined!" | ||
pass | ||
|
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.
Unused
def enter_variable_declaration(self, node: ast_node.VariableDeclaration): | ||
pass | ||
|
||
def exit_variable_declaration(self, node: ast_node.VariableDeclaration): | ||
pass | ||
|
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.
double defined
class VariableDeclaration(Declaration): | ||
""" | ||
'var' fieldName (',' fieldName)* ':' typeDeclarator ('=' (sampleExpression | valueExp) )? NEWLINE; | ||
""" | ||
|
||
def __init__(self, field_name, field_type): | ||
super().__init__() | ||
self.field_name = field_name | ||
self.field_type = field_type | ||
self.set_children(field_name) | ||
|
||
def enter_node(self, listener): | ||
if hasattr(listener, "enter_variable_declaration"): | ||
listener.enter_variable_declaration(self) | ||
|
||
def exit_node(self, listener): | ||
if hasattr(listener, "exit_variable_declaration"): | ||
listener.exit_variable_declaration(self) | ||
|
||
def accept(self, visitor): | ||
if hasattr(visitor, "visit_variable_declaration"): | ||
return visitor.visit_variable_declaration(self) | ||
else: | ||
return visitor.visit_children(self) | ||
|
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.
duplicate
def visit_variable_declaration(self, node: ast_node.VariableDeclaration): | ||
return self.visit_children(node) | ||
|
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.
duplicate
This change is