Slide 37
Slide 37 text
COSCUP 2024
༻ Prism ိ Parse Ruby
Parse Ruby with Prism
@ ProgramNode (location: (1,0)-(1,11))
├── locals: [:coscup]
└── statements:
@ StatementsNode (location: (1,0)-(1,11))
└── body: (length: 1)
└── @ LocalVariableWriteNode (location: (1,0)-(1,11))
├── name: :coscup
├── depth: 0
├── name_loc: (1,0)-(1,6) = "coscup"
├── value:
│ @ CallNode (location: (1,7)-(1,11))
│ ├── flags: ∅
│ ├── receiver:
│ │ @ IntegerNode (location: (1,7)-(1,9))
│ │ └── flags: decimal
│ ├── call_operator_loc: ∅
│ ├── name: :+
│ ├── message_loc: (1,9)-(1,10) = "+"
│ ├── opening_loc: ∅
│ ├── arguments:
│ │ @ ArgumentsNode (location: (1,10)-(1,11))
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ IntegerNode (location: (1,10)-(1,11))
│ │ └── flags: decimal
coscup = 40 + 2