From 8f921436ede040eb9ead4e9b57df93ce7214b35d Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Apr 2020 17:05:22 +1200 Subject: [PATCH] stmt: group node* definitions together --- node.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/node.go b/node.go index a89a88b..4037bff 100644 --- a/node.go +++ b/node.go @@ -74,6 +74,12 @@ func convert(n_ node.Node) (string, error) { return ret, nil + case *node.Identifier: + return n.Value, nil + + case Literal: + return n.Value, nil + // // stmt // @@ -388,16 +394,6 @@ func convert(n_ node.Node) (string, error) { // TODO this may need to use `:=` return lvalue + " = " + rvalue, nil - // - // special literals - // - - case Literal: - return n.Value, nil - - case *node.Identifier: - return n.Value, nil - // // expr //