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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
@ ProgramNode (location: (1,0)-(5,3))
├── locals: []
└── statements:
@ StatementsNode (location: (1,0)-(5,3))
└── body: (length: 1)
└── @ DefNode (location: (1,0)-(5,3))
├── name: :x
├── name_loc: (1,4)-(1,5) = "x"
├── receiver: ∅
├── parameters:
│ @ ParametersNode (location: (1,6)-(1,7))
│ ├── requireds: (length: 1)
│ │ └── @ RequiredParameterNode (location: (1,6)-(1,7))
│ │ ├── flags: ∅
│ │ └── name: :y
│ ├── optionals: (length: 0)
│ ├── rest: ∅
│ ├── posts: (length: 0)
│ ├── keywords: (length: 0)
│ ├── keyword_rest: ∅
│ └── block: ∅
├── body:
│ @ StatementsNode (location: (2,2)-(4,10))
│ └── body: (length: 3)
│ ├── @ CallNode (location: (2,2)-(2,6))
│ │ ├── flags: ignore_visibility
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── name: :p
│ │ ├── message_loc: (2,2)-(2,3) = "p"
│ │ ├── opening_loc: (2,3)-(2,4) = "("
│ │ ├── arguments:
│ │ │ @ ArgumentsNode (location: (2,4)-(2,5))
│ │ │ ├── flags: ∅
│ │ │ └── arguments: (length: 1)
│ │ │ └── @ LocalVariableReadNode (location: (2,4)-(2,5))
│ │ │ ├── name: :y
│ │ │ └── depth: 0
│ │ ├── closing_loc: (2,5)-(2,6) = ")"
│ │ └── block: ∅
│ ├── @ LocalVariableOperatorWriteNode (location: (3,2)-(3,8))
│ │ ├── name_loc: (3,2)-(3,3) = "y"
│ │ ├── binary_operator_loc: (3,4)-(3,6) = "*="
│ │ ├── value:
│ │ │ @ IntegerNode (location: (3,7)-(3,8))
│ │ │ ├── flags: decimal
│ │ │ └── value: 2
│ │ ├── name: :y
│ │ ├── binary_operator: :*
│ │ └── depth: 0
│ └── @ ReturnNode (location: (4,2)-(4,10))
│ ├── flags: redundant
│ ├── keyword_loc: (4,2)-(4,8) = "return"
│ └── arguments:
│ @ ArgumentsNode (location: (4,9)-(4,10))
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ LocalVariableReadNode (location: (4,9)-(4,10))
│ ├── name: :y
│ └── depth: 0
├── locals: [:y]
├── def_keyword_loc: (1,0)-(1,3) = "def"
├── operator_loc: ∅
├── lparen_loc: (1,5)-(1,6) = "("
├── rparen_loc: (1,7)-(1,8) = ")"
├── equal_loc: ∅
└── end_keyword_loc: (5,0)-(5,3) = "end"
|