aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_parse.rb
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: unexpected tINTEGER messagenobu2017-08-171-0/+3
| | | | | | | * parse.y (parser_number_literal_suffix): keep token after numeric suffix to show the value in an error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set used flag in gettablenobu2017-08-131-0/+3
| | | | | | | | | | | * parse.y (dvar_defined_ref, dvar_defined): rename macros. only gettable uses the former. assignable should not set LVAR_USED flag. * parse.y (gettable_gen): set used flag on local/dynamic variables instead of setting in lexer. [ruby-core:82368] [Bug #13809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: limit codepoint lengthnobu2017-07-251-0/+2
| | | | | | | | * parse.y (parser_tokadd_codepoint): limit Unicode codepoint length. too long codepoint has been split unexpectedly since r57050. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine literal error messagesnobu2017-07-171-3/+15
| | | | | | | | | | | | | * parse.y (parser_yyerror): strip newline in error source which will not be printed, when lex_p has passed it. * parse.y (parser_tokadd_utf8): unterminated Unicode escape even after invalid Unicode escape. * parse.y (parser_parse_string): show the error source line when unterminated literal at end of file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine invalid Unicode escape messagenobu2017-07-161-1/+4
| | | | | | | | | | * parse.y (literal_flush): rename from numeric_literal_flush, as it is not just for numerics now. * parse.y (parser_tokadd_codepoint): show invalid character position, but not the start of Unicode escape. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: utf-8 codepointsnobu2017-07-161-0/+3
| | | | | | | | * parse.y (parser_tokadd_utf8): skip spaces in the current line, without advancing the line, to get rid of dangling pointer. [ruby-core:82029] [Bug #13742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use assert_syntax_errornobu2017-07-161-12/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine error messagesnobu2017-07-151-4/+10
| | | | | | | * parse.y (parser_read_escape, parser_tok_hex): refine error messages. point from the backslash up to the invalid char. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix tokennobu2017-06-281-0/+8
| | | | | | | * parse.y (parser_parse_string): return proper token tREGEXP_END at unterminated regexp. [Bug #13363] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: add ellipsisnobu2017-06-281-0/+9
| | | | | | | * parse.y (parser_yyerror): add ellipsis properly when error line is truncated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: flush numeric tokennobu2017-06-281-0/+6
| | | | | | | * parse.y (parser_number_literal_suffix, parse_numeric): flush numeric token so following unexpected token part is marked. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix parser_yyerrornobu2017-06-281-0/+6
| | | | | | | * parse.y (parser_yyerror): fix buffer overflow at truncation of error line. [ruby-core:81790] [Bug #13687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: should not warn op method callnobu2017-06-231-0/+1
| | | | | | | * parse.y (void_expr_gen): should warn operator expression style calls only, but not method style calls. [Fix GH-1660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: check multibyte charnobu2017-06-231-0/+2
| | | | | | | | * parse.y (parser_precise_mbclen): check invalid multibyte char at skipping strings following `?x` literal string, not to stuck in a infinite loop. [ruby-core:81746] [Bug #13672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: make shared string modifiablenobu2017-05-041-0/+10
| | | | | | | | * parse.y (dedent_string): ensure that the string is modifiable, not to set the length of shared string. [ruby-core:80987] [Bug #13540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: sign-extendnobu2017-04-291-0/+10
| | | | | | | | | * node.h (nd_line): should sign-extend. shifting `VALUE` extends with zero bits if `sizeof(VALUE)` equals to `sizeof(int)`. the zero bits are truncated if `sizeof(VALUE)` is bigger enough. [ruby-core:80920] [Bug #13523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix line in rescuenobu2017-04-281-0/+13
| | | | | | | * parse.y (set_line_body, primary): fix line number of bodystmt as the beginning of the block. [ruby-core:79388] [Bug #13181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: args tail at errornobu2017-04-241-0/+7
| | | | | | | | * parse.y (new_args_tail_gen): abandon parsing arguments after error. reported by ilsani Martino Sani (ilsani) at https://hackerone.com/reports/221201 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix yyerror messagenobu2016-12-141-0/+5
| | | | | | | * parse.y (parser_yyerror): show the error line even if the error is at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: zero codepointsnobu2016-12-111-3/+0
| | | | | | | * parse.y (parser_tokadd_utf8): relax restriction to allow zero or more codepoints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue modifier in rhs of op asgnnobu2016-08-131-6/+78
| | | | | | | * parse.y (stmt, arg): rescue modifier in command op assignment should be limited to rhs only. [ruby-core:75621] [Bug #12402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue modifier in rhsnobu2016-08-101-0/+10
| | | | | | | * parse.y (command_asgn): rescue modifier in command assignment should be limited to rhs only. [ruby-core:75621] [Bug #12402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: no named capture conflict warningsnobu2016-06-131-2/+2
| | | | | | | | * parse.y (reg_named_capture_assign_iter): remove named capture conflict warnings. it is just annoying rather than useful. [ruby-core:75416] [Bug #12359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: massign in condnobu2016-04-131-1/+1
| | | | | | | * parse.y (assign_in_cond): allow multiple assignment in conditional expression. [Feature #10617] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54558 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
* 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
* parse.y: optional superclassnobu2015-08-111-2/+2
| | | | | | | * parse.y (superclass): make superclass rule optional and allow any contents without a terminator. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parse.rb: move assertionsnobu2015-05-221-20/+0
| | | | | | | | | | | * test/ruby/test_module.rb (test_remove_class_variable): move an assertion for Module#remove_class_variable from test_parse.rb. * test/ruby/test_symbol.rb (test_intern, test_all_symbols): move assertions for Symbol#intern and Symbol.all_symbols from test_parse.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine message for gvar w/o identitirsnobu2015-05-131-0/+19
| | | | | | | * 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
* test_parse.rb: fix variable namenobu2015-05-131-1/+1
| | | | | | | * test/ruby/test_parse.rb (test_dstr_disallowed_variable): fix duplicate variable name to be tested. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: disable past scope warningsnobu2014-12-311-0/+2
| | | | | | | | * parse.y (gettable_gen): disable warnings of possible reference to a local variable defined in a past scope. [ruby-core:67162] [Bug #10661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn past scope variablenobu2014-12-251-0/+4
| | | | | | | * parse.y (gettable_gen): warn possible reference to a local variable defined in a past scope. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: invalid instance/class variable namesnobu2014-11-011-0/+2
| | | | | | | | * parse.y (parse_atmark): mere atmark and two atmarks without succeeding identifiers are invalid as instance/class variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: preserve encodingsnobu2014-08-131-0/+6
| | | | | | | | * parse.y (shadowing_lvar, warn_unused_var), (reg_named_capture_assign_iter): preserve encodings in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parse.rb: for warningsnobu2014-08-131-0/+14
| | | | | | * test/ruby/test_parse.rb (TestParse): add tests for parser warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix invalid char in evalnobu2014-08-071-1/+4
| | | | | | | | * parse.y (parser_yylex): fix invalid char in eval, should raise an syntax error too, as well as directly coded. [ruby-core:64243] [Bug #10117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby: get rid of warnings.usa2014-03-051-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: better assertionsnobu2013-12-131-1/+1
| | | | | | * test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpauth/digestauth.rb: Fix typo in an error message.a_matsuda2013-11-291-1/+1
| | | | | | | | * test/ruby/test_parse.rb: Fix typo in a test name. s/allowd/allowed/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix test failure to follow r42347 ref #3753naruse2013-08-031-7/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: invalid name as mere stringnobu2013-05-101-4/+17
| | | | | | | | * parse.y (parser_peek_variable_name): treat invalid global, class, and instance variable names as mere strings rather than errors. [ruby-core:54885] [Bug #8375] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* scoped constant op-assignmentnobu2012-12-241-1/+3
| | | | | | | | | * node.h (NODE_OP_CDECL), compile.c (iseq_compile_each), parse.y (stmt, arg): allow scoped constant op-assignment. [ruby-core:40154] [Bug #5449] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): set default source encoding asnaruse2012-11-061-0/+1
| | | | | | | | | UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r37326 "remove string literal concatenation"nobu2012-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove string literal concatenationnobu2012-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_parse.rb: eval locationsnobu2012-09-151-58/+58
| | | | | | * test/ruby/test_parse.rb: set eval locations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix argument ordernobu2012-03-161-1/+1
| | | | | | | * test/ruby/test_parse.rb (test_void_expr_stmts_value): expected value comes first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): point method name line. [ruby-core:40936]nobu2011-12-131-0/+14
| | | | | | | [Bug #5614] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_tokadd_utf8, parser_tokadd_string): allow NULnobu2010-05-291-6/+8
| | | | | | | | containing symbol literals, as well as String#to_sym. [ruby-dev:41447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): abandoned EXPR_VCALL.nobu2010-04-211-24/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e