Skip to content

how to get the value of both identical attributes using DSL? #169

@jianzzz

Description

@jianzzz

Code:

var r1, r2 = prompt_file.Request(), prompt_file.Request()
err := r.Ask()
if err != nil {
    return err
}

AST:

      var_declaration [19, 1] - [19, 58]
        var_spec [19, 5] - [19, 58]
          name: identifier [19, 5] - [19, 7]
          name: identifier [19, 9] - [19, 11]
          value: expression_list [19, 14] - [19, 58]

DSL:

(var_declaration (
    var_spec
       	name: ((identifier)) @var_name
        value: (expression_list(
        	call_expression
            	function: (selector_expression
                	operand: (identifier) @identifier
                )))))

var_spec has two identical attributes: name: [identifier].
How do I get the value of both?
I can only get the value of the first one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions