Skip to content

reflog/go2ast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to go2ast 👋

Version License: MIT Twitter: reflog

Transform Go code into it's AST

Usage

echo "a := 1" | go run main.go

Example output

[]ast.Stmt {
        &ast.AssignStmt {
                Lhs: []ast.Expr {
                        &ast.Ident {
                                Name: "a",
                        },
                },
                Tok: :=,
                Rhs: []ast.Expr {
                        &ast.BasicLit {
                                ValuePos: 30,
                                Kind: INT,
                                Value: "1",
                        },
                },
        },
}

WASM Demo

Try this live: https://reflog.github.io/go2ast/

Author

👤 Eli Yukelzon

About

Transform Go code into it's AST

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages