summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-11-21[ruby/prism] Warning for ENDs in methodsHaldun Bayhantopcu
(https://github.com/ruby/prism/pull/1899) https://github.com/ruby/prism/commit/1b41c2d56c
2023-11-21Remove string concat node in prismKevin Newton
2023-11-21[ruby/prism] Remove string concat in favor of a flat listKevin Newton
Right now when you have a lot of string concats it ends up being difficult to work with because of the depth of the tree. You end up descending very far for every string literal that is part of the concat. There are already times when we use an interpolated string node to group together two string segments that are part of the same string (like when they are interupted by the contents of a heredoc). This commit takes the same approach and replaces string concats with interpolated string nodes. Now that they're a flat list, they should be much easier to work with. There's still some missing information here that would be useful to consumers: whether or not there is _actually_ any interpolation contained in the list. We could remedy this with another node type that is named something like string list, or we could add a flag to interpolated string node indicating that there is interpolation. Either way I want to solve that in a follow-up commit, since this commit is valuable on its own. https://github.com/ruby/prism/commit/1e7ae3ad1b
2023-11-21Fix memory leak when evacuating generic ivarsPeter Zhu
The lookup in the table is using the wrong key when converting generic instance variables to too complex, which means that it never looks up the entry which leaks memory when the entry is overwritten.
2023-11-21Do not change hash type in Hash#assocNobuyoshi Nakada
2023-11-21Raise an exception when Hash#compare_by_identity during its iterationYusuke Endoh
2023-11-21Add a testTSUYUSATO Kitsune
2023-11-21[Bug #11183] Fix rb_complex_pow for special anglesKouhei Yanagita
Add a special treatment for when the argument of self is an integral multiple of 45 degrees. 1i ** (10 ** 100) #=> 1+0i 1i ** (10 ** 100 + 1) #=> 0+1i (1+1i) ** (10 ** 100) # warning: in a**b, b may be too big #=> (Infinity+0.0i) (1+1i) ** (10 ** 100 + 1) # warning: in a**b, b may be too big #=> (Infinity+Infinity*i)
2023-11-21[ruby/prism] Check a token after targets more strictlyHiroya Fujinami
(https://github.com/ruby/prism/pull/1878) Fix https://github.com/ruby/prism/pull/1832 https://github.com/ruby/prism/commit/060bcc81a8
2023-11-21[ruby/prism] Build the ability to format errorsKevin Newton
(https://github.com/ruby/prism/pull/1796) Previously, we only supported error messages that were constant strings. This works for the most part, but there are some times where we want to include some part of the source in the error message to make it better. For example, instead of "Token is reserved" it's better to write "_1 is reserved". To do this, we now support allocating error messages at runtime that are built around format strings. https://github.com/ruby/prism/commit/7e6aa17deb
2023-11-21[ruby/prism] Split up CaseNode and CaseMatchNodeKevin Newton
(https://github.com/ruby/prism/pull/1801) https://github.com/ruby/prism/commit/4c1391ea56
2023-11-20Rename the big5-hkscs stuff to something more generic and add UAO sharing ↵Ryan Garver
common code. Merge the Big5 extensions into pm_big5.c
2023-11-21[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.82 to 0.9.83. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.82...v0.9.83) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/9eb6220c6c
2023-11-21[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.82 to 0.9.83. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.82...v0.9.83) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/41670ad4e2
2023-11-21[ruby/irb] Enable Setting Completer Type through `IRB_COMPLETOR`ima1zumi
(https://github.com/ruby/irb/pull/771) I propose introducing the capability to set the IRB completion kinds via an environment variable, specifically `IRB_COMPLETOR=type`. This feature aims to enhance the Rails console experience by allowing Rails users to specify their preferred completion more conveniently. Currently, when using the Rails console, there's no straightforward way to globally set the type completion across a Rails application repository. It's possible to configure this setting by placing a `.irbrc` file at the project root. However, using a .irbrc file is not ideal as it allows for broad configurations and can potentially affect the production environment. My suggestion focuses on allowing users to set the completion to 'type' in a minimal. This enhancement would be particularly beneficial for teams writing RBS in their Rails applications. This type completer, integrated with RBS, would enhance completion accuracy, improving the Rails console experience. https://github.com/ruby/irb/commit/032f6da25f
2023-11-20[ruby/prism] Fix locations derived from arguments.Haldun Bayhantopcu
(https://github.com/ruby/prism/pull/1897) https://github.com/ruby/prism/commit/00b76ef254
2023-11-20[ruby/prism] Replace match write locals with match write targetsKevin Newton
https://github.com/ruby/prism/commit/eec1862967
2023-11-20Fix crash when evacuating generic ivarPeter Zhu
When transitioning generic instance variable objects to too complex, we set the shape first before performing inserting the new gen_ivtbl. The st_insert for the new gen_ivtbl could allocate and cause a GC. If that happens, then it will crash because the object will have a too complex shape but not yet be backed by a st_table. This commit changes the order so that the insert happens first before the new shape is set. The following script reproduces the issue: ``` o = [] o.instance_variable_set(:@a, 1) i = 0 o = Object.new while RubyVM::Shape.shapes_available > 0 o.instance_variable_set(:"@i#{i}", 1) i += 1 end ary = 1_000.times.map { [] } GC.stress = true ary.each do |o| o.instance_variable_set(:@a, 1) o.instance_variable_set(:@b, 1) end ```
2023-11-20[PRISM] Updated LocalVariableTargetNodes tooJemma Issroff
2023-11-20[PRISM] Fix LocalVariableWriteNodes within blocksJemma Issroff
Prior to this commit, we weren't recursing up scopes to look for the local definition. With this commit, we do so, fixing local writes within blocks
2023-11-20[PRISM] Implement once node for interpolated regexeileencodes
This PR implements the once node on interpolated regexes. There is a bug in Prism where the interpolated regex with the once flag only works when there is not a local variable so the test uses a "1". We'll need to fix that.
2023-11-20[PRISM] Don't pop args to YieldNodeJemma Issroff
2023-11-20[ruby/prism] adds encodings for ibm869Lynne Ashminov
(https://github.com/ruby/prism/pull/1886) https://github.com/ruby/prism/commit/41462400b7
2023-11-20[ruby/prism] Add and test ibm863 encodingMaple Ong
(https://github.com/ruby/prism/pull/1853) * Add and test ibm863 * Remove dup encoding and add alias * Update test/prism/encoding_test.rb Co-authored-by: Kevin Newton <kddnewton@gmail.com> * Readd bitfield table lol --------- https://github.com/ruby/prism/commit/4cd756d7ff Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-20[ruby/prism] Disallow defining a numbered parameter methodKevin Newton
(https://github.com/ruby/prism/pull/1797) https://github.com/ruby/prism/commit/c13165e6aa
2023-11-20[ruby/prism] feat: Adds macCroatian encodingDavid Wessman
(https://github.com/ruby/prism/pull/1880) * feat: Adds macCroatian encoding - Based on: https://en.wikipedia.org/wiki/Mac_OS_Croatian_encoding https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CROATIAN.TXT Co-authored-by: Josefine Rost <nijrost@gmail.com> * Use output from bin/encodings and adds to docs/encoding.md --------- https://github.com/ruby/prism/commit/019a82d8f3 Co-authored-by: Josefine Rost <nijrost@gmail.com>
2023-11-20[ruby/prism] Add character APIs for locationsKevin Newton
(https://github.com/ruby/prism/pull/1809) https://github.com/ruby/prism/commit/d493ccd093
2023-11-20[ruby/prism] Correctly parse the `resuce` modifier in the rhs of theHiroya Fujinami
assignments (https://github.com/ruby/prism/pull/1879) Fix https://github.com/ruby/prism/pull/1541 https://github.com/ruby/prism/commit/9fb276e1f4
2023-11-20[ruby/prism] Fix parsing `...` in argumentsHiroya Fujinami
(https://github.com/ruby/prism/pull/1882) * Fix parsing `...` in arguments Fix https://github.com/ruby/prism/pull/1830 Fix https://github.com/ruby/prism/pull/1831 * Rename the constant name to PM_ERR_ARGUMENT_FORWARDING_UNBOUND https://github.com/ruby/prism/pull/1882#discussion_r1398461156 https://github.com/ruby/prism/commit/519653aec2
2023-11-20Fix crash when iterating over generic ivarsPeter Zhu
2023-11-20[ruby/prism] feat: add encoding for IBM865Derek Moore
(https://github.com/ruby/prism/pull/1884) * feat: add encoding for IBM865 * style: fix incorrect autoformat https://github.com/ruby/prism/commit/14c6ae0182
2023-11-19[ruby/prism] Don't add an invalid identifier capture to localsHiroya Fujinami
(https://github.com/ruby/prism/pull/1836) * Don't add an invalid identifier capture to locals Fix https://github.com/ruby/prism/pull/1815 * Delay creating a MatchWriteNode https://github.com/ruby/prism/pull/1836#discussion_r1393716600 https://github.com/ruby/prism/commit/635f595a36
2023-11-19[ruby/prism] feat: add encoding for ibm866Syed Faraaz Ahmad
(https://github.com/ruby/prism/pull/1864) Add encoding for ibm866 --------- https://github.com/ruby/prism/commit/1a96cc71f7 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-19[ruby/prism] Add GB1988 encodingOrhan Toy
https://github.com/ruby/prism/commit/78d3fa7172
2023-11-19[ruby/prism] Add macCyrillic encodingOrhan Toy
https://github.com/ruby/prism/commit/220b40921a
2023-11-18[ruby/prism] Big5 HKSCS encodingRyan Garver
https://github.com/ruby/prism/commit/3ca9823eb4
2023-11-18[ruby/prism] Add IBM864 encodingMike Dalton
Fixes https://github.com/ruby/prism/pull/1868 Related #1843 https://github.com/ruby/prism/commit/abc136dfc9
2023-11-18[ruby/prism] Add macCentEuro encodingThomas Marshall
https://github.com/ruby/prism/commit/ff95edbd99
2023-11-18[ruby/irb] Fix irb crash on `{}.` completiontomoya ishida
(https://github.com/ruby/irb/pull/764) https://github.com/ruby/irb/commit/07e4d540cc
2023-11-18Ensure keyword splat method argument is hashJeremy Evans
Commit e87d0882910001ef3b0c2ccd43bf00cee8c34a0c introduced a regression where the keyword splat object passed by the caller would be directly used by callee as keyword splat parameters, if it implemented #to_hash. The return value of #to_hash would be ignored in this case.
2023-11-17Fix corruption when out of shape during ivar removePeter Zhu
Reproduction script: ``` o = Object.new 10.times { |i| o.instance_variable_set(:"@a#{i}", i) } i = 0 a = Object.new while RubyVM::Shape.shapes_available > 2 a.instance_variable_set(:"@i#{i}", 1) i += 1 end o.remove_instance_variable(:@a0) puts o.instance_variable_get(:@a1) ``` Before this patch, it would incorrectly output `2` and now it correctly outputs `1`.
2023-11-17[ruby/prism] add Windows-874 encodingPeter Cai
https://github.com/ruby/prism/commit/0670dd3b9a
2023-11-17[ruby/prism] Update spacing in encoding_test.rbKevin Newton
https://github.com/ruby/prism/commit/56508c2201
2023-11-17[ruby/prism] Add macThaiHaldun Bayhantopcu
https://github.com/ruby/prism/commit/f654058f50
2023-11-17[ruby/prism] Add macRomanHaldun Bayhantopcu
https://github.com/ruby/prism/commit/42b20ee399
2023-11-17[ruby/prism] Do not allow trailing commas in calls without parenthesisHaldun Bayhantopcu
https://github.com/ruby/prism/commit/f1d56da58f
2023-11-17[ruby/prism] Never test locale encodingKevin Newton
https://github.com/ruby/prism/commit/f0f057b055
2023-11-17[ruby/prism] Do not test locale encoding on windowsKevin Newton
https://github.com/ruby/prism/commit/8f40536431
2023-11-17[ruby/prism] Add macTurkishHaldun Bayhantopcu
https://github.com/ruby/prism/commit/2232d4b6a0
2023-11-17Skip test_ForwardingArgumentsNodeYusuke Endoh
due to a failure on a CI http://ci.rvm.jp/results/trunk-iseq_binary@ruby-sp2-docker/4779277 ``` expected: == disasm: #<ISeq:prism_test_forwarding_arguments_node1@<compiled>:2 (2,8)-(4,11)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: 1]) [ 1] "..."@0 0000 putself ( 3) 0001 getlocal_WC_0 ?@-2 0003 splatarray false 0005 getblockparamproxy ?@-1, 0 0008 send <calldata!mid:prism_test_forwarding_arguments_node, argc:1, ARGS_SPLAT|ARGS_BLOCKARG|FCALL>, nil 0011 leave ( 2) actual: == disasm: #<ISeq:prism_test_forwarding_arguments_node1@<compiled>:2 (2,8)-(4,11)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: 1]) [ 1] "..."@0 0000 putself ( 3) 0001 getlocal_WC_0 ?@-2 0003 splatarray false 0005 getblockparamproxy "!"@-1, 0 0008 send <calldata!mid:prism_test_forwarding_arguments_node, argc:1, ARGS_SPLAT|ARGS_BLOCKARG|FCALL>, nil 0011 leave ( 2) /tmp/ruby/src/trunk-iseq_binary/tool/lib/iseq_loader_checker.rb:36:in `exit': exit (SystemExit) ```