[ruby/prism] Fix lexing of foo!
when it's a first thing to parse
https://github.com/ruby/prism/commit/7597aca76a
This commit is contained in:
parent
fbc29ce032
commit
f012ce0d18
@ -289,7 +289,7 @@ module Prism
|
|||||||
index += 1
|
index += 1
|
||||||
end
|
end
|
||||||
when :tFID
|
when :tFID
|
||||||
if tokens[-1][0] == :kDEF
|
if !tokens.empty? && tokens[-1][0] == :kDEF
|
||||||
type = :tIDENTIFIER
|
type = :tIDENTIFIER
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
1
test/prism/fixtures/single_method_call_with_bang.txt
Normal file
1
test/prism/fixtures/single_method_call_with_bang.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
foo!
|
15
test/prism/snapshots/single_method_call_with_bang.txt
Normal file
15
test/prism/snapshots/single_method_call_with_bang.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@ ProgramNode (location: (1,0)-(1,4))
|
||||||
|
├── locals: []
|
||||||
|
└── statements:
|
||||||
|
@ StatementsNode (location: (1,0)-(1,4))
|
||||||
|
└── body: (length: 1)
|
||||||
|
└── @ CallNode (location: (1,0)-(1,4))
|
||||||
|
├── flags: ignore_visibility
|
||||||
|
├── receiver: ∅
|
||||||
|
├── call_operator_loc: ∅
|
||||||
|
├── name: :foo!
|
||||||
|
├── message_loc: (1,0)-(1,4) = "foo!"
|
||||||
|
├── opening_loc: ∅
|
||||||
|
├── arguments: ∅
|
||||||
|
├── closing_loc: ∅
|
||||||
|
└── block: ∅
|
Loading…
x
Reference in New Issue
Block a user