summaryrefslogtreecommitdiff
path: root/prism
AgeCommit message (Collapse)Author
2024-02-13[ruby/prism] Introduce `version: "3.4.0"`Kevin Newton
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
2024-02-13[ruby/prism] Fix an error when specifying the parsing version `latest`Koichi ITO
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
2024-02-12[ruby/prism] Fix typo in class variable name errorKevin Newton
https://github.com/ruby/prism/commit/5f6c45f6fb
2024-02-12[ruby/prism] Error messages closer to CRubyKevin Newton
https://github.com/ruby/prism/commit/19ffa0b980
2024-02-12[ruby/prism] Fix unary not locationKevin Newton
https://github.com/ruby/prism/commit/861689f6d1
2024-02-12[ruby/prism] Unary not name locationKevin Newton
https://github.com/ruby/prism/commit/78190d2999
2024-02-08[PRISM] Support the DATA constantKevin Newton
2024-02-08[PRISM] Compile constant reads using opt_getconstant_pathKevin Newton
2024-02-07Bump prism versionKevin Newton
2024-02-07[ruby/prism] Support for Ruby 2.7Kevin Newton
https://github.com/ruby/prism/commit/1a15b70a8e
2024-02-06[ruby/prism] Implement file parsing error handlingeileencodes
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
2024-02-06[ruby/prism] Better invalid token messagesKevin Newton
https://github.com/ruby/prism/commit/8c9bed2a4d
2024-02-05[ruby/prism] Change the location of an implicit begin to methodKevin Newton
https://github.com/ruby/prism/commit/d08e140859
2024-02-05[ruby/prism] Add another error type for raising argument errorsKevin Newton
https://github.com/ruby/prism/commit/f3030cb2b2
2024-02-05Sync to latest prismKevin Newton
2024-02-02[ruby/prism] Provide APIs for finding value in constant poolKevin Newton
https://github.com/ruby/prism/commit/be9e2abfa3
2024-02-02[ruby/prism] Handle missing begin bodyKevin Newton
https://github.com/ruby/prism/commit/7e54818b17
2024-02-02[ruby/prism] Fix up multibyte escapesKevin Newton
https://github.com/ruby/prism/commit/836a35f4af
2024-02-02[ruby/prism] Fix overlapping memcpyAlan Wu
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
2024-02-01[ruby/prism] Amend assert in pm_utf_8_codepoint(), n=0 is fineAlan Wu
This assert used to trip in the included test: ``` ./miniruby --parser=prism -e ' "%W"\u" ' ``` https://github.com/ruby/prism/commit/8c0f84db4f
2024-02-01[PRISM] Emit parse warningsKevin Newton
2024-02-01[ruby/prism] Add parentheses around macro argumentsJenny Shen
https://github.com/ruby/prism/commit/f81fe9c716 Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2024-02-01[ruby/prism] Reject operator writes on operator methodsKevin Newton
https://github.com/ruby/prism/commit/78bd142e71
2024-02-01Sync to latest prismKevin Newton
2024-02-01[ruby/prism] Remove locals_body_indexKevin Newton
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
2024-02-01[ruby/prism] Check literals for receiverHaldun Bayhantopcu
https://github.com/ruby/prism/commit/56441b08e7
2024-02-01[ruby/prism] Only warn for unary + on spcargKevin Newton
https://github.com/ruby/prism/commit/db0e5ce1ce
2024-01-31[ruby/prism] Always return the character width for ↵Benoit Daloze
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
2024-01-31[ruby/prism] Fix description of line parsing option and state it's 1-indexedAndrew Konchin
https://github.com/ruby/prism/commit/b2d2b91222
2024-01-30Update forwarding locals for prismAaron Patterson
2024-01-30[ruby/prism] Better error messages for unexpected tokens in prefixKevin Newton
https://github.com/ruby/prism/commit/a35b8e45ee
2024-01-29[ruby/prism] Fix binding power for modifier rescueKevin Newton
https://github.com/ruby/prism/commit/f614863d79
2024-01-27[ruby/prism] Error follow-upKevin Newton
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>
2024-01-26[ruby/prism] Add level to warnings and errors to categorize themBenoit Daloze
* Fixes https://github.com/ruby/prism/issues/2082 https://github.com/ruby/prism/commit/7a74576357
2024-01-26[ruby/prism] Symbol encoding follow-upKevin Newton
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
2024-01-26[ruby/prism] Track whether a Symbol should have its encoding changed from ↵Kevin Menard
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
2024-01-26[ruby/prism] Update src/prism.cKevin Newton
https://github.com/ruby/prism/commit/91b5550726
2024-01-26[ruby/prism] Fix multiple assigns with newlinesHaldun Bayhantopcu
https://github.com/ruby/prism/commit/b4ba41bdcd
2024-01-26[ruby/prism] Fix parsing calls with labelsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/3db7849a31
2024-01-26[ruby/prism] Change binding power for modifiers in case-in nodesMax Prokopiev
https://github.com/ruby/prism/commit/c31eeba54c
2024-01-25[ruby/prism] Fix Ruby head buildKevin Newton
https://github.com/ruby/prism/commit/149e2ff7f6
2024-01-24[ruby/prism] Force encoding during deserialization of constantsMax Prokopiev
otherwise we get failing tests if we have non-ascii characters in fixtures/**/*.txt https://github.com/ruby/prism/commit/9323243569
2024-01-24[ruby/prism] Use char_is_identifier_start() to check for valid method nameMax Prokopiev
alnum_char() only checks for alphanumeric characters while ignoring other valid cases (like emoji codepoints for example) https://github.com/ruby/prism/commit/d15958fd28
2024-01-24[ruby/prism] Add an implicit node for the target of a hash patternKevin Newton
This simplifies compiling it, since you can now compile the value as if it were always there. https://github.com/ruby/prism/commit/bcfc74aacb
2024-01-22[ruby/prism] Static literal flag for string hash keysKevin Newton
https://github.com/ruby/prism/commit/26a2d774cd
2024-01-22[ruby/prism] Return 1-indexed line numbersKevin Newton
https://github.com/ruby/prism/commit/ad17f58729
2024-01-22[ruby/prism] Unescape method name for unary methods.Matt Valentine-House
https://github.com/ruby/prism/commit/4386a4c0da
2024-01-19[PRISM] Sync to latestKevin Newton
2024-01-19* remove trailing spaces. [ci skip]git
2024-01-19[ruby/prism] Parsing rules documentKevin Newton
https://github.com/ruby/prism/commit/57a9575543