forked from pganalyze/pg_query.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add iter() on ParseResult and NodeRef
This allows walking over all nodes in the AST, instead of just a limited subset as in the current `nodes()` function. See pganalyze#31 The implementation uses static code generation in `build.rs`. The protobuf definitions are parsed, and a graph of all Message types is constructed. All NodeRef types are given an `unpack()` function, that recursively calls `unpack()` on all relevant fields (i.e., the fields that have a Node type, or that have a type that eventually has a Node type as a field). The result is guaranteed to visit all nodes. The code generation mechanism is maybe also useful to replace parts of the codebase that currently need to be manually hardcoded. Adds prost, prost-types and heck to the build dependencies, and updates the prost dependency version.
- Loading branch information
Showing
7 changed files
with
521 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.