Skip to content
Permalink
Browse files

Closes #146. Fixes multiple bugs with nested dot operators.

  • Loading branch information...
AZHenley committed May 1, 2019
1 parent b2ed540 commit 5f21d05474d8252765fcc5f196e6ecd22a11d606
Showing with 5 additions and 3 deletions.
  1. +5 −3 emitter/emitter.go
@@ -270,7 +270,8 @@ func funcCall(node *ast.Node) string {
if node.Children[0].Type == ast.DOTOP {
funcName := node.Children[0].Children[1].TokenStart.Literal
var argList string
argList += node.Children[0].Children[0].TokenStart.Literal
//argList += node.Children[0].Children[0].TokenStart.Literal
argList += expr(&node.Children[0].Children[0])
if len(node.Children) > 1 {
argList += ", "
for index, child := range node.Children[1].Children {
@@ -322,7 +323,8 @@ func varAssign(node *ast.Node) string {
// TODO: Fix multiple assignment.
for i := 0; i < len(node.Children)-1; i++ {
code += node.Children[i].Children[0].TokenStart.Literal
currentName = node.Children[i].Children[0].TokenStart.Literal
//currentName = node.Children[i].Children[0].TokenStart.Literal
currentName = expr(&node.Children[i])
if i+1 < len(node.Children)-1 {
code += ", "
}
@@ -339,7 +341,7 @@ func varDecl(node *ast.Node) string {
// TODO: Fix multiple declarations.
for i := 0; i < len(node.Children)-1; i += 2 {
varName := node.Children[i].TokenStart.Literal
currentName = varName
currentName = expr(&node.Children[i])

varType := node.Children[i+1].Children[0].TokenStart.Literal
if varType == "string" {

0 comments on commit 5f21d05

Please sign in to comment.
You can’t perform that action at this time.