aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: extract callback resultsnobu2017-10-031-23/+23
| | | | | | | | * parse.y: stripping wrapping NODEs from ripper callback results, when storing in Array objects. NODEs must not appear in Ruby level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set ripper event IDs to keyword variablesnobu2017-10-031-7/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set ripper event ID symbols to operatorsnobu2017-10-031-31/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext: check if null byte is containednobu2017-09-301-1/+1
| | | | | | [ruby-dev:50267] [Bug #13953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: moved duplicate conditionsnobu2017-09-261-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: token type by identifer ID typenobu2017-09-231-1/+2
| | | | | | | | * parse.y (parse_ident): leave identifier type decision (local or const) to rb_enc_symname_type, and set the token type by ID type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: missing semicolonnobu2017-09-231-0/+1
| | | | | | * parse.y (stmt_or_begin): fix missing semicolon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: literal term lex_statenobu2017-09-201-36/+32
| | | | | | | * parse.y (parser_string_term, parser_parse_string): move setting lex_state operations from parser_yylex per each token types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: lex by lvarnobu2017-09-191-1/+1
| | | | | | | * parse.y (parse_ident): disable tLPAREN_ARG state by local variable. [ruby-list:50578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper_lex_state_namenobu2017-09-181-0/+14
| | | | | | | | | | * parse.y (ripper_lex_state_name): represent lex_state as OR-ed form. * ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer::Elem#to_a): lex_state for inspection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use SET_LEX_STATEnobu2017-09-151-5/+4
| | | | | | | * parse.y (f_arglist, parser_yylex): set lex_state via SET_LEX_STATE macro for yydebug messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper: add states of scannernobu2017-09-141-0/+24
| | | | | | | | | | | * 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
* parse.y: [DOC] fix call-seq [ci skip]nobu2017-09-141-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce NODE_UNLESS for branch coveragemame2017-09-141-1/+12
| | | | | | | `unless` statement was a syntactic sugar for `if` statement, which made the result of branch coverage hard to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix the lineno of case statement that has no expressionmame2017-09-141-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refactor the internal data format for coverage measurementmame2017-09-031-3/+6
| | | | | | | | | | | To prepare new measuring targets: branch and method coverages. So far, iseq->coverage was an array of counts executed for line coverage. Now, it is a three-element array for each measuring target, whose first element is an array for line coverage. The second element is planned for branch coverage, and the third will be for method coverage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: primary should not be 0nobu2017-08-221-1/+1
| | | | | | | * parse.y (primary): should not be 0, since it can be a receiver. [ruby-core:82447] [Bug #13836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unexpected tINTEGER messagenobu2017-08-171-3/+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: removed useless checknobu2017-08-151-0/+1
| | | | | | | * parse.y (singleton): literal nodes are always value expressions, no check is necessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set used flag in gettablenobu2017-08-131-16/+20
| | | | | | | | | | | * 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
* separate hash literal and keyword argumentsnobu2017-08-111-0/+1
| | | | | | | | | * compile.c (compile_array_keyword_arg): separate keyword splat inside hash literal from argument list. * parse.y (rparen): flag hash literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: simplify parse_identnobu2017-08-011-25/+8
| | | | | | | * parse.y (parse_ident): simplified selecting identifier types by the suffix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: brace after array literal argnobu2017-07-261-1/+1
| | | | | | | | | * parse.y (parser_yylex): array is another literal. 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@59420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: limit codepoint lengthnobu2017-07-251-9/+8
| | | | | | | | * 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
* ripper: add kwrest_param parser eventrhe2017-07-211-0/+8
| | | | | | | | | | | | | | | * 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
* parse.y: empty hash in definednobu2017-07-201-1/+1
| | | | | | | | * parse.y (command): NODE_ARRAY with NULL is invalid. traversal in defined_expr0 is simplified than iseq_compile_each0. [ruby-core:82113] [Bug #13756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine literal error messagesnobu2017-07-171-14/+22
| | | | | | | | | | | | | * 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-10/+9
| | | | | | | | | | * 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 (numeric_literal_flush): fix typonobu2017-07-161-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: utf-8 codepointsnobu2017-07-161-23/+38
| | | | | | | | * 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
* parse.y: refine error messagesnobu2017-07-151-2/+5
| | | | | | | * 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: flush debug outputnobu2017-07-131-0/+1
| | | | | | | * parse.y (parser_compile_error): flush debug output before compile error message, to keep the order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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