aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: f_margs parser eventsnobu2017-07-011-6/+6
| | | | | | | * 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-6/+5
| | | | | | | * 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
* parse.y: fix tokennobu2017-06-281-5/+7
| | | | | | | * 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-21/+17
| | | | | | | * 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-8/+10
| | | | | | | * 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: prefer enum yytokentype instead to intnobu2017-06-281-23/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: line number of bin opnobu2017-06-261-1/+4
| | | | | | | * parse.y (call_bin_op_gen): adjust line number to the receiver, instead of the rhs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: mark error tokennobu2017-06-261-14/+21
| | | | | | | | | | | | | | | | | | | * parse.y (parser_yyerror): mark the whole last token which caused the error, not only the end. before: ``` if end ^ ``` after: ``` if end ^~~ ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: should not warn op method callnobu2017-06-231-3/+3
| | | | | | | * 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-7/+15
| | | | | | | | * 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: brace after literal argnobu2017-05-091-4/+6
| | | | | | | | | | * parse.y (symbol, dsym, parser_set_number_literal, parser_yylex): set state to END too not only ENDARG and after a literal, so that a left brace after it should be a primary block bound to the literal, which causes syntax error. [ruby-core:81037] [Bug #13547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: do after cmdarg in parennobu2017-05-091-1/+1
| | | | | | | | | * parse.y (parser_yylex): set state to ENDARG after a string literal, so that `do` after a literal should be `do_block` and bound to the outer method, as well as a numeric/symbol literal. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: export rb_parser_fatal for rippernobu2017-05-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: make shared string modifiablenobu2017-05-041-1/+5
| | | | | | | | * 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
* parse.y: set_line_body is not used in rippernobu2017-04-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix line in rescuenobu2017-04-281-3/+17
| | | | | | | * 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/+1
| | | | | | | | * 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: rb_parser_fatalnobu2017-04-241-90/+158
| | | | | | | | | * parse.y (rb_parser_fatal): abort compilation on internal parser error. rb_bug() is generic use but not useful for debugging the parser. this function dumps internal states, and continues with enabling yydebug output to stderr for the parser stack dump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of unnecessary GCC extensionnobu2017-04-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix compile_error formatnobu2017-04-221-3/+3
| | | | | | | | | * parse.y (ripper_compile_error, parser_compile_error): declare as PRINTF_ARGS attribute. * parse.y (id_is_var_gen): fix format specifier for string value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix for empty `__VA_ARGS__`nobu2017-04-171-2/+2
| | | | | | | | * parse.y (WARN_CALL, WARNING_CALL): need `##` between a comman and `__VA_ARGS__` in the case it is empty, not to end arguments with a comma. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: check argc to rb_funcallnobu2017-04-151-0/+8
| | | | | | | * include/ruby/ruby.h (rb_funcall): check if argc matches the number of variadic arguments, and replace with rb_funcallv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ID for logopnobu2017-04-051-7/+7
| | | | | | * parse.y (logop): use ID instead of token values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use idGE for tGEQnobu2017-04-041-1/+1
| | | | | | | * parse.y (arg): use ID directly for '>=' operator, without TOKEN2ID macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: share with rippernobu2017-04-041-9/+12
| | | | | | | * parse.y (rb_parser_trace_lex_state, rb_parser_show_bitstack): share with ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: flush debug buffernobu2017-04-041-7/+24
| | | | | | | * parse.y (rb_parser_trace_lex_state, rb_parser_show_bitstack): flush debug buffer before traces of lex_state and bitstack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: dot_or_colonnobu2017-03-291-10/+2
| | | | | | | * parse.y (dot_or_colon): use the default action without type casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unterminated content tokennobu2017-03-261-7/+6
| | | | | | | | * 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-1/+0
| | | | | | | | * 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
* parse.y: relax `&' warningnobu2017-03-131-1/+6
| | | | | | | | * parse.y (parser_yylex): disable "`&' interpreted as argument prefix" warning when just followed by a symbol literal. [ruby-core:79926] [Misc #13283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove tracenobu2017-03-071-1/+1
| | | | | | | | * parse.y (reg_named_capture_assign_iter): do not insert trace instructions before local variable assinments. putobject is expected at first. [ruby-core:79940] [Bug #13287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* kwrest arg namenobu2017-02-271-2/+2
| | | | | | | | | | * compile.c (iseq_set_arguments_keywords): make keyword rest argument name nd_vid consistently, regardless of whether other keyword arguments are present. [Fix GH-1529] * parse.y (new_args_tail_gen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: indent at invalid identifiernobu2017-02-261-3/+5
| | | | | | | | * parse.y (parser_heredoc_identifier): set indent only when valid identifier, not to dedent non-existent contents later. [ruby-core:79772] [Bug #13253] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Cast as VALUE to suppress type warningsnaruse2017-02-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* They are enum yytokentype, need castnaruse2017-02-201-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: new_qcallnobu2017-02-201-83/+51
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ID2VALnobu2017-02-201-12/+14
| | | | | | * parse.y (ID2VAL): split from TOKEN2VAL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper_intern is no longer usednobu2017-02-121-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: logopnobu2017-02-121-21/+8
| | | | | | | | | * defs/id.def (predefined): add keywords `and` and `or`. * parse.y (log_op): unify parser and ripper, and use tokens instead of node types and symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: call_bin_opnobu2017-02-121-100/+13
| | | | | | | * parse.y (call_bin_op): unify parser and ripper, and use IDs instead of tokens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: call_uni_opnobu2017-02-121-37/+15
| | | | | | | | | * defs/id.def (predefined): add keyword `not`. * parse.y (call_uni_op): unify parser and ripper, and use IDs instead of tokens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper: fix %-op on_operator_ambiguousnobu2017-02-121-22/+16
| | | | | | | | | * 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
* parse.y: TOKEN2IDnobu2017-02-111-148/+53
| | | | | | | | | * parse.y (TOKEN2ID): add macro which maps static tokens to IDs. * template/id.h.tmpl (TOKEN2*ID, DEFINE_*ID_FROM_TOKEN): separate into macros, token to ID mapping and enum definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix idCOLON2nobu2017-02-091-1/+1
| | | | | | | | * defs/id.def: remove idDSTAR and idCOLON3. * parse.y (tCOLON2): make same as id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: named caputre into match_op_gennobu2017-02-081-7/+4
| | | | | | | * parse.y (match_op_gen): move making named capture assignment nodes. remove repeated conditions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): remove wrong warningnobu2017-01-241-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue/else/ensure in do-endnobu2017-01-191-1/+1
| | | | | | | * parse.y (do_body): allow rescue/else/ensure inside do/end blocks. [Feature #12906] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: chomp by -lnobu2017-01-191-3/+3
| | | | | | | * parse.y (rb_parser_while_loop): should chomp but not chop by -l option. [ruby-core:78099] [Bug #12926] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: warn spacenobu2017-01-191-0/+7
| | | | | | * parse.y (parser_yylex): warn parentheses after space. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e