Skip to content
Snippets Groups Projects
Commit 546252cc authored by Anton Sattarov's avatar Anton Sattarov
Browse files

fix

parent 4d1710d1
No related branches found
No related tags found
No related merge requests found
......@@ -213,6 +213,8 @@ func (c *compiler) UnaryNode(node *ast.UnaryNode) interface{} {
func (c *compiler) identifier(node ast.Node) string {
switch l := node.(type) {
case *ast.MemberNode:
return c.MemberNode(l)
case *ast.IdentifierNode:
return c.IdentifierNode(l)
}
......@@ -314,6 +316,14 @@ func (c *compiler) BinaryNode(node *ast.BinaryNode) interface{} {
}
}
func (c *compiler) MemberNode(node *ast.MemberNode) string {
v := c.compile(node.Node)
if val, ok := v.(string); ok {
return fmt.Sprintf("%s.%s", val, node.Property)
}
panic(fmt.Sprintf("unsupported property for %v", ast.Dump(node.Node)))
}
func (c *compiler) SliceNode(node *ast.SliceNode) interface{} {
panic("unsupported slice node")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment