summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
AgeCommit message (Collapse)Author
2016-03-16parse.y: symbol literals for alias/undefnobu
* 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
2016-02-19test/ruby: suppress runtime warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-19test/ruby: suppress parser warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-15parse.y: kwarg to method with same name variablenobu
* 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
2016-01-18parse.y: escaped newline in dedenting heredocnobu
* 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
2016-01-17test_syntax.rb: try allnobu
* 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
2016-01-16parse.y: should not deent concatenated stringnobu
* 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
2016-01-15parse.y: should not deent concatenated stringnobu
* 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
2015-12-31parse.y: single-quote indented heredocnobu
* 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
2015-12-20test_syntax.rb: assertions for other heredocsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-20parse.y: labeled heredocnobu
* 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
2015-12-16Add frozen_string_literal: false for all filesnaruse
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
2015-12-13* test/ruby/test_syntax.rb: fix typo in testyugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13* parse.y (parse_percent): Allow %-literals in labeled arg asyugui
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
2015-12-07parse.y: indented hereocnobu
* parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-22compile.c: move logop DCEnobu
* 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
2015-11-12parse.y: ANDDOT fluent interfacenobu
* 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
2015-11-06parse.y: fix segv after invalid keyword argumentnobu
* 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
2015-11-01parse.y: invalid symbolnobu
* 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
2015-09-26test_syntax.rb: splitnobu
* 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
2015-08-18parse.y: fix labelargnobu
* 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
2015-08-17parse.y: fix block after conditionalnobu
* 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
2015-07-23parse.y: pop cmdargnobu
* 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
2015-05-29parse.y: check NTH_REF rangenobu
* 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
2015-04-30parse.y: %-string cannot be a labelnobu
* 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
2015-04-30parse.y: push cmdarg_stacknobu
* 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
2015-04-12parse.y: null by syntax errornobu
* 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
2015-03-13parse.y: empty parennobu
* 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
2015-01-09parse.y: eliminate empty hashesnobu
* 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
2014-12-14parse.y: warn reference after method definitionnobu
* 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
2014-12-03iseq.c: avoid segfault on incomplete iseqnormal
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
2014-11-26parse.y: fix invalid keyword argumentnobu
* 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
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* 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
2014-10-29parse.y: reset current_arg after block varnobu
* 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
2014-10-29parse.y: warn iside a blocknobu
* 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
2014-10-29parse.y: warn circular argument referencenobu
* 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
2014-10-12parse.y: should not eliminate value nodesnobu
* 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
2014-10-11vm.c: precedence of duplicated keysnobu
* 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
2014-10-11parse.y: precedence of duplicated keysnobu
* 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
2014-10-08* test/ruby/test_syntax.rb: added syntax tests of underscore arguments.hsbt
[Feature #10340][ruby-core:65496] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09test_syntax.rb: fix tempfile leaksnobu
* 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
2014-08-06parse.y: preserve encodingnobu
* 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
2014-06-10envutil.rb: use keyword argumentnobu
* 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
2014-05-27parse.y: refine error messagenobu
* 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
2014-04-19parse.y: allow parenthesed do-block in cmdargnobu
* 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
2014-03-05parse.y: optional arguments in rhsnobu
* 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
2013-12-27parse.y: save cmdarg_stack in local scopenobu
* 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
2013-08-26parse.y: warn CRnobu
* 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
2013-08-12parse.y: CR in middlenobu
* 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
2013-08-02* vm.c (m_core_define_method, m_core_define_singleton_method): nowusa
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