summaryrefslogtreecommitdiff
path: root/test/prism/errors
AgeCommit message (Collapse)Author
2025-12-08Bump Prism to v1.5.2Takashi Kokubun
[Backport #21187]
2025-09-12Bump Prism version to 1.5.0Takashi Kokubun
2025-07-09[ruby/prism] Accept a newline after the defined? keyword [Backport #21197] ↵Takashi Kokubun
(#13327) * [ruby/prism] Accept a newline after the defined? keyword [Bug #21197] https://github.com/ruby/prism/commit/22be955ce9 * Fix a compilation error Co-authored-by: Stan Lo <stan001212@gmail.com> --------- Co-authored-by: Kevin Newton <kddnewton@gmail.com> Co-authored-by: Stan Lo <stan001212@gmail.com>
2025-04-14Revert "merge revision(s) 052794bfe1970e90f4f4f9e37fc362dd27903a8d: ↵Takashi Kokubun
[Backport #21197]" This reverts commit e630a0f7ae909dafe2e1dbc47baf90cd795b4a5f.
2025-04-14merge revision(s) 052794bfe1970e90f4f4f9e37fc362dd27903a8d: [Backport #21197]Takashi Kokubun
[ruby/prism] Accept a newline after the defined? keyword [Bug #21197] https://github.com/ruby/prism/commit/22be955ce9
2025-02-18[ruby/prism] Fix escape unicode curly inline whitespaceKevin Newton
Fixes [Bug #21145] https://github.com/ruby/prism/commit/be2d845639
2025-02-13merge revision(s) b21e1aed2ed5b22b50efc658289a403eeed581df: [Backport #21114]Takashi Kokubun
[ruby/prism] Fix infinite loop in error recovery When recovering from a depth error that occurs at the end of the file, we need to break out of parsing statements. Fixes [Bug #21114] https://github.com/ruby/prism/commit/a32e268787
2025-02-13merge revision(s) 127325a4bad409ee5da91084fac768934a8fd9e3: [Backport #21117]Takashi Kokubun
[ruby/prism] No writing to numbered parameters Fixes [Bug #21117] https://github.com/ruby/prism/commit/19d4bab5a0
2025-02-13merge revision(s) ad96c5a72908042489357b73dc936c4bc38d919b, ↵Takashi Kokubun
ca81142eff98cccb03ff523322aefe4e7346fd0e: [Backport #21010] [ruby/prism] Throw syntax error for endless method with `[]=` Prism shoudld throw a syntax error for endless methods when the method name uses brackets. Previously it would not. This matches the behavior of parse.y. Fixes https://bugs.ruby-lang.org/issues/21010 https://github.com/ruby/prism/commit/43c16a89ef [ruby/prism] [Bug #21010] Reject endless method definition of `[]=` Fixes: https://bugs.ruby-lang.org/issues/20785 https://github.com/ruby/prism/commit/192960ce5d
2024-12-16[ruby/prism] Fix 3112 - disallow commas after block argeileencodes
Prism was already disallowing arguments after block args, but in parse.y, any comma after a block arg is a syntax error. This moves the error handling into `PM_TOKEN_UAMPERSAND` where we can check if the current type is `PM_TOKEN_COMMA`then raise an error. I've also updated the tests to include the examplesfrom ruby/prism#3112. Fixes: ruby/prism#3112 https://github.com/ruby/prism/commit/754cf8eddc Notes: Merged: https://github.com/ruby/ruby/pull/12358
2024-12-13[PRISM] Blocks are also a syntax error in array assignmentMatt Valentine-House
Actually close [Bug #20952] Notes: Merged: https://github.com/ruby/ruby/pull/12343
2024-12-13[PRISM] using []= to set kwargs is a syntax errorMatt Valentine-House
Fixes [Bug #20952] Notes: Merged: https://github.com/ruby/ruby/pull/12342
2024-12-12[ruby/prism] Same numbered param cannot be used in child blocksAaron Patterson
Raise an exception when the same numbered param is used inside a child block. For example, the following code should be a syntax error: ```ruby -> { _1 + -> { _1 } } ``` Fixes https://github.com/ruby/prism/pull/3291 https://github.com/ruby/prism/commit/d4fc441838
2024-12-05[ruby/prism] Fix error messages for unterminated ( and {Aaron Patterson
If we hit an EOF token, and the character before the EOF is a newline, we should make EOF token start at the previous newline. That way any errors reported will occur on that line. For example "foo(\n" should report an error on line 1 even though the EOF technically occurs on line 2. [Bug #20918] https://bugs.ruby-lang.org/issues/20918 https://github.com/ruby/prism/commit/60bc43de8e
2024-12-02[ruby/prism] Reject invalid operator after match predicate or after match ↵ydah
required Partially fixes: #3171 https://github.com/ruby/prism/commit/d0d9699c27
2024-12-02[ruby/prism] Reject invalid dot method call after match predicate or after ↵ydah
match required Partially fixes: https://github.com/ruby/prism/issues/3171 https://github.com/ruby/prism/commit/5c33fa5a1a
2024-12-02[ruby/prism] Reject extra comma in array after keyword argumentydah
Fixes: https://github.com/ruby/prism/issues/3109 https://github.com/ruby/prism/commit/9ed989c30d
2024-11-08[ruby/prism] Fix splat after kwsplatHaldun Bayhantopcu
https://github.com/ruby/prism/commit/70c1cd480f
2024-11-03[ruby/prism] Error for def ivarKevin Newton
https://github.com/ruby/prism/commit/232a02acef
2024-10-10[ruby/prism] Reject invalid splat as last statement of parenthesesKevin Newton
https://github.com/ruby/prism/commit/3a0b1c6110
2024-10-07[ruby/prism] Properly handle non-assoc operatorsKevin Newton
https://github.com/ruby/prism/commit/dbd5c929d6
2024-10-07[ruby/prism] Handle invalid commas in arguments, parameters, and arraysKevin Newton
https://github.com/ruby/prism/commit/023e894b74
2024-10-04[ruby/prism] Fix up multi target parsingKevin Newton
https://github.com/ruby/prism/commit/80cd335222
2024-10-03[ruby/prism] Pop lex mode for heredocs in the lexer, not the parserKevin Newton
https://github.com/ruby/prism/commit/5dd36b979e
2024-10-02[ruby/prism] Fix up doubled range in argumentsKevin Newton
https://github.com/ruby/prism/commit/aee2de91a3
2024-10-01[ruby/prism] Disallow dynamic patterns in labels at top level followed by pipesKevin Newton
https://github.com/ruby/prism/commit/ccc746f918
2024-10-01Resync to latest PrismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11753
2024-10-01[ruby/prism] Disallow &. after endless rangeKevin Newton
https://github.com/ruby/prism/commit/498dd922d4
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] Fix up void value expression checking for rescueKevin Newton
https://github.com/ruby/prism/commit/509ff88e92
2024-09-25[ruby/prism] Disallow label in parenthesesKevin Newton
https://github.com/ruby/prism/commit/b624e09cc6
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-24[Bug #20647] Disallow `return` directly within a singleton classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11234
2024-07-11[ruby/prism] Move location to second position for node initializersKevin Newton
https://github.com/ruby/prism/commit/4cc0eda4ca
2024-07-11[ruby/prism] Reconfigure error testsKevin Newton
https://github.com/ruby/prism/commit/fb7e1ebb7f