goast-viewer icon indicating copy to clipboard operation
goast-viewer copied to clipboard

goast: expression

Open Konstantin8105 opened this issue 6 years ago • 1 comments

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)
}

Konstantin8105 avatar Jan 29 '19 19:01 Konstantin8105

https://play.golang.org/p/o-Y9RCU6K7z

Konstantin8105 avatar Jan 29 '19 19:01 Konstantin8105