* add bin/prism ripper to compare Ripper output
* block arg handling is quirky, do it per-call-site
* block required params
* boolean values
* various assign-operator support
* breaks, early fragile begin/rescue/end
* more fixtures being checked
https://github.com/ruby/prism/commit/31732cb720
This PR implements proper file parsing error handling. Previously
`file_options` would call `pm_string_mapped_init` which would print an
error from `perror`. However this wouldn't raise a proper Ruby error so
it was just a string output. I've done the following:
- Raise an error from `rb_syserr_fail` with the filepath in
`file_options`.
- No longer return `Qnil` if `file_options` returns false (because now
it will raise)
- Update `file_options` to return `static void` instead of `static
bool`.
- Update `file_options` and `profile_file` to check the type so when
passing `nil` we see a `TypeError`.
- Delete `perror` from `pm_string_mapped_init`
- Update `FFI` backend to raise appropriate errors when calling
`pm_string_mapped_init`.
- Add tests for `dump_file`, `lex_file`, `parse_file`,
`parse_file_comments`, `parse_lex_file`, and `parse_file_success?`
when a file doesn't exist and for `nil`.
- Updates the `bin/parse` script to no longer raise it's own
`ArgumentError` now that we raise a proper error.
Fixes: ruby/prism#2207https://github.com/ruby/prism/commit/b2f7494ff5
We're not using this anymore, and it doesn't make a lot of sense
outside the context of a compiler anyway, and in anyway it's wrong
when you have local variables written in default values.
https://github.com/ruby/prism/commit/5edbd9c25b
Split up the diagnostic levels so that error and warning levels
aren't mixed. Also fix up deconstruct_keys implementation.
https://github.com/ruby/prism/commit/bd3eeb308d
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
Ensure we don't accidentally parse the symbol encoding twice, and
ensure we parse it in every circumstance we need to by requiring
it as a parameter.
https://github.com/ruby/prism/commit/9cea31c785
Ruby sets a Symbol literal's encoding to US-ASCII if the symbols consists only of US ASCII code points. Character escapes can also lead a Symbol to have a different encoding than its source's encoding.
https://github.com/ruby/prism/commit/f315660b31
This allows ... argument forwarding to benefit from Allocationless
Anonymous Splat Forwarding, allowing the `f` call below to not
allocate an array or a hash.
```ruby
a = [1]
kw = {b: 2}
def c(a, b:)
end
def f(...)
c(...)
end
f(*a, **kw)
```
This temporarily skips prism locals tests until prism is changed
to use * and ** for ..., instead of using ruby2_keywords.
Ignore failures in rbs bundled gems tests, since they fail due
to this change.