summaryrefslogtreecommitdiff
path: root/test/prism/errors_test.rb
AgeCommit message (Collapse)Author
2024-02-22[ruby/prism] Add an IntegerField for parsing integer valuesKevin Newton
https://github.com/ruby/prism/commit/120d8c0479
2024-02-16[ruby/prism] Add warning for assignments to literals in conditionalsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/ee87ed08fb
2024-02-15Temporarily update the error message format in prismYusuke Endoh
2024-02-12[ruby/prism] Error messages closer to CRubyKevin Newton
https://github.com/ruby/prism/commit/19ffa0b980
2024-02-07[ruby/prism] Support for Ruby 2.7Kevin Newton
https://github.com/ruby/prism/commit/1a15b70a8e
2024-02-01[ruby/prism] Remove locals_body_indexKevin Newton
We're not using this anymore, and it doesn't make a lot of sense outside the context of a compiler anyway, and in anyway it's wrong when you have local variables written in default values. https://github.com/ruby/prism/commit/5edbd9c25b
2024-02-01[ruby/prism] Check literals for receiverHaldun Bayhantopcu
https://github.com/ruby/prism/commit/56441b08e7
2024-01-30Update forwarding locals for prismAaron Patterson
2024-01-30[ruby/prism] Better error messages for unexpected tokens in prefixKevin Newton
https://github.com/ruby/prism/commit/a35b8e45ee
2024-01-27[ruby/prism] Error follow-upKevin Newton
Split up the diagnostic levels so that error and warning levels aren't mixed. Also fix up deconstruct_keys implementation. https://github.com/ruby/prism/commit/bd3eeb308d Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2024-01-26[ruby/prism] Add level to warnings and errors to categorize themBenoit Daloze
* Fixes https://github.com/ruby/prism/issues/2082 https://github.com/ruby/prism/commit/7a74576357
2024-01-26[ruby/prism] Track whether a Symbol should have its encoding changed from ↵Kevin Menard
the source encoding. Ruby sets a Symbol literal's encoding to US-ASCII if the symbols consists only of US ASCII code points. Character escapes can also lead a Symbol to have a different encoding than its source's encoding. https://github.com/ruby/prism/commit/f315660b31
2024-01-17[ruby/prism] Parse `it` default parameterTakashi Kokubun
https://github.com/ruby/prism/commit/a0c5361b9f
2024-01-10[ruby/prism] Add a "repeated flag" to parameter nodesAaron Patterson
It's possible to repeat parameters in method definitions like so: ```ruby def foo(_a, _a) end ``` The compiler needs to know to adjust the local table size to account for these duplicate names. We'll use the repeated parameter flag to account for the extra stack space required https://github.com/ruby/prism/commit/b443cb1f60 Co-Authored-By: Kevin Newton <kddnewton@gmail.com> Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
2024-01-08[ruby/prism] Handle parsing a line break in a receiver of a methodKevin Newton
https://github.com/ruby/prism/commit/4d5f43ecbc
2024-01-03[ruby/prism] Better error recovery for content after unterminated heredocKevin Newton
https://github.com/ruby/prism/commit/c2d325a886
2024-01-02[ruby/prism] Ignore visibility flagKevin Newton
https://github.com/ruby/prism/commit/55b049ddac
2024-01-02[ruby/prism] Fix to check multiple block arguments for forwarding argTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2111 https://github.com/ruby/prism/commit/21ca243d0a
2023-12-25Revert "Revert all of commits after Prism 0.19.0 release"Hiroshi SHIBATA
This reverts commit d242e8416e99eaee4465e2681210ae8b7ecd6d34.
2023-12-16Revert all of commits after Prism 0.19.0 releaseHiroshi SHIBATA
We should bundle released version of Prism for Ruby 3.3.0
2023-12-15[ruby/prism] Add an error for `in` keyword in argumentsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2026 https://github.com/ruby/prism/commit/c4b41cd477
2023-12-14[ruby/prism] Make equality operators non-associativeTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2073 https://github.com/ruby/prism/commit/0f747d9240
2023-12-12[ruby/prism] Update tests and snapshotsUfuk Kayserilioglu
https://github.com/ruby/prism/commit/0663e2bcfa
2023-12-11[ruby/prism] Fix parsing unterminated empty string `"`TSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2034 https://github.com/ruby/prism/commit/8280e577fa
2023-12-11[ruby/prism] Fix to parse a (endless-)range with binary operatorsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2022 Fix https://github.com/ruby/prism/pull/2030 https://github.com/ruby/prism/commit/b78d8b6525
2023-12-10[ruby/prism] fix: escape newlineAlex Koval
https://github.com/ruby/prism/commit/a28b427dcc
2023-12-08[ruby/prism] Add necessary encoding flags for symbols and regexKevin Newton
This doesn't actually fix the encodings for symbols and regex, unfortunately. But I wanted to get this change in because it is the last AST change we're going to make before 3.3 is released. So, if consumers want, they can start to check these flags to determine the encoding, even though it will be wrong. Then once we actually set them correctly, everything should work. https://github.com/ruby/prism/commit/9b35f7e891
2023-12-08[ruby/prism] More closely match CRuby error messagesKevin Newton
https://github.com/ruby/prism/commit/1ed07a0c6d
2023-12-06[ruby/prism] Emit error for constant assignments in defsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/864b06f90e
2023-12-06[ruby/prism] Simplify unterminated stringKevin Newton
https://github.com/ruby/prism/commit/ef512ca914
2023-12-06[ruby/prism] Move flag position consistently to frontKevin Newton
https://github.com/ruby/prism/commit/6e69a81737
2023-12-06[ruby/prism] Fix closing loc for string literalsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1974 https://github.com/ruby/prism/commit/453d403593
2023-12-06[ruby/prism] Provide flags for changing encodingsKevin Newton
https://github.com/ruby/prism/commit/e838eaff6f
2023-12-06[ruby/prism] Add locals_body_index to DefNode, BlockNode, LambdaNodeJemma Issroff
The locals_body_index gives the index in the locals array where the locals from the body start. This allows compilers to easily index past the parameters in the locals array. https://github.com/ruby/prism/commit/5d4627b890
2023-12-05[ruby/prism] Add test casesTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/e91f8dbb99
2023-12-05[ruby/prism] Fix some corner casesTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/d5453f168e
2023-12-05[ruby/prism] Fix to parse command-style method calls more correctlyTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1468 Fix https://github.com/ruby/prism/pull/1575 To decide command-style method calls are allowed, this introduce a new parameter `accepts_command_call` to `parse_expression` and some functions. Although one think this can be solved by operator precedence, it is hard or impossible, because the precedence of command-style calls is skewed (e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.) One of the most complex examples is that: (1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted, (2) `foo, bar = baz = fuzz 1` is rejected. To implement this behavior, this introduces a new binding power `PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single assignments or multi assignments at their RHS. https://github.com/ruby/prism/commit/d4dd49ca81
2023-12-04[ruby/prism] Check "void value expression" for array literalsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1978 https://github.com/ruby/prism/commit/194c997d0a
2023-12-01[ruby/prism] Change numbered parametersKevin Newton
Previously numbered parameters were a field on blocks and lambdas that indicated the maximum number of numbered parameters in either the block or lambda, respectively. However they also had a parameters field that would always be nil in these cases. This changes it so that we introduce a NumberedParametersNode that goes in place of parameters, which has a single uint8_t maximum field on it. That field contains the maximum numbered parameter in either the block or lambda. As a part of the PR, I'm introducing a new UInt8Field type that can be used on nodes, which is just to make it a little more explicit what the maximum values can be (the maximum is actually 9, since it only goes up to _9). Plus we can do a couple of nice things in serialization like just read a single byte. https://github.com/ruby/prism/commit/2d87303903
2023-12-01[ruby/prism] Improve to handle unterminated stringsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1946 This fixes to set an error position for unterminated strings to the opening delimiters. Previously, the error position was set to the end of the delimiter. The same fix applies to other string-like literals. Additionally, this fixes https://github.com/ruby/prism/pull/1946; that is, it adds the last part of the string even though the string literal does not terminate. https://github.com/ruby/prism/commit/c1240baafd
2023-11-29[ruby/prism] Reject class/module defs in method params/rescue/ensure/elseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1936 https://github.com/ruby/prism/commit/232e77a003
2023-11-28[ruby/prism] Add numbered_parameters field to BlockNode and LambdaNodeJemma Issroff
We are aware at parse time how many numbered parameters we have on a BlockNode or LambdaNode, but prior to this commit, did not store that information anywhere in its own right. The numbered parameters were stored as locals, but this does not distinguish them from other locals that have been set, for example in `a { b = 1; _1 }` there is nothing on the AST that distinguishes b from _1. Consumers such as the compiler need to know information about how many numbered parameters exist to set up their own tables around parameters. Since we have this information at parse time, we should compute it here, instead of deferring the work later on. https://github.com/ruby/prism/commit/bf4a1e124d
2023-11-28[ruby/prism] Fix testsTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/1e6ecbaf04
2023-11-28[ruby/prism] Use `0` for the default valie of `current_param_name`TSUYUSATO Kitsune
https://github.com/ruby/prism/commit/896915de24
2023-11-28[ruby/prism] Check circular references in default values of paramsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1637 https://github.com/ruby/prism/commit/0172d69cba
2023-11-28[ruby/prism] Use un-capitalized error messagesKevin Newton
I don't prefer this style, but it appears that a plurality of syntax error messages between with un-capitalized messages in CRuby, so we'll go with that for consistency, for now. https://github.com/ruby/prism/commit/b02df68954
2023-11-27[ruby/prism] Check void expressions for constant pathsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1920 https://github.com/ruby/prism/commit/ee8e03bac7
2023-11-27[ruby/prism] Fix and reuse pm_call_node_index_pTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1925 Fix https://github.com/ruby/prism/pull/1927 Previously pm_call_node_index_p does not check about a block argument correctly and is not used in parse_write to check an index call node. This commit fixes these problems. https://github.com/ruby/prism/commit/92bab044ff
2023-11-22[ruby/prism] Check void values in singleton class (`class <<`)TSUYUSATO Kitsune
Follow up the ruby/ruby#8917 change. https://github.com/ruby/prism/commit/f6bac4d3bf
2023-11-22[ruby/prism] Fix associativity of binary range with begin-less rangeTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1828 https://github.com/ruby/prism/commit/22c0640e48