summaryrefslogtreecommitdiff
path: root/lib/prism
AgeCommit message (Collapse)Author
2024-03-12[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for beginless range: ## Parser gem (Expected) Returns `tBDOT2` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "..42"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [[:tBDOT2, ["..", #<Parser::Source::Range example.rb 0...2>]], [:tINTEGER, [42, #<Parser::Source::Range example.rb 2...4>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tDOT2` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "..42"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [[:tDOT2, ["..", #<Parser::Source::Range example.rb 0...2>]], [:tINTEGER, [42, #<Parser::Source::Range example.rb 2...4>]]] ``` After the update, the parser now returns `tBDOT2` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "..42"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [[:tBDOT2, ["..", #<Parser::Source::Range example.rb 0...2>]], [:tINTEGER, [42, #<Parser::Source::Range example.rb 2...4>]]] ``` This correction enables the restoration of `endless_range_in_conditional.txt` as a test case. https://github.com/ruby/prism/commit/f624b99ab0
2024-03-12[ruby/prism] Fix an AST and token incompatibility for ↵Koichi ITO
`Prism::Translation::Parser` Fixes https://github.com/ruby/prism/pull/2515. This PR fixes an AST and token incompatibility between Parser gem and `Prism::Translation::Parser` for string literal with line breaks. https://github.com/ruby/prism/commit/c58466e5bf
2024-03-11[ruby/prism] Support offsetKevin Newton
https://github.com/ruby/prism/commit/665f533373
2024-03-08[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser`Koichi ITO
Fixes https://github.com/ruby/prism/pull/2512. This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for `HEREDOC_END` with a newline. https://github.com/ruby/prism/commit/b67d1e0c6f
2024-03-08Fix an error for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes the following error for `Prism::Translation::Parser::Lexer` on the main branch: ```console $ cat example.rb 'a' # aあ " #{x} " $ bundle exec rubocop Parser::Source::Range: end_pos must not be less than begin_pos /Users/koic/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/parser-3.3.0.5/lib/parser/source/range.rb:39:in `initialize' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser/lexer.rb:299:in `new' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser/lexer.rb:299:in `block in to_a' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser/lexer.rb:297:in `map' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser/lexer.rb:297:in `to_a' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:263:in `build_tokens' /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:92:in `tokenize' ``` This change was made in https://github.com/ruby/prism/pull/2557, and it seems there was an inconsistency in Range due to forgetting to apply `offset_cache` to `start_offset`.
2024-03-07[ruby/prism] Support parsing streamsKevin Newton
https://github.com/ruby/prism/commit/efdc2b7222
2024-03-07[ruby/prism] Fix an AST and token incompatibility for ↵Koichi ITO
`Prism::Translation::Parser` Fixes https://github.com/ruby/prism/pull/2506. This PR fixes an AST and token incompatibility between Parser gem and `Prism::Translation::Parser` for symbols quoted with line breaks. https://github.com/ruby/prism/commit/06ab4df8cd
2024-03-06[ruby/prism] Use the diagnostic types in the parser translation layerKevin Newton
https://github.com/ruby/prism/commit/1a8a0063dc
2024-03-06[ruby/prism] Dispatch on_tlambda and on_tlambegKevin Newton
https://github.com/ruby/prism/commit/1ca58e0121
2024-03-06[ruby/prism] Use the diagnostic types in the ripper translation layerKevin Newton
https://github.com/ruby/prism/commit/a7ab3a41c8
2024-03-06[ruby/prism] Expose types on diagnosticsKevin Newton
https://github.com/ruby/prism/commit/a735c2262f
2024-03-06[ruby/prism] Fix parsing errors for `:!@` and `:~@` in SorbetUfuk Kayserilioglu
https://github.com/ruby/prism/commit/dc070b44bc
2024-03-06[ruby/prism] Small changes to make type-checking passUfuk Kayserilioglu
https://github.com/ruby/prism/commit/5b2970e75b
2024-03-06[ruby/prism] Move polyfill to separate file to type-check it independently.Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/2a583b041b
2024-03-06[ruby/prism] Fix some type-checking errors by using different method callsUfuk Kayserilioglu
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
2024-03-06[ruby/prism] Update ripper documentationKevin Newton
https://github.com/ruby/prism/commit/34ba70c4f9
2024-03-06[ruby/prism] Fix implicit local variables in hashesKevin Newton
https://github.com/ruby/prism/commit/05e0c6792c
2024-03-06[ruby/prism] Fix up linting in ripper translationKevin Newton
https://github.com/ruby/prism/commit/5cf5f15ee7
2024-03-06[ruby/prism] Only run ripper tests on 3.3+Kevin Newton
https://github.com/ruby/prism/commit/f8b973e8cd
2024-03-06[ruby/prism] Emit bounds for heredocs and words_sep in ripper translationKevin Newton
https://github.com/ruby/prism/commit/e23eae8266
2024-03-06[ruby/prism] Better factoring for heredocs in ripper translationKevin Newton
https://github.com/ruby/prism/commit/5030917eb0
2024-03-06[ruby/prism] More closely mirror on_heredoc_dedent API for ripper translationKevin Newton
https://github.com/ruby/prism/commit/97a031e1d3
2024-03-06[ruby/prism] Stop relying on ripper entirely in ripper translationKevin Newton
https://github.com/ruby/prism/commit/7f7840d318
2024-03-06[ruby/prism] More closely match the ripper API for ripper translationKevin Newton
https://github.com/ruby/prism/commit/716ee0e91a
2024-03-06[ruby/prism] Simplify ripper tests in ripper translationKevin Newton
https://github.com/ruby/prism/commit/a66d066162
2024-03-06[ruby/prism] Stop looking at generated tree in ripper translationKevin Newton
https://github.com/ruby/prism/commit/3f59d07388
2024-03-06[ruby/prism] Better handle splats in MRHS in rescues in ripper translationKevin Newton
https://github.com/ruby/prism/commit/36a0b2e45a
2024-03-06[ruby/prism] Handle single splat in rescue in ripper translationKevin Newton
https://github.com/ruby/prism/commit/76cf29e68d
2024-03-06[ruby/prism] Support elsif in ripper translationKevin Newton
https://github.com/ruby/prism/commit/0c008fcf34
2024-03-06[ruby/prism] Correctly detect void stmts in classes and modules in ripper ↵Kevin Newton
translation https://github.com/ruby/prism/commit/1729e8aec0
2024-03-06[ruby/prism] Handle empty programs in ripper translationKevin Newton
https://github.com/ruby/prism/commit/b607e3a98d
2024-03-06[ruby/prism] Fix up blocks for index nodes in ripper translationKevin Newton
https://github.com/ruby/prism/commit/a35eadce47
2024-03-06[ruby/prism] Allow rescue modifier after MRHS in ripper translationKevin Newton
https://github.com/ruby/prism/commit/37db4d8c2d
2024-03-06[ruby/prism] Handle empty parentheses in lambda in ripper translationKevin Newton
https://github.com/ruby/prism/commit/e0a836ebc2
2024-03-06[ruby/prism] Handle empty embedded expressions in ripper translationKevin Newton
https://github.com/ruby/prism/commit/99eca8b1d2
2024-03-06[ruby/prism] Implement string concat for ripper translationKevin Newton
https://github.com/ruby/prism/commit/6019342278
2024-03-06[ruby/prism] Share argument logic with calls and keywords in ripper translationKevin Newton
https://github.com/ruby/prism/commit/240bb08c2c
2024-03-06[ruby/prism] Better handle splat in MRHSKevin Newton
https://github.com/ruby/prism/commit/8331874218
2024-03-06[ruby/prism] Handle numbered parameters in ripper translationKevin Newton
https://github.com/ruby/prism/commit/cf21c08c0b
2024-03-06[ruby/prism] Disallow keywords as method names in ripper translationKevin Newton
https://github.com/ruby/prism/commit/dc74428e2e
2024-03-06[ruby/prism] Split up multi target visits for methods in ripper translationKevin Newton
https://github.com/ruby/prism/commit/4e7733491f
2024-03-06[ruby/prism] Better split between fcall and command for ripper translationKevin Newton
https://github.com/ruby/prism/commit/972fe60aea
2024-03-06[ruby/prism] Handle trailing commas in method calls for ripper translationKevin Newton
https://github.com/ruby/prism/commit/fe10b5f49f
2024-03-06[ruby/prism] Better handle hash pattern in ripper translationKevin Newton
https://github.com/ruby/prism/commit/4639803277
2024-03-06[ruby/prism] Share argument handling in super nodes in ripper translationKevin Newton
https://github.com/ruby/prism/commit/f315bdb45d
2024-03-06[ruby/prism] Fix up method naming in ripper translationKevin Newton
https://github.com/ruby/prism/commit/06a89c3540
2024-03-06[ruby/prism] Fix up symbols that look like cvar/ivar/gvar in ripper translationKevin Newton
https://github.com/ruby/prism/commit/64e8190da0
2024-03-06[ruby/prism] Handle MRHS in ripper translationKevin Newton
https://github.com/ruby/prism/commit/6088ca1152
2024-03-06[ruby/prism] Fix up block arguments node for ripper translationKevin Newton
https://github.com/ruby/prism/commit/81feef447a
2024-03-06[ruby/prism] Fix up MLHS posts in ripper translationKevin Newton
https://github.com/ruby/prism/commit/1f16df1f9e