summaryrefslogtreecommitdiff
path: root/test/ripper
AgeCommit message (Collapse)Author
2024-09-02merge revision(s) 97449338d6cb42d9dd7c9ca61550616e7e6b6ef6: [Backport #20649]Takashi Kokubun
[Bug #20649] Allow `nil` as 2nd argument of `assign_error` Fallback to the last token element in that case, for the backward compatibilities.
2024-06-11merge revision(s) 27321290: [Backport #20521]Takashi Kokubun
[Bug #20521] ripper: Clean up strterm
2024-06-04merge revision(s) 05553cf22d43dd78b8f30cc4591230b5c000c538: [Backport #20517]Takashi Kokubun
[Bug #20517] Make a multibyte character one token at meta escape
2023-12-02[Bug #19838] Flush delayed token nonconsecutive with the next tokenNobuyoshi Nakada
2023-12-01Dispatch invalid hex escape content tooNobuyoshi Nakada
2023-12-01[Bug #20030] dispatch invalid escaped character without ignoring itNobuyoshi Nakada
2023-11-02Added TestRipper namespace to test_call_colon2Hiroshi SHIBATA
2023-11-02test/ripper: nest helper classes under TestRipper modulelukeg
Generic names like Node and NodeList should be namespaced properly.
2023-08-26[Bug #19851] Ripper: Hide internal block argument IDNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8293
2023-08-09Fix memory leak for incomplete lambdasPeter Zhu
[Bug #19836] The parser does not free the chain of `struct vtable`, which causes memory leaks. The following script reproduces this issue: ``` 10.times do 100_000.times do Ripper.parse("-> {") end puts `ps -o rss= -p #{$$}` end ``` Notes: Merged: https://github.com/ruby/ruby/pull/8192
2023-08-09Fix memory leak in parser for incomplete tokensPeter Zhu
[Bug #19835] The parser does not free the `tbl` of the `struct vtable` when there are leftover `lvtbl` in the parser. This causes a memory leak. The following script reproduces this issue: ``` 10.times do 100_000.times do Ripper.parse("class Foo") end puts `ps -o rss= -p #{$$}` end ``` Notes: Merged: https://github.com/ruby/ruby/pull/8192
2023-08-03Remove --disable-gems for assert_separatelyPeter Zhu
assert_separately adds --disable=gems so we don't need to add --disable-gems when calling assert_separately. Notes: Merged: https://github.com/ruby/ruby/pull/8162
2023-08-01[Bug #19788] Use the result of `tCOLON2` eventNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8144
2023-07-16Fix null pointer access in Ripper#initializeNobuyoshi Nakada
In `rb_ruby_ripper_parser_allocate`, `r->p` is NULL between creating `self` and `parser_params` assignment. As GC can happen there, the typed-data functions for it need to consider the case. Notes: Merged: https://github.com/ruby/ruby/pull/8085
2023-06-28Increase memory leak test timeoutPeter Zhu
The test times out on some platforms, so increase the timeout. Notes: Merged: https://github.com/ruby/ruby/pull/7992
2023-06-28Fix memory leak in RipperPeter Zhu
The following script leaks memory in Ripper: ```ruby require "ripper" 20.times do 100_000.times do Ripper.parse("") end puts `ps -o rss= -p #{$$}` end ``` Notes: Merged: https://github.com/ruby/ruby/pull/7985
2023-06-20[Bug #19736] Recover after unterminated interpolationNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7963
2023-04-07[Bug #19563] Yield words separators per linesNobuyoshi Nakada
So that newlines across a here-doc terminator will be separated tokens. Cf. https://github.com/ruby/irb/pull/558 Notes: Merged: https://github.com/ruby/ruby/pull/7675 Merged-By: nobu <nobu@ruby-lang.org>
2023-04-01`*` in an array pattern should not be parsed as nil in ripperKazuki Tsujimoto
After 6c0925ba7017efde6091e2ec4f1a6be268166696, it was impossible to distinguish between the presence or absence of `*`. # Before the commit Ripper.sexp('0 in []')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil] Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, [:var_field, nil], nil] # After the commit Ripper.sexp('0 in []')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil] Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil] This commit reverts it.
2023-03-28Ripper: Add keyword options to `assert_parse_files`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7602
2023-03-26[Bug #19175] p_kw without a sub pattern should be `assignable'Kazuki Tsujimoto
2023-03-26[Bug #19175] p_rest should be `assignable'Kazuki Tsujimoto
It should also check for duplicate names.
2023-02-02[Bug #19399] Parsing invalid heredoc inside block parameterNobuyoshi Nakada
Although this is of course invalid as Ruby code, allow to just parse and tokenize. Notes: Merged: https://github.com/ruby/ruby/pull/7229
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
2023-01-02Adjut indent [ci skip]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7054
2022-08-28[Bug #18963] Separate string contents by here document terminatorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6292
2022-08-12[Bug #18962] Do not read again once reached EOFNobuyoshi Nakada
`Ripper::Lexer#parse` re-parses the source code with syntax errors when `raise_errors: false`. Co-Authored-By: tompng <tomoyapenguin@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/6233
2022-06-14ripper: Check if anonymous parameters defined [Bug #18828]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6016
2021-12-14ripper: refine test to show expected statesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5264
2021-09-11Hash values should be omitted in Ripper resultsShugo Maeda
2021-08-15Extract the wrapped value when yydebug [Bug #18075]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4742
2021-05-21ripper: wrap endless method in bodystmt [Bug #17869]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4516
2021-05-21ripper: assertions for rescue/ensure in method bodyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4516
2021-03-21Pattern matching pin operator against expression [Feature #17411]Kazuki Tsujimoto
This commit is based on the patch by @nobu.
2021-02-19Fix typo [ci skip]Shugo Maeda
2021-02-19ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644]Shugo Maeda
2021-01-17Fix Ripper with heredoc.manga_osyo
Notes: Merged: https://github.com/ruby/ruby/pull/4083
2021-01-09parse.y: handle "duplicated argument name" appropriately on ripper.yNobuhiro IMAI
refs: 733ed1e184
2020-12-23ripper: fix bad label parameter handling [Bug #17425]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3977
2020-12-19ripper: fix `#tok` on some error events [Bug 17345]Nobuhiro IMAI
sorting alias target by event arity, and setup suitable `Elem` for error. Notes: Merged: https://github.com/ruby/ruby/pull/3936
2020-12-16Ripper: Fixed erred token on wrong alias [Bug #17345]Nobuyoshi Nakada
2020-12-15Ripper: Refined error callbacks [Bug #17345]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3909
2020-11-26Store all kinds of syntax errors [Bug #17345]Nobuyoshi Nakada
2020-11-26Removed a duplicate assertionNobuyoshi Nakada
2020-11-20Ripper.{lex,tokenize} return full tokens even if syntax errorNobuhiro IMAI
yet another implements [Feature #17276]
2020-11-17Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}Jeremy Evans
Implements [Feature #17276] Notes: Merged: https://github.com/ruby/ruby/pull/3774 Merged-By: jeremyevans <code@jeremyevans.net>
2020-11-02ripper: Invalid pragma value warningNobuyoshi Nakada
2020-10-26Assoc pattern matching (#3703)Nobuyoshi Nakada
[Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead. Notes: Merged-By: nobu <nobu@ruby-lang.org>
2020-10-19Add a Ripper.lex test of :on_embexpr_endTakashi Kokubun
This is a weird use case of Ripper.lex which I'm not sure is supposed to be maintained, so I'm adding this test so that we can easily notice such changes. If we change the behavior, this will break the behavior of hamlit.gem v1 and code like https://github.com/haml/haml/pull/1043.
2020-10-12Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada
Also unwrap NODE_RIPPER to check the method name. Notes: Merged: https://github.com/ruby/ruby/pull/3649