Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jianzzz opened this issue Aug 14, 2024 · 0 comments
Open

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

jianzzz opened this issue Aug 14, 2024 · 0 comments

Comments

@jianzzz
Copy link

jianzzz commented Aug 14, 2024

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.

@jianzzz jianzzz changed the title how to fetch multi-name using DSL? how to get the value of both identical attributes using DSL? Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant