summaryrefslogtreecommitdiff
path: root/prism/templates/src
AgeCommit message (Collapse)Author
2025-12-05[ruby/prism] Avoid undefined int overflow behaviourSteven Johnstone
Fixes https://github.com/ruby/prism/pull/3786. https://github.com/ruby/prism/commit/b72b664675
2025-11-16Handle deeply nested capture variables syntax errKevin Newton
When there are nested capture variables inside of a pattern match that has an alternation pattern, it is a syntax error. Currently it only adds a syntax error when it is at the top level of the pattern.
2025-11-14[ruby/prism] Reject endless method as a block parameter defaultEarlopain
Fixes [Bug #21661] https://github.com/ruby/prism/commit/475fa46a82
2025-11-14[Feature #21572] Syntax error at capture in alternation patternNobuyoshi Nakada
Should fail even with `-c` option.
2025-10-08[ruby/prism] For these special cases, there exists no optional argument ↵Earlopain
type. Since a endless method is started with `=`, there was ambiguity here. We have to simply reject these in all cases. This adds a new error for the following reason: * `def foo arg = nil` is interpreted as a normal method call with optional `arg` without matching `end` * `def foo *arg = nil; end` is interpreted as a endless method call that has body `nil` with extraneous `end` `def foo *arg = nil` is somewhere inbetween and I don't know how to otherwise indicate the error. Now the second case above also shows the newly added error message. Fixes [Bug #21623] https://github.com/ruby/prism/commit/e1910d4492
2025-08-05[ruby/prism] Improve error handling for missing parentheses after 'not' in ↵ydah
command calls https://github.com/ruby/prism/commit/d9151b8a82
2025-08-05[ruby/prism] Reject `true && not true`Yusuke Endoh
A command-call-like `not true` must be rejected after `&&` and `||`. https://bugs.ruby-lang.org/issues/21337 https://github.com/ruby/prism/commit/0513cf22ad
2025-07-16[ruby/prism] Improve error handling for missing parentheses after 'not' in ↵ydah
command calls https://github.com/ruby/prism/commit/d9151b8a82
2025-07-16[ruby/prism] Reject `true && not true`Yusuke Endoh
A command-call-like `not true` must be rejected after `&&` and `||`. https://bugs.ruby-lang.org/issues/21337 https://github.com/ruby/prism/commit/0513cf22ad
2025-03-22[ruby/prism] Include nodeId in Java Node only if necessaryBenoit Daloze
* See https://github.com/ruby/prism/issues/3502 https://github.com/ruby/prism/commit/b7aedfe696
2025-03-21[ruby/prism] Add node_id to Java serializationKevin Newton
https://github.com/ruby/prism/commit/93e768bd18
2025-01-05Use a single quote instead of a backtick for error messagesJunichi Ito
Fix https://bugs.ruby-lang.org/issues/20977 Notes: Merged: https://github.com/ruby/ruby/pull/12424
2024-10-07[ruby/prism] Handle invalid commas in arguments, parameters, and arraysKevin Newton
https://github.com/ruby/prism/commit/023e894b74
2024-10-01Resync to latest PrismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11753
2024-09-30Sync Prism with latest main branchKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11741
2024-09-30[ruby/prism] Require a delimiter for singleton classesKevin Newton
https://github.com/ruby/prism/commit/fd58d6a9ea
2024-09-26[ruby/prism] Reject non-assoc ranges with subsequent operatorsKevin Newton
https://github.com/ruby/prism/commit/976a3cd0a5
2024-09-25[ruby/prism] Fix up more error messages to more closely match parse.yKevin Newton
https://github.com/ruby/prism/commit/988ac82187
2024-09-25[ruby/prism] Disallow label in parenthesesKevin Newton
https://github.com/ruby/prism/commit/b624e09cc6
2024-09-25[ruby/prism] Support a max depth to protect against malicious payloadsKevin Newton
https://github.com/ruby/prism/commit/a474017bbe
2024-08-23[ruby/prism] Pass Unicode escapes on to onigmoKevin Newton
When we encounter an invalid unicode escape within a regular expression, we now pass that error on to Onigmo as if it didn't exist in the parser (which matches the upstream parser's behavior). We do this because there are tests that specify that you are allowed to have invalid Unicode escapes if they are within the context of a regular expression comment for a regular expression in extended mode. That looks like: /# \u /x Note that this _only_ applies to Unicode escapes (as opposed to applying to hex or meta/control escapes as well). Importantly it also only applies if the regular expression is terminated. An unterminated regular expression will still get error handling done in the parser. That would look like: /# \u that would result in the same error handling we have today. https://github.com/ruby/prism/commit/fb98034806
2024-08-15[ruby/prism] Special error for too short unicode errorsKevin Newton
https://github.com/ruby/prism/commit/9f1f7d08bd
2024-07-25[ruby/prism] Do not serialize common flags when ↵Benoit Daloze
PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS is set * Note that we could shift the flags by 2 on serialize & deserialize but it does not seems worth it as it does not save serialized size in any significant amount, i.e. average was 0.799 before #2924. * $ bundle exec rake serialized_size:topgems Before: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 69477115 total serialized/total source: 0.770 Stats of ratio serialized/source per file: average: 0.844 median: 0.825 1st quartile: 0.597 3rd quartile: 1.064 min - max: 0.078 - 3.792 After: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 66150209 total serialized/total source: 0.733 Stats of ratio serialized/source per file: average: 0.800 median: 0.779 1st quartile: 0.568 3rd quartile: 1.007 min - max: 0.076 - 3.675 https://github.com/ruby/prism/commit/e012072f70
2024-07-25[ruby/prism] Do not serialize node_id when ↵Benoit Daloze
PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS is set * $ bundle exec rake serialized_size:topgems Before: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 86284647 total serialized/total source: 0.957 Stats of ratio serialized/source per file: average: 0.952 median: 0.937 1st quartile: 0.669 3rd quartile: 1.206 min - max: 0.080 - 4.065 After: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 69477115 total serialized/total source: 0.770 Stats of ratio serialized/source per file: average: 0.844 median: 0.825 1st quartile: 0.597 3rd quartile: 1.064 min - max: 0.078 - 3.792 https://github.com/ruby/prism/commit/cf90fe5759
2024-07-22[ruby/prism] Implement mismatched indentation warningKevin Newton
https://github.com/ruby/prism/commit/5d5bf92be8
2024-07-11[ruby/prism] Prevent optional block parameter from accepting certain ↵Stan Lo
prefixed values This commit prevents the following unary operators from being accepted as the value prefix of a block's optional parameter: - `+` - `-` - `~` - `!` For example, `f { |a = +b| }` will now raise a syntax error. https://github.com/ruby/prism/commit/3024bee60c Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-07-11[ruby/prism] Add node ids to nodesKevin Newton
https://github.com/ruby/prism/commit/bf16ade7f9
2024-07-11[ruby/prism] Expose flags on every node typeKevin Newton
https://github.com/ruby/prism/commit/9f12a56fd6
2024-07-01[ruby/prism] Fix up find and array patterns with multiple restsKevin Newton
https://github.com/ruby/prism/commit/035890a839
2024-06-21[ruby/prism] Update `#line` that was missed to updateYusuke Endoh
Follow up https://github.com/ruby/prism/commit/1a2626be275d https://github.com/ruby/prism/commit/8174aac929
2024-06-20[ruby/prism] Set `#line" directives to respect the path in ruby/ruby repoYusuke Endoh
ruby/ruby measures test coverage of C code, but the `#line` directive generated by prism points to a file that does not exist, so coverage is not taken properly. This changeset specifies the location of the source files as a relative path in terms of ruby/ruby repo. https://github.com/ruby/prism/commit/1a2626be27
2024-06-14[ruby/prism] Ensure ranges are non-associativeKevin Newton
https://github.com/ruby/prism/commit/f59295938b
2024-06-11[ruby/prism] Match CRuby error message for unknown regexp optionsKevin Newton
https://github.com/ruby/prism/commit/73669b59f6
2024-06-10[ruby/prism] Disallow multi writes when not in statement levelKevin Newton
https://github.com/ruby/prism/commit/fe34a77df2
2024-06-05[ruby/prism] Report onigmo errors for depthKevin Newton
https://github.com/ruby/prism/commit/e0e8bba8be
2024-05-31Make error messages clear blocks/keywords are disallowed in index assignmentJeremy Evans
Blocks and keywords are allowed in regular index. Also update NEWS to make this more clear. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-05-24[ruby/prism] Remove various unused memsize infraKevin Newton
https://github.com/ruby/prism/commit/283938ed1f
2024-05-24[ruby/prism] Update duplicated when error messageKevin Newton
https://github.com/ruby/prism/commit/54316fd8a0
2024-05-22[ruby/prism] Fix support for 'it' implicit local variableKevin Newton
https://github.com/ruby/prism/commit/53bbcfe513
2024-05-21[ruby/prism] Add error for numbered parameter used in inner blockKevin Newton
https://github.com/ruby/prism/commit/c386ba6d48
2024-05-20[ruby/prism] Implement ambiguous binary operator warningKevin Newton
https://github.com/ruby/prism/commit/6258c3695f
2024-05-16[ruby/prism] Update more escape error messages to match CRubyKevin Newton
https://github.com/ruby/prism/commit/ab43b3ab66
2024-05-16[ruby/prism] Match CRuby invalid escape character syntax error messageKevin Newton
https://github.com/ruby/prism/commit/0ef5658dcc
2024-05-16[ruby/prism] Match CRuby invalid character error messageKevin Newton
https://github.com/ruby/prism/commit/8d4c5c2bca
2024-05-16[ruby/prism] Update error message for invalid % at EOFKevin Newton
https://github.com/ruby/prism/commit/178d4f66fd
2024-05-16[ruby/prism] Match CRuby error message for unknown % stringKevin Newton
https://github.com/ruby/prism/commit/863197629c
2024-05-15[ruby/prism] Replace end of file with end-of-inputKevin Newton
https://github.com/ruby/prism/commit/dd532ded95
2024-05-10[ruby/prism] Enhance parameter forwarding error messagesKevin Newton
https://github.com/ruby/prism/commit/826657232e
2024-05-08[ruby/prism] Enhance def params term error messageKevin Newton
https://github.com/ruby/prism/commit/3af1acd5da
2024-05-08[ruby/prism] Invalid escape character syntax for nested unicode escapesKevin Newton
https://github.com/ruby/prism/commit/623a0bb995