summaryrefslogtreecommitdiff
path: root/test/ruby/test_parse.rb
AgeCommit message (Collapse)Author
2025-03-29merge revision(s) 1acfb29015dbc38fd345d8786aa78aad59f7dcd1: [Backport #21186]nagachika
[Bug #21186] multibyte char literal should be a single letter word
2024-08-06parse.y: const_decl_path don't replace destination node by a literal (#11314)Jean byroot Boussier
[Bug #20668] The `dest` node is assumed to be a `CDECL`, so overwriting it with a `LIT` cause a crash on the next iteration. Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-12-12Prevent warning: possibly useless use of a literal in void contextYusuke Endoh
2023-12-08[Bug #19877] Flip-flop needs to be direct conditionNobuyoshi Nakada
2023-12-02[Bug #20033] Dynamic regexp should not assign capturesNobuyoshi Nakada
2023-12-01[Bug #20030] dispatch invalid escaped character without ignoring itNobuyoshi Nakada
2023-11-30[Bug #19877] Assign captures for direct regexp literal onlyNobuyoshi Nakada
2023-10-31Keep unused literal nodesyui-knk
For static analysis, it’s better to keep unused literal nodes. If simply change `block_append` to fall through, both "unused literal ignored" and "possibly useless use of a literal in void context" warnings are shown for the same line. But it’s verbose then remove "unused literal ignored" warning. This kind of optimization is already implemented on compile.c. `compile_block` calls `iseq_compile_each0` with `popped = 1` when NODE_BLOCK has next.
2023-10-13[Bug #19919] Warn class variable assignment and constant declaration in ↵yui-knk
condition
2023-10-13[Bug #19924] Source code should be unsigned char streamNobuyoshi Nakada
Use `peekc` or `nextc` to fetch the next character, instead of reading from `lex.pcur` directly, for compilers that plain char is signed.
2023-09-26Prevent warnings: "unused literal ignored"Yusuke Endoh
``` [24688/26146] TestParse#test_named_capture_in_block(eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: possibly useless use of + in void context = 0.00 s ```
2023-09-15[Bug #19882] Reject tokens invalid as symbolsNobuyoshi Nakada
2023-09-15[Bug #19877] Fix flip-flop in blockNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8440
2023-09-15[Bug #19877] Named captures should take place from regexps in blockNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8440
2023-09-15[Bug #19877] Literals cannot have singleton methods even in blocksNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8440
2023-09-07[Bug #19549] Check for variables to be interpolatedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7615
2023-06-30Handle unterminated unicode escapes in regexpsJeremy Evans
This fixes an infinite loop possible after ec3542229b29ec93062e9d90e877ea29d3c19472. For \u{} escapes in regexps, skip validation in the parser, and rely on the regexp code to handle validation. This is necessary so that invalid unicode escapes in comments in extended regexps are allowed. Fixes [Bug #19750] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/8003 Merged-By: jeremyevans <code@jeremyevans.net>
2023-06-22[Bug #19743] All but EOF can be read again after push-backNobuyoshi Nakada
2023-06-20[Bug #19736] Recover after unterminated interpolationNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7963
2023-06-20Adjust indent [ci skip]Nobuyoshi Nakada
2023-03-19[Bug #19539] Match heredoc identifier from end of lineNobuyoshi Nakada
Not to ignore leading spaces in indented heredoc identifier. Notes: Merged: https://github.com/ruby/ruby/pull/7566
2023-01-02[Bug #19291] Rewind to the previous lineNobuyoshi Nakada
When rewinding looking ahead after newline token, also reset the last line string, the pointers to it, and the location, not only the line number. Notes: Merged: https://github.com/ruby/ruby/pull/7054
2022-07-08[Bug #18890] Suppress warnings and fix the messageNobuyoshi Nakada
``` test/ruby/test_parse.rb:1384: warning: assigned but unused variable - obj test/ruby/test_pattern_matching.rb:1162: warning: unused literal ignored test/ruby/test_pattern_matching.rb:1165: warning: unused literal ignored test/ruby/test_pattern_matching.rb:1161: warning: assigned but unused variable - a test/ruby/test_pattern_matching.rb:1164: warning: assigned but unused variable - b ``` And a newline should be significant here.
2022-07-06[Bug #18890] newline should be insignificant after pattern labelNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6087
2022-06-30[Bug #18877] Let `lex_ctxt` not to eat escaped whitespaceNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6065
2022-06-29[Bug #18884] `class` cannot be just followed by modifiersNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6064 Merged-By: nobu <nobu@ruby-lang.org>
2022-04-21Private local variables should shadow outer variables [Bug #18629]Nobuyoshi Nakada
2021-11-18Anonymous block forwarding allows a method to forward a passedJeremy Evans
block to another method without having to provide a name for the block parameter. Implements [Feature #11256] Co-authored-by: Yusuke Endoh mame@ruby-lang.org Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org Notes: Merged: https://github.com/ruby/ruby/pull/5051
2021-10-08Remove duplicate value checks on `mrhs` which always has the valueNobuyoshi Nakada
2021-10-05Show the last line at unexpected end-of-input errorNobuyoshi Nakada
2021-07-27test/ruby/test_parse.rb: Prevent an "unused variable" warningYusuke Endoh
2021-07-21Fix interpolated heredoceileencodes
This fixes https://bugs.ruby-lang.org/issues/18038. The provided reproduction showed that this happens in heredocs with double interpolation. In this case `DSTR` was getting returned but needs to be convered to a `EVSTR` which is what is returned by the function. There may be an additional bug here that we weren't able to produce. It seems odd that `STR` returns `DSTR` while everything else should return `EVSTR` since the function is `new_evstr`. [Bug #18038][ruby-core:104597] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/4664
2021-05-13Also `\U` after control/meta is invalid [Bug #17861]Nobuyoshi Nakada
As well as `\u`, `\U` should be invalid there too. And highlight including `u`/`U` not only the backslash before it.
2021-03-23Ignore useless separators preceding a file encoding commentNobuyoshi Nakada
2021-03-23Assertion for colon-separated encoding pragmaNobuyoshi Nakada
2021-01-04Fixed error message when % at EOFNobuyoshi Nakada
2020-12-24shareable_constant_value: experimental_copyKoichi Sasada
"experimental_everything" makes the assigned value, it means the assignment change the state of assigned value. "experimental_copy" tries to make a deep copy and make copyied object sharable. Notes: Merged: https://github.com/ruby/ruby/pull/3989
2020-12-23Ensure non-literal expressions shareable if `leteral`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-23Update rb_ractor_ensure_shareableNobuyoshi Nakada
* Fixed use of rb_ractor_shareable_p * Raise Ractor::IsolationError Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-23Split the testNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-23Added assertionsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-23Added dedicated helper methodsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-23Changed shareable literal semantics [Feature #17397]Nobuyoshi Nakada
When `literal`, check if the literal about to be assigned to a constant is ractor-shareable, otherwise raise `Ractor::Error` at runtime instead of `SyntaxError`. Notes: Merged: https://github.com/ruby/ruby/pull/3950
2020-12-19Fixed not to make non-literal expression shareable [Feature #17273]Nobuyoshi Nakada
Non-literal expression which is not a part of a literal expression is not a subject of `shareable_literal_value: literal`.
2020-12-17test/ruby: Check warning messages at a finer granularityNobuyoshi Nakada
Instead of suppressing all warnings wholly in each test scripts by setting `$VERBOSE` to `nil` in `setup` methods. Notes: Merged: https://github.com/ruby/ruby/pull/3925 Merged-By: nobu <nobu@ruby-lang.org>
2020-12-14Support shareable_constant_value: literalNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Make shareable_constant_value tri-stateNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14shareable_constant_value: is effective only in comment-only lineNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Added continued line caseNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Added false caseNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681