mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 01:23:57 +02:00
parent
08c841ff63
commit
6cd3521519
13 changed files with 177 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
if ...bar; end
|
|
@ -0,0 +1 @@
|
|||
if foo...; end
|
|
@ -0,0 +1 @@
|
|||
if ..bar; end
|
|
@ -0,0 +1 @@
|
|||
if foo..; end
|
|
@ -0,0 +1 @@
|
|||
p { [_1 **2] }
|
3
test/prism/fixtures/whitequark/parser_bug_989.txt
Normal file
3
test/prism/fixtures/whitequark/parser_bug_989.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
<<-HERE
|
||||
content
|
||||
HERE
|
|
@ -84,6 +84,7 @@ module Prism
|
|||
whitequark/if_while_after_class__since_32.txt
|
||||
whitequark/lvar_injecting_match.txt
|
||||
whitequark/not.txt
|
||||
whitequark/numparam_ruby_bug_19025.txt
|
||||
whitequark/op_asgn_cmd.txt
|
||||
whitequark/parser_bug_640.txt
|
||||
whitequark/parser_slash_slash_n_escaping_in_literals.txt
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
@ ProgramNode (location: (1,0)-(1,14))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,0)-(1,14))
|
||||
└── body: (length: 1)
|
||||
└── @ IfNode (location: (1,0)-(1,14))
|
||||
├── if_keyword_loc: (1,0)-(1,2) = "if"
|
||||
├── predicate:
|
||||
│ @ FlipFlopNode (location: (1,3)-(1,9))
|
||||
│ ├── flags: exclude_end
|
||||
│ ├── left: ∅
|
||||
│ ├── right:
|
||||
│ │ @ CallNode (location: (1,6)-(1,9))
|
||||
│ │ ├── flags: variable_call, ignore_visibility
|
||||
│ │ ├── receiver: ∅
|
||||
│ │ ├── call_operator_loc: ∅
|
||||
│ │ ├── name: :bar
|
||||
│ │ ├── message_loc: (1,6)-(1,9) = "bar"
|
||||
│ │ ├── opening_loc: ∅
|
||||
│ │ ├── arguments: ∅
|
||||
│ │ ├── closing_loc: ∅
|
||||
│ │ └── block: ∅
|
||||
│ └── operator_loc: (1,3)-(1,6) = "..."
|
||||
├── then_keyword_loc: ∅
|
||||
├── statements: ∅
|
||||
├── consequent: ∅
|
||||
└── end_keyword_loc: (1,11)-(1,14) = "end"
|
|
@ -0,0 +1,27 @@
|
|||
@ ProgramNode (location: (1,0)-(1,14))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,0)-(1,14))
|
||||
└── body: (length: 1)
|
||||
└── @ IfNode (location: (1,0)-(1,14))
|
||||
├── if_keyword_loc: (1,0)-(1,2) = "if"
|
||||
├── predicate:
|
||||
│ @ FlipFlopNode (location: (1,3)-(1,9))
|
||||
│ ├── flags: exclude_end
|
||||
│ ├── left:
|
||||
│ │ @ CallNode (location: (1,3)-(1,6))
|
||||
│ │ ├── flags: variable_call, ignore_visibility
|
||||
│ │ ├── receiver: ∅
|
||||
│ │ ├── call_operator_loc: ∅
|
||||
│ │ ├── name: :foo
|
||||
│ │ ├── message_loc: (1,3)-(1,6) = "foo"
|
||||
│ │ ├── opening_loc: ∅
|
||||
│ │ ├── arguments: ∅
|
||||
│ │ ├── closing_loc: ∅
|
||||
│ │ └── block: ∅
|
||||
│ ├── right: ∅
|
||||
│ └── operator_loc: (1,6)-(1,9) = "..."
|
||||
├── then_keyword_loc: ∅
|
||||
├── statements: ∅
|
||||
├── consequent: ∅
|
||||
└── end_keyword_loc: (1,11)-(1,14) = "end"
|
|
@ -0,0 +1,27 @@
|
|||
@ ProgramNode (location: (1,0)-(1,13))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,0)-(1,13))
|
||||
└── body: (length: 1)
|
||||
└── @ IfNode (location: (1,0)-(1,13))
|
||||
├── if_keyword_loc: (1,0)-(1,2) = "if"
|
||||
├── predicate:
|
||||
│ @ FlipFlopNode (location: (1,3)-(1,8))
|
||||
│ ├── flags: ∅
|
||||
│ ├── left: ∅
|
||||
│ ├── right:
|
||||
│ │ @ CallNode (location: (1,5)-(1,8))
|
||||
│ │ ├── flags: variable_call, ignore_visibility
|
||||
│ │ ├── receiver: ∅
|
||||
│ │ ├── call_operator_loc: ∅
|
||||
│ │ ├── name: :bar
|
||||
│ │ ├── message_loc: (1,5)-(1,8) = "bar"
|
||||
│ │ ├── opening_loc: ∅
|
||||
│ │ ├── arguments: ∅
|
||||
│ │ ├── closing_loc: ∅
|
||||
│ │ └── block: ∅
|
||||
│ └── operator_loc: (1,3)-(1,5) = ".."
|
||||
├── then_keyword_loc: ∅
|
||||
├── statements: ∅
|
||||
├── consequent: ∅
|
||||
└── end_keyword_loc: (1,10)-(1,13) = "end"
|
|
@ -0,0 +1,27 @@
|
|||
@ ProgramNode (location: (1,0)-(1,13))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,0)-(1,13))
|
||||
└── body: (length: 1)
|
||||
└── @ IfNode (location: (1,0)-(1,13))
|
||||
├── if_keyword_loc: (1,0)-(1,2) = "if"
|
||||
├── predicate:
|
||||
│ @ FlipFlopNode (location: (1,3)-(1,8))
|
||||
│ ├── flags: ∅
|
||||
│ ├── left:
|
||||
│ │ @ CallNode (location: (1,3)-(1,6))
|
||||
│ │ ├── flags: variable_call, ignore_visibility
|
||||
│ │ ├── receiver: ∅
|
||||
│ │ ├── call_operator_loc: ∅
|
||||
│ │ ├── name: :foo
|
||||
│ │ ├── message_loc: (1,3)-(1,6) = "foo"
|
||||
│ │ ├── opening_loc: ∅
|
||||
│ │ ├── arguments: ∅
|
||||
│ │ ├── closing_loc: ∅
|
||||
│ │ └── block: ∅
|
||||
│ ├── right: ∅
|
||||
│ └── operator_loc: (1,6)-(1,8) = ".."
|
||||
├── then_keyword_loc: ∅
|
||||
├── statements: ∅
|
||||
├── consequent: ∅
|
||||
└── end_keyword_loc: (1,10)-(1,13) = "end"
|
49
test/prism/snapshots/whitequark/numparam_ruby_bug_19025.txt
Normal file
49
test/prism/snapshots/whitequark/numparam_ruby_bug_19025.txt
Normal file
|
@ -0,0 +1,49 @@
|
|||
@ ProgramNode (location: (1,0)-(1,14))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,0)-(1,14))
|
||||
└── body: (length: 1)
|
||||
└── @ CallNode (location: (1,0)-(1,14))
|
||||
├── flags: ignore_visibility
|
||||
├── receiver: ∅
|
||||
├── call_operator_loc: ∅
|
||||
├── name: :p
|
||||
├── message_loc: (1,0)-(1,1) = "p"
|
||||
├── opening_loc: ∅
|
||||
├── arguments: ∅
|
||||
├── closing_loc: ∅
|
||||
└── block:
|
||||
@ BlockNode (location: (1,2)-(1,14))
|
||||
├── locals: [:_1]
|
||||
├── parameters:
|
||||
│ @ NumberedParametersNode (location: (1,2)-(1,14))
|
||||
│ └── maximum: 1
|
||||
├── body:
|
||||
│ @ StatementsNode (location: (1,4)-(1,12))
|
||||
│ └── body: (length: 1)
|
||||
│ └── @ ArrayNode (location: (1,4)-(1,12))
|
||||
│ ├── flags: ∅
|
||||
│ ├── elements: (length: 1)
|
||||
│ │ └── @ CallNode (location: (1,5)-(1,11))
|
||||
│ │ ├── flags: ∅
|
||||
│ │ ├── receiver:
|
||||
│ │ │ @ LocalVariableReadNode (location: (1,5)-(1,7))
|
||||
│ │ │ ├── name: :_1
|
||||
│ │ │ └── depth: 0
|
||||
│ │ ├── call_operator_loc: ∅
|
||||
│ │ ├── name: :**
|
||||
│ │ ├── message_loc: (1,8)-(1,10) = "**"
|
||||
│ │ ├── opening_loc: ∅
|
||||
│ │ ├── arguments:
|
||||
│ │ │ @ ArgumentsNode (location: (1,10)-(1,11))
|
||||
│ │ │ ├── flags: ∅
|
||||
│ │ │ └── arguments: (length: 1)
|
||||
│ │ │ └── @ IntegerNode (location: (1,10)-(1,11))
|
||||
│ │ │ ├── flags: decimal
|
||||
│ │ │ └── value: 2
|
||||
│ │ ├── closing_loc: ∅
|
||||
│ │ └── block: ∅
|
||||
│ ├── opening_loc: (1,4)-(1,5) = "["
|
||||
│ └── closing_loc: (1,11)-(1,12) = "]"
|
||||
├── opening_loc: (1,2)-(1,3) = "{"
|
||||
└── closing_loc: (1,13)-(1,14) = "}"
|
11
test/prism/snapshots/whitequark/parser_bug_989.txt
Normal file
11
test/prism/snapshots/whitequark/parser_bug_989.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
@ ProgramNode (location: (1,1)-(1,8))
|
||||
├── locals: []
|
||||
└── statements:
|
||||
@ StatementsNode (location: (1,1)-(1,8))
|
||||
└── body: (length: 1)
|
||||
└── @ StringNode (location: (1,1)-(1,8))
|
||||
├── flags: ∅
|
||||
├── opening_loc: (1,1)-(1,8) = "<<-HERE"
|
||||
├── content_loc: (2,0)-(3,0) = "\t\tcontent\n"
|
||||
├── closing_loc: (3,0)-(4,0) = "\tHERE\n"
|
||||
└── unescaped: "\t\tcontent\n"
|
Loading…
Add table
Add a link
Reference in a new issue