Skip to content
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

Implement --output in tools/parser #258

Merged

Conversation

apstndb
Copy link
Contributor

@apstndb apstndb commented Jan 7, 2025

This PR implements --output flag in tools/parse. It controls output of the command.

# default is not changed
$ go run ./tools/parse/main.go -mode expr "1"                
--- AST
&ast.IntLiteral{
  ValueEnd: 1,
  Base:     10,
  Value:    "1",
}
--- SQL
1

# only ast
$ go run ./tools/parse/main.go -mode expr --output ast "1"    
--- AST
&ast.IntLiteral{
  ValueEnd: 1,
  Base:     10,
  Value:    "1",
}

# only unparse
$ go run ./tools/parse/main.go -mode expr --output unparse "1"
--- SQL
1

Copy link
Collaborator

@makenowjust makenowjust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@makenowjust makenowjust merged commit d1d0213 into cloudspannerecosystem:main Jan 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Control output of tools/parse
2 participants