diff options
author | Ting-Wei Lan <tingwei.lan@cobinhood.com> | 2019-01-29 15:51:06 +0800 |
---|---|---|
committer | Jhih-Ming Huang <jm.huang@cobinhood.com> | 2019-05-06 10:44:03 +0800 |
commit | f4b202770ceeb57a25e40d7714883f321cc5e3e1 (patch) | |
tree | 849106802c7341c512685c8f64e3174c36045f7d /core/vm/sqlvm/cmd | |
parent | 27464515201f163bd74580d729ff03bbae2d84c9 (diff) | |
download | dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar.gz dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar.bz2 dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar.lz dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar.xz dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.tar.zst dexon-f4b202770ceeb57a25e40d7714883f321cc5e3e1.zip |
core: vm: sqlvm: ast: don't hardcode output and indent in PrintAST
It is now possible to write AST dump to a writer other than stdout and
use indent string other than 2 spaces.
Diffstat (limited to 'core/vm/sqlvm/cmd')
-rw-r--r-- | core/vm/sqlvm/cmd/ast-printer/main.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/vm/sqlvm/cmd/ast-printer/main.go b/core/vm/sqlvm/cmd/ast-printer/main.go index 7b4251fa1..6965a1d4e 100644 --- a/core/vm/sqlvm/cmd/ast-printer/main.go +++ b/core/vm/sqlvm/cmd/ast-printer/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "os" "github.com/dexon-foundation/dexon/core/vm/sqlvm/ast" "github.com/dexon-foundation/dexon/core/vm/sqlvm/parser" @@ -17,7 +18,7 @@ func main() { n, err := parser.Parse([]byte(flag.Arg(0))) fmt.Printf("detail: %t\n", detail) if err == nil { - ast.PrintAST(n, "", detail) + ast.PrintAST(os.Stdout, n, " ", detail) } else { fmt.Printf("err:\n%+v\n", err) } |