aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/cmd
diff options
context:
space:
mode:
authorTing-Wei Lan <tingwei.lan@cobinhood.com>2019-01-29 15:51:06 +0800
committerJhih-Ming Huang <jm.huang@cobinhood.com>2019-03-26 17:48:21 +0800
commitd702d0e9bbf30ecaf066430e758a10709ea11004 (patch)
tree559b1b53cf8cd1a4b2b64175b27dc7a0935493a3 /core/vm/sqlvm/cmd
parentdab8ef6f9f0a4a945114a96c28a422a73eb1c770 (diff)
downloaddexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar.gz
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar.bz2
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar.lz
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar.xz
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.tar.zst
dexon-d702d0e9bbf30ecaf066430e758a10709ea11004.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.go3
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)
}