-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo.scm
39 lines (38 loc) · 1.34 KB
/
go.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(call_expression
function: (selector_expression
field: (field_identifier) @method (#match? @method "(GetFlag|Evaluate|Boolean|Variant)"))
arguments: (argument_list
(unary_expression
operand: (composite_literal
type: (qualified_type
name: (type_identifier) @type_name (#match? @type_name "(GetFlagRequest|EvaluationRequest)"))
body: (literal_value
(keyed_element
(field_identifier) @namespace_key (#eq? @namespace_key "NamespaceKey")
(_) @namespace_value)
(keyed_element
(field_identifier) @flag_key (#match? @flag_key "^(Key|FlagKey)$")
(_) @flag_value)
)
)
)
) ? @args
) @call
;; This is the same as above, but with the namespace key omitted for matching optional namespace
(call_expression
function: (selector_expression
field: (field_identifier) @method (#match? @method "(GetFlag|Evaluate|Boolean|Variant)"))
arguments: (argument_list
(unary_expression
operand: (composite_literal
type: (qualified_type
name: (type_identifier) @type_name (#match? @type_name "(GetFlagRequest|EvaluationRequest)"))
body: (literal_value
(keyed_element
(field_identifier) @flag_key (#match? @flag_key "^(Key|FlagKey)$")
(_) @flag_value)
)
)
)
) ? @args
) @call