goast-viewer
goast-viewer copied to clipboard
goast: expression
Hello @yuroyoro! Now, you server create AST from Go source. Is possible add parsing string to Go AST expression?
Result of next example is AST of expression d*6*integer(r*8+ff,12,3)
:
package main
import (
"go/ast"
"go/parser"
"go/token"
)
func main() {
a, _ := parser.ParseExpr("d*6*integer(r*8+ff,12,3)")
ast.Print(token.NewFileSet(), a)
}
https://play.golang.org/p/o-Y9RCU6K7z