summaryrefslogtreecommitdiff
path: root/prism/templates/src/diagnostic.c.erb
AgeCommit message (Collapse)Author
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-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-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-01[ruby/prism] Fix up find and array patterns with multiple restsKevin Newton
https://github.com/ruby/prism/commit/035890a839
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] 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-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
2024-05-08[ruby/prism] Better error message on missing hash valueKevin Newton
https://github.com/ruby/prism/commit/b20e37e82e
2024-05-07[ruby/prism] Extend error message for unterminated HEREDOCKevin Newton
https://github.com/ruby/prism/commit/c1b07ec11b
2024-05-07[ruby/prism] Better error message for contents of hash patternKevin Newton
https://github.com/ruby/prism/commit/60dbf60f48
2024-05-07[ruby/prism] Disallow implicit hash in array patternKevin Newton
https://github.com/ruby/prism/commit/bdd509c6ac
2024-05-07[ruby/prism] Specific error message for symbol literal with interpolation in ↵Kevin Newton
hash patterns https://github.com/ruby/prism/commit/31f0201bae
2024-05-07[ruby/prism] shareable_constant_value line warningsKevin Newton
https://github.com/ruby/prism/commit/8c984b6922
2024-05-06[ruby/prism] Unexpected fractional component error messagesKevin Newton
https://github.com/ruby/prism/commit/e893bc2230
2024-05-06[ruby/prism] More specific error for conflicting forwarding parametersKevin Newton
https://github.com/ruby/prism/commit/1c3b48fedb
2024-05-06[ruby/prism] Fix up error message for unexpected {Kevin Newton
https://github.com/ruby/prism/commit/80dbe035ba
2024-05-03[ruby/prism] Disallow safe navigation in a call target nodeKevin Newton
https://github.com/ruby/prism/commit/b1917adac7
2024-05-03[ruby/prism] Disallow **nil after keyword parametersKevin Newton
https://github.com/ruby/prism/commit/5beeae076f