Age | Commit message (Collapse) | Author |
|
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
|
|
`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
|
|
https://github.com/ruby/prism/commit/665f533373
|
|
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
|
|
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`.
|
|
https://github.com/ruby/prism/commit/efdc2b7222
|
|
`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
|
|
https://github.com/ruby/prism/commit/1a8a0063dc
|
|
https://github.com/ruby/prism/commit/1ca58e0121
|
|
https://github.com/ruby/prism/commit/a7ab3a41c8
|
|
https://github.com/ruby/prism/commit/a735c2262f
|
|
https://github.com/ruby/prism/commit/dc070b44bc
|
|
https://github.com/ruby/prism/commit/5b2970e75b
|
|
https://github.com/ruby/prism/commit/2a583b041b
|
|
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
|
|
https://github.com/ruby/prism/commit/34ba70c4f9
|
|
https://github.com/ruby/prism/commit/05e0c6792c
|
|
https://github.com/ruby/prism/commit/5cf5f15ee7
|
|
https://github.com/ruby/prism/commit/f8b973e8cd
|
|
https://github.com/ruby/prism/commit/e23eae8266
|
|
https://github.com/ruby/prism/commit/5030917eb0
|
|
https://github.com/ruby/prism/commit/97a031e1d3
|
|
https://github.com/ruby/prism/commit/7f7840d318
|
|
https://github.com/ruby/prism/commit/716ee0e91a
|
|
https://github.com/ruby/prism/commit/a66d066162
|
|
https://github.com/ruby/prism/commit/3f59d07388
|
|
https://github.com/ruby/prism/commit/36a0b2e45a
|
|
https://github.com/ruby/prism/commit/76cf29e68d
|
|
https://github.com/ruby/prism/commit/0c008fcf34
|
|
translation
https://github.com/ruby/prism/commit/1729e8aec0
|
|
https://github.com/ruby/prism/commit/b607e3a98d
|
|
https://github.com/ruby/prism/commit/a35eadce47
|
|
https://github.com/ruby/prism/commit/37db4d8c2d
|
|
https://github.com/ruby/prism/commit/e0a836ebc2
|
|
https://github.com/ruby/prism/commit/99eca8b1d2
|
|
https://github.com/ruby/prism/commit/6019342278
|
|
https://github.com/ruby/prism/commit/240bb08c2c
|
|
https://github.com/ruby/prism/commit/8331874218
|
|
https://github.com/ruby/prism/commit/cf21c08c0b
|
|
https://github.com/ruby/prism/commit/dc74428e2e
|
|
https://github.com/ruby/prism/commit/4e7733491f
|
|
https://github.com/ruby/prism/commit/972fe60aea
|
|
https://github.com/ruby/prism/commit/fe10b5f49f
|
|
https://github.com/ruby/prism/commit/4639803277
|
|
https://github.com/ruby/prism/commit/f315bdb45d
|
|
https://github.com/ruby/prism/commit/06a89c3540
|
|
https://github.com/ruby/prism/commit/64e8190da0
|
|
https://github.com/ruby/prism/commit/6088ca1152
|
|
https://github.com/ruby/prism/commit/81feef447a
|
|
https://github.com/ruby/prism/commit/1f16df1f9e
|