-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix DECLARE statements in STORED PROCEDURES (#44) #47
base: main
Are you sure you want to change the base?
Conversation
Since no files from .idea/ are in the repo, I suggest to put it in .gitignore. The version mentioned in the comment is nice for repos that do like to commit a basic PyCharm config: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
In case of isolate_top_level_statements=True, copy DECLARE statements to subsequent statements only if they are top level.
@SimeonStoykovQC do you expect this to be resolved by #56? |
@staticmethod | ||
def is_top_level_statement(node: ParserRuleContext): | ||
"""Check wether node is a top level SQL statement.""" | ||
cur = node.parentCtx | ||
while isinstance(cur, tsqlParser.Sql_clauseContext) or isinstance(cur, tsqlParser.Sql_clausesContext): | ||
cur = cur.parentCtx | ||
return isinstance(cur, tsqlParser.BatchContext) |
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 think this file is autogenerated from the ANTLR grammar and we shouldn't modify it manually
From what I remember, #56 and #59 just add things to the grammar, but no new functionality around it. Here it looks like you need to change our logic around it? By the way, we try to be in sync with the ANTLR grammar (there is a CI job that syncs it regularly), so if you also want to push grammar changes, consider doing it upstream. |
Copy DECLARE statements to subsequent statements only if they appear top level.
This fixes errors raised for