-
Notifications
You must be signed in to change notification settings - Fork 174
Closed
Description
For Defnode of an incomplete code def f; 123, end_keyword changed from '' to '; 123' in v1.8.0.
For BlockNode of an incomplete code tap do |i|, closingchanged from '' to ' |i|'
irb(main):070> Prism.parse("def f; 123").value.statements.body[0]
=>
@ DefNode (location: (1,0)-(1,10))
├── flags: newline
├── name: :f
├── name_loc: (1,4)-(1,5) = "f"
├── receiver: ∅
├── parameters: ∅
├── body:
│ @ StatementsNode (location: (1,7)-(1,10))
│ ├── flags: ∅
│ └── body: (length: 2)
│ ├── @ IntegerNode (location: (1,7)-(1,10))
│ │ ├── flags: newline, static_literal, decimal
│ │ └── value: 123
│ └── @ MissingNode (location: (1,10)-(1,10))
│ └── flags: newline
├── locals: []
├── def_keyword_loc: (1,0)-(1,3) = "def"
├── operator_loc: ∅
├── lparen_loc: ∅
├── rparen_loc: ∅
├── equal_loc: ∅
└── end_keyword_loc: (1,3)-(1,10) = " f; 123" # (1,10)-(1,10) = "" in v1.7.0Background:
I was using node.closing.empty? to check if the node has closing token in IRB's indent calculation pull request.
Metadata
Metadata
Assignees
Labels
No labels