diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/prism/fixtures/range_beginless.txt | 5 | ||||
| -rw-r--r-- | test/prism/snapshots/range_beginless.txt | 114 |
2 files changed, 119 insertions, 0 deletions
diff --git a/test/prism/fixtures/range_beginless.txt b/test/prism/fixtures/range_beginless.txt new file mode 100644 index 0000000000..a55b9b57e7 --- /dev/null +++ b/test/prism/fixtures/range_beginless.txt @@ -0,0 +1,5 @@ +def f(x = ...?a); end + +def f(x: ...?a); end + +def f() ...:a; end diff --git a/test/prism/snapshots/range_beginless.txt b/test/prism/snapshots/range_beginless.txt new file mode 100644 index 0000000000..800f087dc1 --- /dev/null +++ b/test/prism/snapshots/range_beginless.txt @@ -0,0 +1,114 @@ +@ ProgramNode (location: (1,0)-(5,18)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,18)) + ├── flags: ∅ + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(1,21)) + │ ├── flags: newline + │ ├── name: :f + │ ├── name_loc: (1,4)-(1,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,6)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (1,6)-(1,7) = "x" + │ │ │ ├── operator_loc: (1,8)-(1,9) = "=" + │ │ │ └── value: + │ │ │ @ RangeNode (location: (1,10)-(1,15)) + │ │ │ ├── flags: exclude_end + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ StringNode (location: (1,13)-(1,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,13)-(1,14) = "?" + │ │ │ │ ├── content_loc: (1,14)-(1,15) = "a" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "a" + │ │ │ └── operator_loc: (1,10)-(1,13) = "..." + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ ├── rparen_loc: (1,15)-(1,16) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,18)-(1,21) = "end" + ├── @ DefNode (location: (3,0)-(3,20)) + │ ├── flags: newline + │ ├── name: :f + │ ├── name_loc: (3,4)-(3,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (3,6)-(3,14)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (3,6)-(3,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ ├── name_loc: (3,6)-(3,8) = "x:" + │ │ │ └── value: + │ │ │ @ RangeNode (location: (3,9)-(3,14)) + │ │ │ ├── flags: exclude_end + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ StringNode (location: (3,12)-(3,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (3,12)-(3,13) = "?" + │ │ │ │ ├── content_loc: (3,13)-(3,14) = "a" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "a" + │ │ │ └── operator_loc: (3,9)-(3,12) = "..." + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (3,5)-(3,6) = "(" + │ ├── rparen_loc: (3,14)-(3,15) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,17)-(3,20) = "end" + └── @ DefNode (location: (5,0)-(5,18)) + ├── flags: newline + ├── name: :f + ├── name_loc: (5,4)-(5,5) = "f" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (5,8)-(5,13)) + │ ├── flags: ∅ + │ └── body: (length: 1) + │ └── @ RangeNode (location: (5,8)-(5,13)) + │ ├── flags: newline, exclude_end + │ ├── left: ∅ + │ ├── right: + │ │ @ SymbolNode (location: (5,11)-(5,13)) + │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ ├── opening_loc: (5,11)-(5,12) = ":" + │ │ ├── value_loc: (5,12)-(5,13) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ └── operator_loc: (5,8)-(5,11) = "..." + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (5,5)-(5,6) = "(" + ├── rparen_loc: (5,6)-(5,7) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (5,15)-(5,18) = "end" |
