Flatten TableFuncElementList (including test improvement) #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
TableFuncElementListをフラット化しました1. フラット化
commit: 13a4f5e
TableFuncElementListはテーブル関数の名前付きエイリアスで、列の型を明示する場合に使われる構文です。TableFuncElementList: TableFuncElement { $$ = list_make1($1); } | TableFuncElementList ',' TableFuncElement { $$ = lappend($1, $3); } ;source: https://github.com/postgres/postgres/blob/641f20d4c433b66df2928408fb2b44bd165c2329/src/backend/parser/gram.y#L14159-L14168
このリストがネストしないような変換処理を加えました。
利用例:
2. テスト改善
commit: 5a97979
これまで、flatten 系のテストは木の変換後にネストしたノードが無いことを確認しているのみでした。そのためそもそも対象ノードがネストしていないパターンがあっても気づけない構成になっていました。
今回の変更では、変換前の木の構造に対するチェックを入れることで、このモジュールで実行される変換処理が意味のあるものであることを保証するようにしました。