aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: symbol literals for alias/undefnobu2016-03-161-0/+24
| | | | | | | | * defs/keywords (alias, undef): symbol literals are allowed. * parse.y (parse_percent): should parse symbol literals for alias and undef. [ruby-dev:47681] [Bug #8851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress runtime warningsnobu2016-02-191-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress parser warningsnobu2016-02-191-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: kwarg to method with same name variablenobu2016-02-151-0/+7
| | | | | | | | * parse.y (parse_ident): allow keyword arguments just after a method where the same name local variable is defined. [ruby-core:73816] [Bug#12073] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: escaped newline in dedenting heredocnobu2016-01-181-0/+9
| | | | | | | | * parse.y (parser_here_document): an escaped newline is not an actual newline, and the rest part should not be dedented. [ruby-core:72855] [Bug #11989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: try allnobu2016-01-171-4/+7
| | | | | | | * test/ruby/test_syntax.rb (assert_dedented_heredoc): try all terminators regardless failures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: should not deent concatenated stringnobu2016-01-161-1/+13
| | | | | | | | * parse.y (xstring): reset heredoc indent after dedenting, so that following string literal would not be dedented. [ruby-core:72857] [Bug #11990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: should not deent concatenated stringnobu2016-01-151-0/+9
| | | | | | | | * parse.y (string1): reset heredoc indent fore each string leteral so that concatenated string would not be dedented. [ruby-core:72857] [Bug #11990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: single-quote indented heredocnobu2015-12-311-58/+58
| | | | | | | | * parse.y (parser_here_document): update indent for each line in indented here document with single-quotes. [ruby-core:72479] [Bug #11871] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: assertions for other heredocsnobu2015-12-201-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: labeled heredocnobu2015-12-201-0/+6
| | | | | | | * parse.y (parser_yylex): allow here documents in labeled argument. [ruby-core:72396] [Bug #11849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | 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
* * test/ruby/test_syntax.rb: fix typo in testyugui2015-12-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parse_percent): Allow %-literals in labeled arg asyugui2015-12-131-0/+6
| | | | | | | r51624 did for parentheses. Fixes [ruby-core:72084] [Bug #11812]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: indented hereocnobu2015-12-071-0/+88
| | | | | | * parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: move logop DCEnobu2015-11-221-0/+12
| | | | | | | | | * compile.c (iseq_peephole_optimize): remove unreachable code chunk after jump/leave. * parse.y: move dead code elimination of logical operation to compile.c. not to warn logical operation of literal constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ANDDOT fluent interfacenobu2015-11-121-0/+5
| | | | | | | | * parse.y (parser_yylex): ANDDOT at the head of the line denote line continuation from previous one to support fluent interface, as well as single dot. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix segv after invalid keyword argumentnobu2015-11-061-0/+10
| | | | | | | | * parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: invalid symbolnobu2015-11-011-0/+6
| | | | | | | * parse.y (parser_yylex): ':' separated by a comment and a newline is not valid as symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: splitnobu2015-09-261-2/+11
| | | | | | | * test/ruby/test_syntax.rb (test_keyword_splat): split duplicate keywords tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix labelargnobu2015-08-181-0/+6
| | | | | | | * parse.y (IS_BEG): include labeled argument state, which was EXPR_LABELARG. [ruby-dev:49221] [Bug #11456] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix block after conditionalnobu2015-08-171-0/+6
| | | | | | | | * parse.y: fix syntax error at do-block after a conditional operator. separate label-allowed and after-a-label states from others as bit flags. [ruby-dev:48790] [Bug #10653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: pop cmdargnobu2015-07-231-0/+5
| | | | | | | * parse.y (lambda_body): pop cmdarg stack for lookahead token. [ruby-core:70067] [Bug #11380] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: check NTH_REF rangenobu2015-05-291-0/+7
| | | | | | | | | | * compile.c (iseq_compile_each): out of range NTH_REF is always nil. * parse.y (parse_numvar): check overflow of NTH_REF and range. [ruby-core:69393] [Bug #11192] * util.c (ruby_scan_digits): make public and add length parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: %-string cannot be a labelnobu2015-04-301-0/+9
| | | | | | | * parse.y (parser_yylex): %-string cannot be a label even if terminated by single/double quotes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: push cmdarg_stacknobu2015-04-301-0/+5
| | | | | | | * parse.y (lambda): push and reset cmdarg_stack in lambda body. [ruby-core:69017] [Bug #11107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: null by syntax errornobu2015-04-121-0/+2
| | | | | | | * parse.y (arg): fix segfault by null caused by syntax error. [ruby-core:68851] [Bug #10957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: empty parennobu2015-03-131-0/+6
| | | | | | | * parse.y (primary): empty parentheses at cmdarg can be null. [ruby-core:68477] [Bug #10957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: eliminate empty hashesnobu2015-01-091-0/+7
| | | | | | | | * parse.y (assocs, assoc): eliminate splatting empty literal hashes. [ruby-core:67446] [Bug #10719] * compile.c (compile_array_): supprt splatted hash in hash type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn reference after method definitionnobu2014-12-141-0/+10
| | | | | | | | * parse.y (primary): restore current_arg so that circular reference after a method definition is also warned. [ruby-core:61299] [Bug #9593] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: avoid segfault on incomplete iseqnormal2014-12-031-0/+4
| | | | | | | | | | | Compile failures will trigger iseq_free before iseq->callinfo_entries are allocated at all. * iseq.c (iseq_free): avoid segfault on incomplete iseq * test/ruby/test_syntax.rb (test_invalid_next): new test for syntax error, not segfault git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix invalid keyword argumentnobu2014-11-261-0/+6
| | | | | | | | * parse.y (f_label, f_kw, formal_argument_gen): ignore invalid formal argument in keyword argument definition. [ruby-dev:48742] [Bug #10545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-2/+1
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reset current_arg after block varnobu2014-10-291-0/+10
| | | | | | | | * parse.y (block_param_def): reset current_arg after block parameter definition, not to warn references in that block body. [ruby-core:65990] [Bug #10314] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn iside a blocknobu2014-10-291-0/+40
| | | | | | | * parse.y (gettable_gen): also warn circular argument reference even inside a block. [ruby-core:65990] [Bug #10314] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn circular argument referencenobu2014-10-291-4/+12
| | | | | | | * parse.y (gettable_gen): warn circular argument reference, for transition from 2.1 and earlier. [ruby-core:65990] [Bug #10314] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: should not eliminate value nodesnobu2014-10-121-0/+15
| | | | | | | | * parse.y (remove_duplicate_keys): should not simply eliminate all value nodes, which may have side effects. [ruby-core:65625] [Bug #10315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c: precedence of duplicated keysnobu2014-10-111-4/+4
| | | | | | | * vm.c (kwmerge_i): override existing keys by new keys. [ruby-core:65368] [Bug #10315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: precedence of duplicated keysnobu2014-10-111-0/+4
| | | | | | | | * parse.y (assocs): concatenate splatted literal hashes. the former key has precedence even if duplicated literal keys follow. [ruby-core:65368] [Bug #10315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_syntax.rb: added syntax tests of underscore arguments.hsbt2014-10-081-0/+11
| | | | | | [Feature #10340][ruby-core:65496] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: fix tempfile leaksnobu2014-08-091-2/+4
| | | | | | | * test/ruby/test_syntax.rb (test_must_ascii_compatible), (test_script_lines): ensure to close temporary files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: preserve encodingnobu2014-08-061-0/+6
| | | | | | | * parse.y (parser_yyerror): preserve source code encoding in syntax error messages. [ruby-core:64228] [Bug #10114] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* envutil.rb: use keyword argumentnobu2014-06-101-3/+3
| | | | | | * test/ruby/envutil.rb (assert_valid_syntax): use keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine error messagenobu2014-05-271-0/+9
| | | | | | | * parse.y (parser_number_literal_suffix): refine error message for extra dot and digits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: allow parenthesed do-block in cmdargnobu2014-04-191-0/+5
| | | | | | | | * parse.y (primary): flush cmdarg flags inside left-paren in a command argument, to allow parenthesed do-block as an argument without arguments parentheses. [ruby-core:61950] [Bug #9726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: optional arguments in rhsnobu2014-03-051-0/+24
| | | | | | | | * parse.y (f_arg_asgn): define optional arguments as argument variables in the rhs default expressions. [ruby-core:61299] [Bug #9593] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: save cmdarg_stack in local scopenobu2013-12-271-0/+5
| | | | | | | | * parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to isolate command argument state from outer scope. [ruby-core:59342] [Bug #9308] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn CRnobu2013-08-261-0/+7
| | | | | | | * parse.y (parser_nextc): warn carriage return in middle of line. [ruby-core:56240] [Feature #8699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: CR in middlenobu2013-08-121-0/+8
| | | | | | | * parse.y (parser_whole_match_p): treat CR in middle of a line as a mere whitespace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (m_core_define_method, m_core_define_singleton_method): nowusa2013-08-021-0/+7
| | | | | | | | | | | | the value of def-expr is the Symbol of the name of the method, not nil. ref. [ruby-dev:42151] [Feature #3753] * test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e