aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper
Commit message (Collapse)AuthorAgeFilesLines
* [Bug #19838] Flush delayed token nonconsecutive with the next tokenNobuyoshi Nakada2023-12-021-0/+61
|
* Dispatch invalid hex escape content tooNobuyoshi Nakada2023-12-011-3/+5
|
* [Bug #20030] dispatch invalid escaped character without ignoring itNobuyoshi Nakada2023-12-011-0/+6
|
* Added TestRipper namespace to test_call_colon2Hiroshi SHIBATA2023-11-021-1/+1
|
* test/ripper: nest helper classes under TestRipper modulelukeg2023-11-022-27/+28
| | | | Generic names like Node and NodeList should be namespaced properly.
* [Bug #19851] Ripper: Hide internal block argument IDNobuyoshi Nakada2023-08-261-0/+1
|
* Fix memory leak for incomplete lambdasPeter Zhu2023-08-091-0/+7
| | | | | | | | | | | | | | | | | | | [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 ```
* Fix memory leak in parser for incomplete tokensPeter Zhu2023-08-091-0/+7
| | | | | | | | | | | | | | | | | | | [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 ```
* Remove --disable-gems for assert_separatelyPeter Zhu2023-08-031-1/+1
| | | | | assert_separately adds --disable=gems so we don't need to add --disable-gems when calling assert_separately.
* [Bug #19788] Use the result of `tCOLON2` eventNobuyoshi Nakada2023-08-012-0/+22
|
* Fix null pointer access in Ripper#initializeNobuyoshi Nakada2023-07-161-0/+7
| | | | | | 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.
* Increase memory leak test timeoutPeter Zhu2023-06-281-1/+1
| | | | The test times out on some platforms, so increase the timeout.
* Fix memory leak in RipperPeter Zhu2023-06-281-0/+8
| | | | | | | | | | | | | | | | 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 ```
* [Bug #19736] Recover after unterminated interpolationNobuyoshi Nakada2023-06-201-0/+9
|
* [Bug #19563] Yield words separators per linesNobuyoshi Nakada2023-04-071-1/+1
| | | | | | So that newlines across a here-doc terminator will be separated tokens. Cf. https://github.com/ruby/irb/pull/558
* `*` in an array pattern should not be parsed as nil in ripperKazuki Tsujimoto2023-04-011-4/+4
| | | | | | | | | | | | | | | 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.
* Ripper: Add keyword options to `assert_parse_files`Nobuyoshi Nakada2023-03-281-5/+18
|
* [Bug #19175] p_kw without a sub pattern should be `assignable'Kazuki Tsujimoto2023-03-261-0/+8
|
* [Bug #19175] p_rest should be `assignable'Kazuki Tsujimoto2023-03-261-5/+21
| | | | It should also check for duplicate names.
* [Bug #19399] Parsing invalid heredoc inside block parameterNobuyoshi Nakada2023-02-021-0/+12
| | | | | Although this is of course invalid as Ruby code, allow to just parse and tokenize.
* [Bug #19291] Rewind to the previous lineNobuyoshi Nakada2023-01-021-0/+6
| | | | | | 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.
* Adjut indent [ci skip]Nobuyoshi Nakada2023-01-021-5/+5
|
* [Bug #18963] Separate string contents by here document terminatorNobuyoshi Nakada2022-08-281-0/+10
|
* [Bug #18962] Do not read again once reached EOFNobuyoshi Nakada2022-08-121-0/+14
| | | | | | | `Ripper::Lexer#parse` re-parses the source code with syntax errors when `raise_errors: false`. Co-Authored-By: tompng <tomoyapenguin@gmail.com>
* ripper: Check if anonymous parameters defined [Bug #18828]Nobuyoshi Nakada2022-06-141-0/+38
|
* ripper: refine test to show expected statesNobuyoshi Nakada2021-12-141-14/+21
|
* Hash values should be omitted in Ripper resultsShugo Maeda2021-09-111-0/+14
|
* Extract the wrapped value when yydebug [Bug #18075]Nobuyoshi Nakada2021-08-151-0/+9
|
* ripper: wrap endless method in bodystmt [Bug #17869]Nobuyoshi Nakada2021-05-211-4/+24
|
* ripper: assertions for rescue/ensure in method bodyNobuyoshi Nakada2021-05-211-0/+2
|
* Pattern matching pin operator against expression [Feature #17411]Kazuki Tsujimoto2021-03-211-0/+8
| | | | This commit is based on the patch by @nobu.
* Fix typo [ci skip]Shugo Maeda2021-02-191-1/+1
|
* ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644]Shugo Maeda2021-02-191-0/+12
|
* Fix Ripper with heredoc.manga_osyo2021-01-171-0/+10
|
* parse.y: handle "duplicated argument name" appropriately on ripper.yNobuhiro IMAI2021-01-091-0/+1
| | | | refs: 733ed1e184
* ripper: fix bad label parameter handling [Bug #17425]Nobuyoshi Nakada2020-12-231-15/+16
|
* ripper: fix `#tok` on some error events [Bug 17345]Nobuhiro IMAI2020-12-191-5/+26
| | | | sorting alias target by event arity, and setup suitable `Elem` for error.
* Ripper: Fixed erred token on wrong alias [Bug #17345]Nobuyoshi Nakada2020-12-161-1/+1
|
* Ripper: Refined error callbacks [Bug #17345]Nobuyoshi Nakada2020-12-152-10/+14
|
* Store all kinds of syntax errors [Bug #17345]Nobuyoshi Nakada2020-11-261-3/+29
|
* Removed a duplicate assertionNobuyoshi Nakada2020-11-261-1/+0
|
* Ripper.{lex,tokenize} return full tokens even if syntax errorNobuhiro IMAI2020-11-201-0/+8
| | | | yet another implements [Feature #17276]
* Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}Jeremy Evans2020-11-172-0/+10
| | | Implements [Feature #17276]
* ripper: Invalid pragma value warningNobuyoshi Nakada2020-11-021-0/+6
|
* Assoc pattern matching (#3703)Nobuyoshi Nakada2020-10-261-3/+3
| | | | | [Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead.
* Add a Ripper.lex test of :on_embexpr_endTakashi Kokubun2020-10-191-0/+7
| | | | | | | | | 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.
* Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada2020-10-121-6/+44
| | | | Also unwrap NODE_RIPPER to check the method name.
* Drop token info for endless method definitionNobuyoshi Nakada2020-06-251-4/+16
| | | | Because it does not have closing `end`.
* [ripper] added endless method definition event testsNobuyoshi Nakada2020-06-251-0/+10
|
* [ripper] fix mismatched indentations warning [Bug #16981]Nobuyoshi Nakada2020-06-241-0/+6
| | | | | The scanner location has to be set from `lex.ptok` before it is flushed by dispatching the scanner event.