diff options
author | Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com> | 2024-03-06 14:34:04 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-03-06 21:37:52 +0000 |
commit | 8dfe0c7c28fcaff1d52ab7f2751188f2e89b2347 (patch) | |
tree | 5f28a98a0e9351d1ce7a3200859118d869375d31 /lib/prism/translation/parser | |
parent | ddc81ee3f996308482bc566c3048c5965f608ad0 (diff) |
[ruby/prism] Fix some type-checking errors by using different method calls
For example, use `.fetch` or `.dig` instead of `[]`, and use `===` instead of `is_a?` for checking types of objects.
https://github.com/ruby/prism/commit/548b54915f
Diffstat (limited to 'lib/prism/translation/parser')
-rw-r--r-- | lib/prism/translation/parser/lexer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index b710b1981b..bc7e77f291 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -302,7 +302,7 @@ module Prism index += 1 end when :tFID - if !tokens.empty? && tokens[-1][0] == :kDEF + if !tokens.empty? && tokens.dig(-1, 0) == :kDEF type = :tIDENTIFIER end end |