Improve Snowflake syntax support#5770
Conversation
* Extend Snowflake syntax with FOR-IN loop support * Extend snowflake syntax with bind variables support in IDENTIFIRE() statement
|
|
||
| type = "for_in_statement" | ||
|
|
||
| match_grammar = OneOf( |
There was a problem hiding this comment.
Should this not be a Sequence at the top level?
There was a problem hiding this comment.
It looks like there is a mess with terminators in Delimited() statements and FOR statement itself. Unfortunately, could not find more pretty workaround of that.
There was a problem hiding this comment.
I think it should be possible, but I'll have a go and see if I can make it work that way.
There was a problem hiding this comment.
Yep - there's something strange going on here. I think it's actually a problem with ScriptingBlockStatementSegment. I'm going to have a go at fixing it.
There was a problem hiding this comment.
Yeah I think there was a bug in the terminator support. I think I've found an fixed it - it also threw up that there's a problem with one of our existing test cases, which I've also solved. @WittierDinosaur I'd love a review given I've added quite a lot of code to this PR.
Coverage Results ✅ |
Co-authored-by: Danny Jones <[email protected]>
Brief summary of the change made
Are there any other side effects of this change that we should be aware of?
Not expected
Pull Request checklist
Please confirm you have completed any of the necessary steps below.
Included test cases to demonstrate any code changes, which may be one or more of the following:
.ymlrule test cases intest/fixtures/rules/std_rule_cases..sql/.ymlparser test cases intest/fixtures/dialects(note YML files can be auto generated withtox -e generate-fixture-yml).test/fixtures/linter/autofix.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.