summaryrefslogtreecommitdiff
path: root/lib/prism
AgeCommit message (Collapse)Author
2024-02-14[ruby/prism] Remove attr_writer's for ParseResult#start_line and #offsetsBenoit Daloze
* As the user should not set these. * Use #instance_variable_set/rb_iv_set() instead internally. https://github.com/ruby/prism/commit/cace09fb8c
2024-02-14[ruby/prism] Serialize the newline_list to avoid recomputing it again laterBenoit Daloze
* Fixes https://github.com/ruby/prism/issues/2380 https://github.com/ruby/prism/commit/4eaaa90114
2024-02-14[PRISM] Sync to latest prismKevin Newton
2024-02-13[ruby/prism] Add code unit APIs to locationKevin Newton
LSPs need this because the protocol dictates that you return code units for offsets. None of our existing APIs provided that information, and since we hid the source it's not nearly as useful for them. Now they can pass an encoding directly to: * Location#start_code_units_offset * Location#end_code_units_offset * Location#start_code_units_column * Location#end_code_units_column https://github.com/ruby/prism/commit/4757a2cc06 Co-Authored-By: Vinicius Stock <vinicius.stock@shopify.com>
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 `full_name` for constant path targetsVinicius Stock
https://github.com/ruby/prism/commit/84c10f3a2d
2024-02-12[ruby/prism] ruby_parser translatorKevin Newton
https://github.com/ruby/prism/commit/1925b970c7
2024-02-12[ruby/prism] Move Prism::RipperCompat to Prism::Translation::RipperNoah Gibbs
https://github.com/ruby/prism/commit/c0331abe4f
2024-02-09[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/2c53e017c1 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-09[ruby/prism] RipperCompat: add array-refs, assigns, symbols, stringsNoah Gibbs
https://github.com/ruby/prism/commit/b771c7f2ec
2024-02-09[ruby/prism] Significantly faster offset cache for parserKevin Newton
https://github.com/ruby/prism/commit/8cd92eef79
2024-02-08[ruby/prism] Looks like Symbol#name wasn't a thing in 2.7, so need to switch ↵Noah Gibbs
back to to_s https://github.com/ruby/prism/commit/0b90c9a398
2024-02-08[ruby/prism] Add Kevin's visit_all change and change the parent class to ↵Noah Gibbs
Compiler. https://github.com/ruby/prism/commit/bbdba3f42d Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/03addf2d3d Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/5eac08f699 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/8271ce5ec9 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/6e2bf9c8cd Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] Update lib/prism/ripper_compat.rbNoah Gibbs
https://github.com/ruby/prism/commit/bce0a5c916 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08[ruby/prism] RipperCompat: support for more features.Noah Gibbs
* 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
2024-02-07[ruby/prism] Dev-only CLIKevin Newton
We keep adding more scripts to /bin that are doing the same kinds of processing. Instead, this commit consolidates them all into a single CLI that shares the same logic so that we can consistently read files in the same way. It keeps around 2 binstubs for bin/lex and bin/parse since those are the most used and I'm sure people have built up muscle memory for those. Those scripts are now just wrappers for forwarding to bin/prism. https://github.com/ruby/prism/commit/bddcb9bf17
2024-02-07[ruby/prism] Commit Kevin's suggestion to simplify grabbing the operator.Noah Gibbs
https://github.com/ruby/prism/commit/874ba7a1f4 Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-07[ruby/prism] More different block-call syntaxes, support more types of ↵Noah Gibbs
method calls https://github.com/ruby/prism/commit/40cf114a24
2024-02-07[ruby/prism] Support &. calls and calling with blocks, test with fixturesNoah Gibbs
https://github.com/ruby/prism/commit/e346fa583a
2024-02-07[ruby/prism] RipperCompat: support more kinds of method calls and operators.Noah Gibbs
Add tests. Start parsing some simpler fixture code. https://github.com/ruby/prism/commit/997f4191d8
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-07[ruby/prism] Correct handle recover parameters on tokenize for parser ↵Kevin Newton
translation https://github.com/ruby/prism/commit/63979de21d
2024-02-07[ruby/prism] Even more ripper compatKevin Newton
https://github.com/ruby/prism/commit/47a602dc1c
2024-02-07[ruby/prism] More visitors and tests for RipperCompatNoah Gibbs
Part of issue #2354 https://github.com/ruby/prism/commit/cb28edae34
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-05Sync to latest prismKevin Newton
2024-02-02[ruby/prism] Fix hash pairs in patternsKevin Newton
https://github.com/ruby/prism/commit/b7ab29daa0
2024-02-02[ruby/prism] Small fixes for the parser translatorKevin Newton
https://github.com/ruby/prism/commit/4327051c86
2024-02-01Sync to latest prismKevin Newton
2024-01-30[ruby/prism] Fix up CIKevin Newton
https://github.com/ruby/prism/commit/224ea85565
2024-01-30Update forwarding locals for prismAaron Patterson
2024-01-29[ruby/prism] Raise diagnostics for parserKevin Newton
https://github.com/ruby/prism/commit/102b4a16f5
2024-01-28[ruby/prism] Handle implicit rest in array pattern for parser gemKevin Newton
https://github.com/ruby/prism/commit/d3722d6660
2024-01-27[ruby/prism] Add parser translationKevin Newton
https://github.com/ruby/prism/commit/8cdec8070c
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-27[ruby/prism] Call #inspect on diagnostic levelsBenoit Daloze
* So it's clear it is a Symbol. Before: ... @level=warning_verbose_true> After: ... @level=:warning_verbose_true> https://github.com/ruby/prism/commit/84503643b9
2024-01-27[ruby/prism] Bring back #arg_rest localKevin Newton
https://github.com/ruby/prism/commit/9b6907b727
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-25[ruby/prism] Fix Ruby head buildKevin Newton
https://github.com/ruby/prism/commit/149e2ff7f6
2024-01-19[ruby/prism] switch unless to ifAdam Hess
https://github.com/ruby/prism/commit/29bdbf4212 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-01-19[ruby/prism] Handle stovetop start in constant path fullnameAdam Hess
https://github.com/ruby/prism/commit/3a216e63fe
2024-01-19[ruby/prism] Parsing rules documentKevin Newton
https://github.com/ruby/prism/commit/57a9575543
2024-01-19[ruby/prism] Extract identifier lexing documentation to separate fileMatthew Healy
https://github.com/ruby/prism/commit/c9df17e3c0
2024-01-16[ruby/prism] Add parse options to JavaScript's parsePrism functionCameron Dutro
https://github.com/ruby/prism/commit/d7fe7c7ae7
2024-01-16[ruby/prism] Fix up gemspecKevin Newton
https://github.com/ruby/prism/commit/82e3126762