Skip to content

Releases: ruby/prism

v1.6.0

16 Oct 12:44
2924f8f

Choose a tag to compare

Added

  • Add support for passing "current" as the version option to Prism.* APIs.

Changed

  • Remove a compiler warning for a missing unsigned cast for a shift value.

v1.5.2

09 Oct 13:33
5446f7b

Choose a tag to compare

Changed

  • Fix character literal forced encoding when a unicode escape sequence is used.
  • Reject 1 if foo = bar baz.
  • Clear static literal flag on interpolated strings.
  • Reject optional argument/endless method definition ambiguity.

v1.5.1

13 Sep 14:03
914883a

Choose a tag to compare

Changed

  • Revert of a bug introduced with static literal flags on interpolated strings.

v1.5.0

13 Sep 14:02
b4865f9

Choose a tag to compare

Added

  • Add Prism::Translation::ParserCurrent.
  • Add Integer::to_u32_digits for the Rust API.
  • Add pm_comment_type_t field for the Rust API.
  • Support leading logical operators for CRuby 3.5+.

Changed

  • Mark Prism as ractor-safe.
  • Enforce a minimum version for the parser translation layer.
  • Many fixes to the parser translation layer.
  • Accept a newline after the defined? keyword.
  • Reject true && not true.
  • Make it = it assign nil to match parse.y behavior [Bug #21139].
  • Some fixes to the ruby parser translation layer.
  • Ensure call nodes have the correct ending location.
  • Reject foo && return bar.

v1.4.0

18 Mar 19:11
1463122

Choose a tag to compare

Added

  • Support 3.5 as a version option.
  • Many, many compatibility fixes for the parser translation layer.
  • Handle escapes in named capture names.
  • The freeze option is added to the various Prism:: APIs to deeply freeze the AST.
  • Properly support it for the parser and ruby_parser translation layers.
  • Track the then keyword on rescue nodes.
  • Add a multiple_statements? flag to parentheses nodes to support desired defined? behavior.

Changed

  • The strings used in the AST are now frozen.
  • Fixed handling escaped characters after control sequences in character literals.
  • Fix reading off the end of an unterminated global variable.
  • Raise a syntax error for defining []= with endless method syntax.
  • Increase value of PRISM_DEPTH_MAXIMUM to 10000.
  • Freeze Prism::VERSION.
  • Fix up rescue modifier precedence.

v1.3.0

21 Dec 19:57
439fd97

Choose a tag to compare

Added

  • Introduce Prism::StringQuery.
  • Introduce Prism::Relocation.
  • Track do keyword for WhileNode and UntilNode.
  • Change the way the gem is built to rely on mkmf instead of make.
  • Lots more documentation on node fields.

Changed

  • Properly add an error for def @foo; end.
  • Properly add an error for foo(**, *).
  • Fix up regression in string parsing in RubyParser translation.
  • Reject invalid dot method call after match expression.
  • Reject invalid operator after match expression.
  • Fix up %-literals delimited by newlines.
  • Properly add an error for -> { _1; -> { _1 } }.
  • Reject blocks and keywords in index writes.

v1.2.0

10 Oct 19:22
b08e569

Choose a tag to compare

Added

  • Introduce Prism::CodeUnitsCache.

Changed

  • Properly handle lexing global variables that begin with $-.
  • Properly reject invalid multi writes within parentheses.
  • Fix unary * binding power.
  • Set contains_keywords flag for implicit gets calls when -p is used.
  • Properly reject invalid non-associative operator patterns.
  • Do not warn about unused variables declared on negative lines.

v1.1.0

02 Oct 19:43
5bf1903

Choose a tag to compare

Added

  • Explicitly type each child node field in the Ruby API.
  • Add the main_script option to the parse APIs, which controls whether or not shebangs are considered.
  • Add the partial_script options to the parse APIs, which controls whether or not jumps that would otherwise be considered invalid are allowed. This is useful for parsing things like ERB sources, where you know it will be evaluated in a different context. Note that this functionality is replacing the previous idiom of passing in a list of scopes to indicate an eval context, because that behavior has changed upstream in ruby/ruby.
  • Add ArgumentsNode#contains_multiple_splats?.
  • Add ArgumentsNode#contains_forwarding?.
  • Accept all valid Ruby versions for the version option on parse APIs.
  • Accept version shorthands like "3.3" and "3.4" for the version option on parse APIs.
  • Support a max depth to protect against malicious payloads without hitting the stack limit.

Changed

  • Fix some token incompatibilities in the parser translation.
  • Fix up parsing tempfiles on Windows.
  • Fix up handling UTF-8 characters in file paths on Windows.
  • Do not warn for a \r at the end of a shebang on Windows.
  • Properly handle erroring for parsing a directory on Windows.
  • When a numbered reference is out of range, warn instead of raise.
  • Allow returns in default parameter values.
  • Reject many more invalid syntax patterns.

v1.0.0

28 Aug 19:40
163a265

Choose a tag to compare

Added

  • Add Node#breadth_first_search.
  • Add Node#node_id.
  • Add ArgumentsNode#contains_splat?.
  • Passing the special value false for the encoding option tells Prism to ignore magic encoding comments.
  • Expose flags on every node type (allows checking static literal and newline).
  • Implement mismatched indentation warning.
  • Add C API for receiving a callback when parsing shebangs with additional flags.

Changed

  • BREAKING: Some fields are renamed that had illogical names. The previous names all now emit deprecation warnings.
    • CaseMatchNode#consequent was renamed to CaseMatchNode#else_clause
    • CaseNode#consequent was renamed to CaseNode#else_clause
    • IfNode#consequent was renamed to IfNode#subsequent
    • RescueNode#consequent was renamed to RescueNode#subsequent
    • UnlessNode#consequent was renamed to UnlessNode#else_clause
  • Block exits are now allowed in loop predicates (e.g., while _ && break do end).
  • Multi-writes are now disallowed when not at the statement level.
  • Ensure that range operators are non-associative.
  • (JavaScript) Correctly deserialize encoded strings.
  • Properly support parsing regular expressions in extended mode.
  • Use gmake on FreeBSD.
  • Parsing streams now handles NUL bytes in the middle of the stream.
  • Properly detect invalid returns.

v0.30.0

07 Jun 19:54

Choose a tag to compare

Added

  • More correctly raise mixed encoding errors.
  • Implement ambiguous binary operator warning.
  • Fix up regexp escapes with control and meta characters.
  • Fix up support for the it implicit local variable.
  • Heredoc identifiers now properly disallow CLRF.
  • Errors added for void value expressions in begin clauses.
  • Many updates to more closely match the parser gem in parser translation.
  • Many errors added for invalid regular expressions.

Changed

  • Handle parser translation missing the parser gem.
  • Handle ruby_parser translation missing the ruby_parser gem.
  • Various error messages have been updated to more closely match CRuby.
  • RationalNode now has a numerator and denominator field instead of a numeric field. For the Ruby API we provide a RationalNode#numeric method for backwards-compatibility.