Skip to content

Commit

Permalink
Print the names of the decos when dumping the AST.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Jan 16, 2020
1 parent 8d6e5e2 commit 5898858
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/vm/parser/sexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ func (s *Sexp) VisitBefore(n ast.Node) (ast.Visitor, ast.Node) {
case *ast.StopStmt:
s.emit("stop")

case *ast.IndexedExpr, *ast.StmtList, *ast.ExprList, *ast.CondStmt, *ast.DecoDecl, *ast.DecoStmt, *ast.PatternExpr: // normal walk
case *ast.DecoDecl:
s.emit(fmt.Sprintf("%q", v.Name))
s.newline()
case *ast.DecoStmt:
s.emit(fmt.Sprintf("%q", v.Name))
s.newline()

case *ast.IndexedExpr, *ast.StmtList, *ast.ExprList, *ast.CondStmt, *ast.PatternExpr: // normal walk

default:
panic(fmt.Sprintf("sexp found undefined type %T", n))
Expand Down

0 comments on commit 5898858

Please sign in to comment.