Use join to concat the both side of the AST

Onf of the sides can be nil and it will raise a Conversion error
上级 3f79a771
......@@ -110,10 +110,11 @@ def visit(node, optional = false)
def visit_CAT(node, optional)
left = visit(node.left, optional)
right = visit(node.right, optional)
if optional && !(right && left)
""
else
left + right
[left, right].join
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册