| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/prism/commit/81e07f3cdb
|
|
Closes https://github.com/ruby/prism/issues/4112
Also see https://github.com/ruby/prism/issues/2501, for which this was done.
The expectation in rubocop is incorrect (produces code with semantic difference), so the test should be updated instead.
In any way, it should also have applied to `+`, where the same happens
https://github.com/ruby/prism/commit/1f8cae2a75
|
|
Followup for https://bugs.ruby-lang.org/issues/20409
|
|
translator
When no magic encoding comment is present, it does not default to utf-8,
and takes the encoding of the string that contains the source code instead.
Most of the time that will be utf-8, but not always.
https://github.com/ruby/prism/commit/1a273db780
|
|
utf-8 is the default for source files but can be overwritten via options
https://github.com/ruby/prism/commit/355f451528
|
|
(https://github.com/ruby/prism/pull/4098)
https://github.com/ruby/prism/commit/442bd904ed
|
|
For [Bug #20409]
https://github.com/ruby/prism/commit/4848eb344e
|
|
It is emitted for string-like symbols only
https://github.com/ruby/prism/commit/6d63302c7b
|
|
It was mostly good, just a few edgecases:
* word_sep always only contains a single line. if there are multiple lines, it is also multiple word_sep
* Handle trailing whitespace
The excluded testcase is interpolation mixed with heredoc.
That is not currently handled properly and word_sep contains
the content of the heredoc
I also switched start/end_offset names in the method, they seem to be backwards
https://github.com/ruby/prism/commit/2e151ad41b
|
|
Drops the check against order. Very often ripper emits events in a order
that is not easy to mimic. It's only getting worse now that most events are implemented.
Perhaps the test can be brought back at a later time. For now, I used it while making this commit
but adding all these exceptions makes not much sense.
It already was a pretty long list.
https://github.com/ruby/prism/commit/f43299a18b
|
|
Same handling as for `yield`. Fixes [Bug #21988]
https://github.com/ruby/prism/commit/2dd20183ad
|
|
Mostly the same as for `on_kw`.
Stop comparing order for a handful of events. They are emitted by ripper in a order that is
not easy for prism to replicate. For example in`foo, bar, baz = 123`, `op` for `=` is emitted
before the last mass assign identifier (so `foo`, `bar`, `=`, `baz`.
I don't want to replicate that if I don't have to. Same for `::` in `A::B = 123` etc.
https://github.com/ruby/prism/commit/4d88aed5e9
|
|
No need to list them all out anymore, it's just a single possibility now
https://github.com/ruby/prism/commit/893f2734cb
|
|
`yard` uses it
Start checking against the ordering of the events and also their location.
I didn't fix any of the preexisting failures and just ignored them. Some are easy to fix, others look like particularities of ripper
that I don't think anyone would rely on.
https://github.com/ruby/prism/commit/4cba29d282
|
|
https://github.com/ruby/prism/commit/5bb64a246d
|
|
In `ripper`, both go through the same converion logic.
Needed for rspec, no other failures in their own tests
https://github.com/ruby/prism/commit/510258aa2b
|
|
`tstring_beg` in particular is needed by `yard`.
Before:
> 1980 examples, 606 failures, 15 pending
After:
> 1980 examples, 582 failures, 15 pending
Thought it would be more, but oh well. It needs `on_sp` which I guess is why there are not many new passes
https://github.com/ruby/prism/commit/e1b18cb582
|
|
We still need to do it eagerly when the result will be frozen, same
as for locations.
Fixes the following error for the added test:
> FrozenError: can't modify frozen Prism::ASCIISource: #<Prism::ASCIISource:0x00007ff9d57586f0 @source="1 + 2", @start_line=1, @offsets="\x00\x00\x00\x00">
https://github.com/ruby/prism/commit/0667d23f4f
|
|
https://github.com/ruby/prism/commit/31c71e7a40
|
|
|
|
They may not be part of `on_param` but ripper still calls `on_ident` for them
https://github.com/ruby/prism/commit/fb5303f2b8
|
|
`::X &&= 1` for example emitted `on_int` twice
https://github.com/ruby/prism/commit/44d064c2bc
|
|
https://github.com/ruby/prism/commit/894f395449
|
|
Currently there is just one very basic one.
https://github.com/ruby/prism/commit/5a184b8085
|
|
Take a method, unbound method, proc, or thread backtrace location.
This is our equivalent to RubyVM::AbstractSyntaxTree.of, and could
be leveraged in something like error highlight.
Note that this uses CRuby-specific APIs on CRuby, and falls back
to using location-based APIs when those aren't available.
https://github.com/ruby/prism/commit/02a93356a3
|
|
|
|
https://github.com/ruby/prism/commit/2e58c52196
|
|
Move all the logic from prism.c into regexp.c. Now regexp.c does two passes. The first pass scans the raw source to track escape types, non-ASCII literals, and multibyte validity for encoding validation. The second pass scans the unescaped content for named capture extraction (needed because escape sequences like line continuations alter group names).
Fixed a couple of things along the way. ascii_only was previously computed from unescaped content, but we can do that as we go to avoid scanning again. Unicode properties also now properly error for regexp with modifiers.
https://github.com/ruby/prism/commit/0944c7fba2
|
|
https://github.com/ruby/prism/commit/fd0a20f8d8
|
|
https://github.com/ruby/prism/commit/c28810fe93
|
|
https://github.com/ruby/prism/commit/7d21e564ac
|
|
https://github.com/ruby/prism/commit/35470bb90d
|
|
Introduce PM_TOKEN_KEYWORD_DO_BLOCK to distinguish do-blocks on
command-style calls from regular `do` keywords. Add
parse_command_do_block to attach these blocks to call nodes. Track
in_endless_def_body to prevent do-block consumption inside endless
method definitions, allowing blocks to correctly bubble up to outer
contexts like `private def f = puts "Hello" do end`.
https://github.com/ruby/prism/commit/7d17fd254b
|
|
It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925
But it actually should be a plain method call.
`!`/`?` are not valid as part of an identifier, methods
however allow them as the last character.
Fixes [Bug #21946]
https://github.com/ruby/prism/commit/5d80bc5e1a
|
|
writes"
(https://github.com/ruby/prism/pull/3960)
This reverts commit https://github.com/ruby/prism/commit/4e71dbfc7bd9.
And also add a regression test. Seems like currently prism parses these the same that parse.y does.
https://github.com/ruby/prism/commit/03993421f2
|
|
[Bug #21713]
https://github.com/ruby/prism/commit/02c944c055
|
|
[Bug #21714]
https://github.com/ruby/prism/commit/0f47e18335
|
|
An API to determine if more input could fix the existing syntax errors.
https://github.com/ruby/prism/commit/6701ffe0f5
|
|
https://github.com/ruby/prism/commit/4e71dbfc7b
|
|
in is a unique keyword because it can be the start of a clause or
an infix keyword. We need to be explicitly sure that even though in
_could_ close an expression context (the body of another in clause)
that we are not also parsing an inline in. The exception is the
case of a command call, which can never be the LHS of an expression,
and so we must immediately exit.
[Bug #21925]
[Bug #21674]
https://github.com/ruby/prism/commit/20374ced51
|
|
They currently complain that the parent method is not forwarding.
But the actual problem is that these types of arguments simply don't
accept `...`
Fixes [Bug #21927]
https://github.com/ruby/prism/commit/0aa2363331
|
|
Closes https://github.com/ruby/prism/issues/3837
While these lines are whitespace only from a runtime perspective,
the line continuation is significant for AST consumers.
Sort of a followup to https://github.com/ruby/prism/commit/faab217d9382186133862ce4d5ba9a9e090a9550
https://github.com/ruby/prism/commit/a8a7c6b77d
|
|
https://github.com/ruby/prism/commit/b7e247ce6a
|
|
In ripper, compared to `**nil` it is not a new event
https://github.com/ruby/prism/commit/7f5782392e
|
|
https://github.com/ruby/prism/commit/e5fb0e192b
|
|
https://github.com/ruby/prism/commit/fb88c72dce
|
|
https://github.com/ruby/prism/commit/8aad2480ab
|
|
|
|
When we hit EOF and still have lex modes left, it means some content was unterminated.
Heredocs specifically have logic that needs to happen when the body finished lexing.
If we don't reset the mode back to how it was before, it will not continue lexing at the correct place.
Followup to https://github.com/ruby/prism/pull/3918.
We can't call into `parser_lex` since it resets token locations.
https://github.com/ruby/prism/commit/27c24fdc0d
|
|
This reverts commit https://github.com/ruby/prism/commit/8f35e8ef255b.
https://github.com/ruby/prism/commit/ed48f6dbfb
|