aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: indent at '#'nobu2017-10-191-0/+20
| | | | | | | * parse.y (parser_here_document): update indent at '#', which is not a space. [ruby-core:83368] [Bug #14032] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lexer.rb: no dedent strings in middlenobu2017-10-191-0/+19
| | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): dedent only strings at the beginning, not strings in middle. [ruby-core:83343] [Bug #14027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix a typonobu2017-10-081-0/+14
| | | | | | | * parse.y (f_kw): fix typo. needs the argument value, not the label twice. [ruby-core:83174] [Bug #13987] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix KWD2EIDnobu2017-10-051-0/+9
| | | | | | | * parse.y (KWD2EID): should respect the previous callback result for keywords. [ruby-core:83106] [Bug #13971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix var_fieldnobu2017-10-041-18/+39
| | | | | | | | | | | | | | | | * parse.y (mlhs_node): dispatch var_field as well as lhs. * parse.y (lhs, var_hs): dispatch var_field before assignable check so it is inside assign_error at a wrong assignment, as well as backref_assign_error. * parse.y (var_field_gen): wrap var_field value with the variable ID. * parse.y (assignable_gen, const_decl_gen): return the callback result on a syntax error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_sexp.rb: test for fnamenobu2017-10-041-0/+12
| | | | | | | * test/ripper/test_sexp.rb (test_def_fname): test for fname in def statement. [ruby-core:83089] [Bug #13967] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parser_events.rb: backref_assign_errornobu2017-10-031-2/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper: add states of scannernobu2017-09-143-49/+64
| | | | | | | | | | | * parse.y (ripper_state): add states of scanner to tokens from Ripper.lex and Ripper::Filter#on_*. based on the patch by aycabta (Code Ahss) at [ruby-core:81789]. [Feature #13686] * ext/ripper/tools/preproc.rb (prelude, usercode): generate EXPR_* constants from enums. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper: add kwrest_param parser eventrhe2017-07-212-1/+14
| | | | | | | | | | | | | | | * parse.y (f_kwrest): Dispatch kwrest_param event. This is especially useful for unnamed kwrest parameter for which we expose the internal ID currently. [ruby-core:75528] [Feature #12387] * test/ripper/dummyparser.rb (on_kwrest_param): Add handler for kwrest_param parser event. * test/ripper/test_parser_events.rb (test_params): Adapt to the change in DummyParser. (test_kwrest_param): Test that kwrest_param event handler is called. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_lexer.rb: require ripper directlyyui-knk2017-07-151-1/+1
| | | | | | | | * test/ripper/test_lexer.rb: This file does not use DummyParser, so requiring ripper directly instead of requiring dummyparser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lexer.rb: ignore dedented spacenobu2017-07-061-0/+19
| | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): replace an empty string content because of dedentation with :on_ignored_sp. an empty token makes the sorted order unstable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: f_margs parser eventsnobu2017-07-012-0/+93
| | | | | | | * parse.y (f_margs): implemented parser events for massign formal arguments. [ruby-core:81848] [Bug #13701] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: mlhs_add_postnobu2017-07-011-4/+27
| | | | | | | * parse.y (mlhs_add_post): new parser event corresponding to POSTARG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parser_events.rb: simplifynobu2017-07-012-5/+38
| | | | | | | | | | * test/ripper/dummyparser.rb (DummyParser): simplified mlhs node representation. * test/ripper/test_parser_events.rb (test_mlhs_add_star): simplified assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper/lexer.rb: nested indented heredocnobu2017-05-062-0/+12
| | | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert stripped leading spaces as `on_ignored_sp` elements, so that the original source can be reconsructed. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper/lexer.rb: nested indented heredocnobu2017-05-021-0/+24
| | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for nested indedented here documents, where `Elem`s are nested too. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unterminated content tokennobu2017-03-261-0/+3
| | | | | | | | * parse.y (parser_parse_string): defer the end token to next reading, to yield tSTRING_CONTENT with the unterminated content. [Bug #13363] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* keep line number after unterminated string literalnobu2017-03-251-0/+2
| | | | | | | | * parse.y (parser_parse_string): keep line number even after an unterminated string literal. it does not matter in the parser, ripper needs this value after this error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper: fix %-op on_operator_ambiguousnobu2017-02-121-1/+7
| | | | | | | | | * parse.y (ambiguous_operator): separate token and string representation of operators, to fix %-operator argument. in a warning message, needs to be escaped by '%' but the symbol should not be. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {ext,test}/ripper: Specify frozen_string_literal: true.kazu2017-02-057-14/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper generic inputnobu2016-12-081-0/+18
| | | | | | | * parse.y (ripper_initialize): allow generic input as source, if it has #gets method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_files.rb: sample sizenobu2016-11-101-1/+3
| | | | | | | * test/ripper/test_files.rb (assert_parse_files): extract at least one sample. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_files.rb: separate testsnobu2016-11-101-9/+33
| | | | | | | * test/ripper/test_files.rb (assert_parse_files): separate tests for each directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ripper/test_ripper.rb: fix squiggly heredoc identifierkazu2016-09-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ripper/test_ripper.rb: add a test for dedent_string.headius2016-09-261-0/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reg_fragment_enc_errornobu2016-08-031-0/+26
| | | | | | | * parse.y (reg_fragment_enc_error): compile_error is different between parser and ripper. [ruby-core:76397] [Bug #12651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix Ripper.lex error in dedenting squiggly heredocnobu2016-02-021-0/+6
| | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix Ripper.lex error in dedenting squiggly heredoc. heredoc tree is also an array of Elem in the outer tree. [Fix GH-1234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r53431 "temporally revert r53411 to debug"naruse2016-01-041-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* temporally revert r53411 to debugnaruse2016-01-041-12/+0
| | | | | | http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20151225T162507Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use nd_tagnobu2016-01-022-2/+13
| | | | | | | * parse.y (regexp): set_yylval_num sets u1, should use nd_tag instead of nd_state. [ruby-core:72638] [Bug #11932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r53409 "parse.y: yylval.num should be u3"naruse2016-01-021-11/+0
| | | | | | It introduces SEGV git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: yylval.num should be u3nobu2016-01-021-0/+11
| | | | | | | * parse.y (set_yylval_num): should be used as nd_state, set to u3. [ruby-core:72638] [Bug #11932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-166-1/+7
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: indented hereocnobu2015-12-072-0/+48
| | | | | | * parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: last content of heredocnobu2015-11-281-0/+5
| | | | | | | * parse.y (parser_here_document): store dispatched result of on_tstring_content at the last fragment of a here document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parser_events.rb: suppress a warningnobu2015-11-271-1/+1
| | | | | | | | * test/ripper/test_parser_events.rb (test_warn_cr_in_middle): remove unused variable to suppress assigned-but-unused-variable warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper for warningsnobu2015-11-241-0/+6
| | | | | | | * parse.y (parser_yylex): deal with magic comment warnings also in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* change DOTQnobu2015-11-062-9/+9
| | | | | | | * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ from ".?" to "&.". [ruby-core:71363] [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix op_assign typenobu2015-10-281-0/+10
| | | | | | | * parse.y (new_attr_op_assign): fix op_assign type, which is already an ID since r52284. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parser_events.rb: event tokennobu2015-10-281-13/+26
| | | | | | | * test/ripper/test_parser_events.rb (test_opassign): test parsed event tokens too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: call_op2nobu2015-10-261-1/+16
| | | | | | | * parse.y (call_op2): separate from call_op and also allow "::", while dot_or_colon should not allow ".?". [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c: dotq in rippernobu2015-10-251-0/+2
| | | | | | * symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix ripper warningsnobu2015-10-141-0/+21
| | | | | | | | | * parse.y (parser_nextc): send a warning to ripper, not to STDERR always. * parse.y (rb_warn1, rb_warning1): move argument conversions to callers. PRIsVALUE is not valid in String#%. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix tokennobu2015-09-241-0/+29
| | | | | | | * parse.y (paren_args): fix separator token at `foo::bar()` in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine message for gvar w/o identitirsnobu2015-05-131-0/+3
| | | | | | | * parse.y (parse_gvar): separate message for gvar without non-space characters from message for invalid identitirs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix f_label resultnobu2015-01-041-3/+19
| | | | | | | * parse.y (f_label): return tLABEL value as it is. [ruby-core:67315] [Bug #10693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: preserve tSTRING_CONTENT resultsnobu2014-12-011-0/+3
| | | | | | | * parse.y (ripper_flush_string_content): preserve the dispatched results at tSTRING_CONTENT. [ruby-dev:48714] [Bug #10437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: enable encoding pragma in rippernobu2014-12-011-0/+3
| | | | | | | * parse.y (magic_comment_encoding): enable in ripper, since the encoding is necessary to parse non-default encoding scripts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix a typonobu2014-11-301-0/+20
| | | | | | | * parse.y (regexp_contents): fix a typo. pointed out by wanabe. [ruby-dev:48741] [Bug #10543] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dummyparser.rb: on_rescuenobu2014-11-222-2/+14
| | | | | | | | | | * test/ripper/dummyparser.rb (on_rescue): add to turn exception class list into NodeList, to test exception class list. * test/ripper/test_parser_events.rb (test_rescue_class): add missing test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e