| Age | Commit message (Collapse) | Author |
|
This is effectively an alias for "latest" right now. In the future
it will change to be its own enum value.
https://github.com/ruby/prism/commit/2c86036022
|
|
This PR fixes following error when using `version: latest` argument.
```console
$ ruby -rprism -e "p Prism.parse('-> { it }', version: 'latest')"
-e:1:in `parse': invalid version: latest (ArgumentError)
p Prism.parse('-> { it }', version: 'latest')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from -e:1:in `<main>'
```
The argument `version: latest` in the added test is commented as potentially being
better replaced with `version: 3.4.0` in the future.
https://github.com/ruby/prism/commit/27b5c933cb
|
|
https://github.com/ruby/prism/commit/5f6c45f6fb
|
|
https://github.com/ruby/prism/commit/19ffa0b980
|
|
https://github.com/ruby/prism/commit/861689f6d1
|
|
https://github.com/ruby/prism/commit/78190d2999
|
|
|
|
|
|
|
|
https://github.com/ruby/prism/commit/1a15b70a8e
|
|
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#2207
https://github.com/ruby/prism/commit/b2f7494ff5
|
|
https://github.com/ruby/prism/commit/8c9bed2a4d
|
|
https://github.com/ruby/prism/commit/d08e140859
|
|
https://github.com/ruby/prism/commit/f3030cb2b2
|
|
|
|
https://github.com/ruby/prism/commit/be9e2abfa3
|
|
https://github.com/ruby/prism/commit/7e54818b17
|
|
https://github.com/ruby/prism/commit/836a35f4af
|
|
It's UB to use memcpy with overlapping source and destination. This
might be causing crashes on 32 bit platforms and on OpenBSD. Use memmove
instead. Add a bounds check while we're at it since it's unclear whether
one-past-end pointer with n=0 is UB.
https://github.com/ruby/prism/commit/719f54ff5e
|
|
This assert used to trip in the included test:
```
./miniruby --parser=prism -e ' "%W"\u" '
```
https://github.com/ruby/prism/commit/8c0f84db4f
|
|
|
|
https://github.com/ruby/prism/commit/f81fe9c716
Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
|
|
https://github.com/ruby/prism/commit/78bd142e71
|
|
|
|
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
|
|
https://github.com/ruby/prism/commit/56441b08e7
|
|
https://github.com/ruby/prism/commit/db0e5ce1ce
|
|
char_is_identifier_start() and char_is_identifier_utf8()
* This is also faster than calling pm_encoding_utf_8_alpha_char/pm_encoding_utf_8_alnum_char
as those compute the character width and do extra checks.
https://github.com/ruby/prism/commit/4cb276ac4c
|
|
https://github.com/ruby/prism/commit/b2d2b91222
|
|
|
|
https://github.com/ruby/prism/commit/a35b8e45ee
|
|
https://github.com/ruby/prism/commit/f614863d79
|
|
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>
|
|
* Fixes https://github.com/ruby/prism/issues/2082
https://github.com/ruby/prism/commit/7a74576357
|
|
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
|
|
the source encoding.
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
|
|
https://github.com/ruby/prism/commit/91b5550726
|
|
https://github.com/ruby/prism/commit/b4ba41bdcd
|
|
https://github.com/ruby/prism/commit/3db7849a31
|
|
https://github.com/ruby/prism/commit/c31eeba54c
|
|
https://github.com/ruby/prism/commit/149e2ff7f6
|
|
otherwise we get failing tests if we have non-ascii
characters in fixtures/**/*.txt
https://github.com/ruby/prism/commit/9323243569
|
|
alnum_char() only checks for alphanumeric characters while
ignoring other valid cases (like emoji codepoints for example)
https://github.com/ruby/prism/commit/d15958fd28
|
|
This simplifies compiling it, since you can now compile the value
as if it were always there.
https://github.com/ruby/prism/commit/bcfc74aacb
|
|
https://github.com/ruby/prism/commit/26a2d774cd
|
|
https://github.com/ruby/prism/commit/ad17f58729
|
|
https://github.com/ruby/prism/commit/4386a4c0da
|
|
|
|
|
|
https://github.com/ruby/prism/commit/57a9575543
|