summaryrefslogtreecommitdiff
path: root/prism/options.c
AgeCommit message (Collapse)Author
2025-09-12Bump Prism version to 1.5.0Takashi Kokubun
2025-02-14Backport Bug #21031Kevin Newton
2024-09-24[ruby/prism] Accept version shorthand like 3.4Kevin Newton
https://github.com/ruby/prism/commit/098f1c4607
2024-09-24[ruby/prism] Accept all 3.3.x and 3.4.x Ruby versions for Prism.parseBenoit Daloze
https://github.com/ruby/prism/commit/a4fcd5339a
2024-09-20[ruby/prism] Introduce partial_script optionKevin Newton
https://github.com/ruby/prism/commit/b28877fa4f
2024-09-13[ruby/prism] Expose main_script in serialization APIKevin Newton
https://github.com/ruby/prism/commit/0b527ca93f
2024-09-13[PRISM] Only parse shebang on main scriptKevin Newton
Fixes [Bug #20730] Notes: Merged: https://github.com/ruby/ruby/pull/11617
2024-08-14[ruby/prism] Callback on shebang switchesKevin Newton
Add the ability to receive a callback when the parser encounters a shebang that contains additional switches after the Ruby engine. This is necessary because some command-line flags may be present there that will alter the parse. https://github.com/ruby/prism/commit/afc5000331
2024-06-10[ruby/prism] Provide ability to lock encoding while parsingKevin Newton
https://github.com/ruby/prism/commit/f7faedfb3f
2024-05-01[ruby/prism] Support passing version 3.3.1Kevin Newton
https://github.com/ruby/prism/commit/445a0f0d22
2024-04-17[ruby/prism] Fix up more clang-analyzer failuresKevin Newton
https://github.com/ruby/prism/commit/f9a1abbc64
2024-03-28[ruby/prism] CLI -x flagKevin Newton
https://github.com/ruby/prism/commit/2068e3c30a
2024-03-13[ruby/prism] FSL follow-upKevin Newton
https://github.com/ruby/prism/commit/097fd2a54f
2024-03-13[ruby/prism] Change `frozen_string_literal` to be a tri-stateJean Boussier
An explicit `false` is not equivalent to the comment being missing, because the default can be switched with a runtime flag: ```bash $ ruby --enable-frozen-string-literal -e 'p "foo".frozen?' true ``` https://github.com/ruby/prism/commit/4660f58775
2024-03-11[ruby/prism] Support offsetKevin Newton
https://github.com/ruby/prism/commit/665f533373
2024-03-04[ruby/prism] Make alloc interface replaceableHASUMI Hitoshi
- Add `x` prefix to malloc, calloc, realloc, and free (eg: malloc -> xmalloc) - By default, they are replaced with stdlib's functions at build - You can use custom functions by defining `PRISM_CUSTOM_ALLOCATOR` macro https://github.com/ruby/prism/commit/7a878af619
2024-02-29[ruby/prism] Command line options as a bitsetKevin Newton
https://github.com/ruby/prism/commit/369ffbd57e
2024-02-27[ruby/prism] Support -p, -n, -a, and -l command line optionsKevin Newton
https://github.com/ruby/prism/commit/959eb506ca
2024-02-17[ruby/prism] Fix up GCC analyzerKevin Newton
https://github.com/ruby/prism/commit/2e8bc17528
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-01Sync to latest prismKevin Newton
2024-01-02[ruby/prism] IndexTargetNode should always have ATTRIBUTE_WRITEKevin Newton
Because this is a user-facing change, we also need to deal with the fact that CRuby 3.3.0 was just released. In order to support workflows that want to parse exactly as CRuby parses in a specific version, this PR introduces a new option to the options struct that is "version". This allows you to specify that you want "3.3.0" parsing. I'm not sure if this is the correct solution. Another solution is to just fork and keep around the old branch for security patches. Or we could keep around a copy of the source files within this repository as another directory and only update when necessary. There are a lot of potential solutions here. Because this change is so small and the check for it is so minimal, I've decided to go with this enum. If this ends up entirely cluttering the codebase with version checks, we'll come up with another solution. But for now this works, so we're going to go in this direction for a bit until we determine it's no longer working. https://github.com/ruby/prism/commit/d8c7e6bd10
2023-11-29[ruby/prism] Convert start line to signed integersJean Boussier
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://github.com/ruby/prism/commit/0d14ed1452
2023-11-03[ruby/prism] Wire up options through the FFI APIKevin Newton
https://github.com/ruby/prism/commit/f0aa8ad93b
2023-11-03[ruby/prism] Create an options struct for passing all of the possible optionsKevin Newton
https://github.com/ruby/prism/commit/99e81619de