Skip to content

Commit

Permalink
Ignore the parser translator lexer for sorbet
Browse files Browse the repository at this point in the history
The whole while switch/case construct makes typechecking difficult because
sorbet does not recognize that outside variables
may change their value in individual switches.
  • Loading branch information
Earlopain committed Jan 11, 2025
1 parent 2e1b926 commit 2bcc494
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prism/translation/parser/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def to_a
index = 0
length = lexed.length

heredoc_stack = Array.new
quote_stack = Array.new
heredoc_stack = []
quote_stack = []

# The parser gem emits the newline tokens for comments out of order. This saves
# that token location to emit at a later time to properly line everything up.
Expand Down
1 change: 1 addition & 0 deletions rakelib/typecheck.rake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace :typecheck do
- ./lib/prism/node_ext.rb
- ./lib/prism/parse_result.rb
- ./lib/prism/visitor.rb
- ./lib/prism/translation/parser/lexer.rb
- ./lib/prism/translation/ripper.rb
- ./lib/prism/translation/ripper/sexp.rb
- ./lib/prism/translation/ruby_parser.rb
Expand Down

0 comments on commit 2bcc494

Please sign in to comment.