aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* Fix parsing of mutiple assignment with rescue modifierJeremy Evans2019-08-091-0/+9
| | | | | | | | | | | | | | | | | | | Single assignment with rescue modifier applies rescue to the RHS: a = raise rescue 1 # a = (raise rescue 1) Previously, multiple assignment with rescue modifier applied rescue to the entire expression: a, b = raise rescue [1, 2] # (a, b = raise) rescue [1, 2] This makes multiple assignment with rescue modifier consistent with single assignment with rescue modifier, applying rescue to the RHS: a, b = raise rescue [1, 2] # a, b = (raise rescue [1, 2]) Implements [Feature #8239] Fixes [Bug #8279]
* Revert "Revert "Fix dangling path name from fstring""Takashi Kokubun2019-08-041-2/+2
| | | | | | | | | | | | This reverts commit 326c00b6f89e1c86e6fe29ab60da593eb6883a88. We also confirmed that test_gced_eval_location fails without the changes: https://travis-ci.org/ruby/ruby/builds/567417818 https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20190804T000003Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20190804T003005Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20190804T000007Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-master/log/20190804T001806Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian9/ruby-master/log/20190804T003005Z.fail.html.gz
* Revert "Fix dangling path name from fstring"Takashi Kokubun2019-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5931857281ce45c1c277aa86d1588119ab00a955 temporarily, leaving `TestEval#test_gced_eval_location` to see the impact for missing the changes. That's because too many CIs are failing for `require` behaviors: http://rubyci.s3.amazonaws.com/freebsd11zfs/ruby-master/log/20190803T063004Z.fail.html.gz http://rubyci.s3.amazonaws.com/unstable10x/ruby-master/log/20190803T051806Z.fail.html.gz http://rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190803T052406Z.fail.html.gz http://rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20190803T111909Z.fail.html.gz http://rubyci.s3.amazonaws.com/unstable11s/ruby-master/log/20190803T062506Z.fail.html.gz http://rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190803T052505Z.fail.html.gz https://app.wercker.com/ruby/ruby/runs/mjit-test1/5d4512c921ca08000857936a?step=5d451305c2809c0008a3da76 https://app.wercker.com/ruby/ruby/runs/mjit-test2/5d4512c921ca080008579371?step=5d4513000421020007ca122d http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/2177591 http://ci.rvm.jp/results/trunk_gcc6@silicon-docker/2177596 http://ci.rvm.jp/results/trunk_clang_60@silicon-docker/2178802 http://ci.rvm.jp/results/trunk-theap-asserts@silicon-docker/2177555 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2178747 Mostly `TestRequire#test_race_exception` failures, but in ci.rvm.jp `require` inside rubyspec hangs very often.
* Fix dangling path name from fstringNobuyoshi Nakada2019-08-031-2/+2
| | | | | | | | * parse.y (yycompile): make sure in advance that the `__FILE__` object shares a fstring, to get rid of dangling path name. Fixed up 53e9908d8afc7f03109b0aafd1698ab35f512b05. [Bug #16041] * vm_eval.c (eval_make_iseq): ditto.
* Show the location of `eval` which uses `__FILE__`/`__LINE__`Nobuyoshi Nakada2019-08-031-2/+8
|
* parse.y: make a warning for __FILE__ in eval by defaultYusuke Endoh2019-08-021-1/+1
| | | | [Bug #4352]
* Use predefined idOrNobuyoshi Nakada2019-08-011-3/+2
|
* Ripper#validate_object: check if the object is hiddenNobuyoshi Nakada2019-07-191-5/+10
|
* Moved RIPPER_DEBUG methods to Ripper from KernelNobuyoshi Nakada2019-07-191-3/+3
|
* Fixed build error with RIPPER_DEBUGNobuyoshi Nakada2019-07-191-7/+3
|
* Use Qnull instead of 0 and QundefNobuyoshi Nakada2019-07-191-4/+1
|
* Adjust indent [ci skip]Nobuyoshi Nakada2019-07-171-6/+10
|
* parse.y (here_document): remove dead codeYusuke Endoh2019-07-151-4/+1
| | | | | str is always zero when evaluating the branch. Found by Coverity Scan.
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* Add a /* fall through */ commentYusuke Endoh2019-07-141-0/+1
|
* Revert "parse.y: Deprecate flip-flops"Nobuyoshi Nakada2019-07-111-4/+2
| | | | | | This reverts commit bae638ad5b782c44c80efe33834cb9039279af46. [Feature #5400]
* Removed duplicate assignmentNobuyoshi Nakada2019-07-101-1/+0
| | | | | This `last_state` is set to `lex.state` just before the `switch` statement, and `token_flush` nor `nextc` never change the state.
* Check indent of `end` against `else` if presentNobuyoshi Nakada2019-07-081-7/+16
|
* Message to pipe should end with a newlineNobuyoshi Nakada2019-07-071-1/+1
|
* Enable indentation warning against `if` just after `else`Nobuyoshi Nakada2019-07-071-0/+9
| | | | | | | | | | | | | ```ruby if false puts 'false' else if true puts 'true' end # -:5: warning: mismatched indentations at 'end' with 'if' at 3 end ``` [Feature #15990]
* Renamed column in token_info to indentNobuyoshi Nakada2019-07-071-9/+9
|
* Multiple codepoints are not allowed at single character literalNobuyoshi Nakada2019-07-051-5/+20
| | | | It has unintentionally passed since 2.5.
* Fix a typoKazuhiro NISHIYAMA2019-07-051-1/+1
|
* Do not dispatch a nil token in ripperNobuyoshi Nakada2019-07-041-0/+1
| | | | | | | As a comment token includes the newline, so delayed newline token just follows it should not be dispatched. [Bug #11485] Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
* Hoisted out f_rest_margNobuyoshi Nakada2019-06-301-33/+21
| | | | | | * parse.y (f_rest_marg): extract named and unnamed rest parameter in parenthesized method arguments, and should not be warned as unused.
* Should not warn massign parameters as unusedNobuyoshi Nakada2019-06-291-0/+2
|
* Omit `EXPR_` prefix to show lex_stateNobuyoshi Nakada2019-06-271-5/+6
|
* Fix ripper fatalNobuyoshi Nakada2019-06-271-1/+1
| | | | | * parse.y (parser_yylex): return END_OF_INPUT at unterminated here document instead of an error. [Bug #15962]
* Fix wrong "void value expression" errorNobuyoshi Nakada2019-06-171-4/+2
| | | | | | * parse.y (value_expr_check): `then` or `else` only `if` is not a void value expression, as the counterpart is evaluated as `nil`. [Bug #15932]
* Fix wrong "void value expression" errorNobuyoshi Nakada2019-06-171-12/+22
| | | | | | * parse.y (value_expr_check): if either of `then` or `else` statements is not a void value expression, the whole `if` is not also a void value expression. [Bug #15932]
* Support Bison 3Nobuyoshi Nakada2019-06-171-1/+1
|
* Fix memory leakNobuyoshi Nakada2019-06-161-1/+1
| | | | | | | | | | | | | | * string.c (str_replace_shared_without_enc): free previous buffer before replaced. * parse.y (gettable): make sure in advance that the `__FILE__` object shares a fstring, to get rid of replacement with the fstring later. TODO: this hack may be needed in other places. [Bug #15916] Co-Authored-By: luke-gru (Luke Gruber) <luke.gru@gmail.com>
* Revert github/pull/2230, commit missNobuyoshi Nakada2019-06-151-8/+1
|
* Prefer `enum yytokentype` to intNobuyoshi Nakada2019-06-151-3/+3
|
* Multiline method chain with leading dot works for blank linesJosh Cheek2019-06-151-0/+1
|
* Remove blank line I accidentally addedJosh Cheek2019-06-151-1/+0
|
* Rename LINEND to EMPTYLNJosh Cheek2019-06-151-4/+4
|
* Omg, it works!Josh Cheek2019-06-151-1/+8
| | | | | | I'll rename it and squash this commit later, just wanted to make sure I couldn't lose it (took a long time to come up with).
* An operator is not allowed just after `|>`Nobuyoshi Nakada2019-06-141-4/+4
| | | | https://twitter.com/yukihiro_matz/status/1139454774640726019
* Continue to the next line beginning with a pipelineNobuyoshi Nakada2019-06-131-1/+2
|
* parse.y: moved pipeline to exprNobuyoshi Nakada2019-06-131-17/+31
| | | | To allow arguments without parentheses.
* Add pipeline operator [Feature #15799]Nobuyoshi Nakada2019-06-131-1/+24
|
* Refined syntax error messagesNobuyoshi Nakada2019-06-111-2/+2
|
* &. is not allowed inside LHS of massignNobuyoshi Nakada2019-06-111-0/+6
| | | | https://hackerone.com/reports/605262
* Fix grammar of macro name: ECCESSED -> ECCESSIVEMartin Dürst2019-06-051-2/+2
| | | | | Fix the name of the macro variable introduced in 0872ea5330 from NODE_SPECIAL_EXCESSED_COMMA to NODE_SPECIAL_EXCESSIVE_COMMA.
* node.h: Avoid a magic number to represent excessed commaYusuke Endoh2019-06-041-6/+2
| | | | | | `(ID)1` was assigned to NODE_ARGS#rest_arg for `{|x,| }`. This change removes the magic number by introducing an explicit macro variable for it: NODE_SPECIAL_EXCESSED_COMMA.
* EOF by 2 ^D on a TTYNobuyoshi Nakada2019-06-041-0/+4
| | | | | | | Terminate the input from a TTY by 2 ^D at the middle of line, like as many programs, `cat`, `perl` and so on, do. By the first ^D, the line will be sent without a newline, and then EOF will be send by the next ^D.
* Fix the error token on "invalid hex escape"Nobuyoshi Nakada2019-06-031-1/+1
| | | | | * parse.y (tok_hex): flush token after dispatching the "invalid hex escape" parse error.
* parse.y: adjust here-doc error tokenNobuyoshi Nakada2019-05-301-4/+7
| | | | | | * parse.y (here_document): adjust token to the here-doc identifier in compile_error when a here-document misses the closing identifier.
* parse.y: continue after heredoc errorNobuyoshi Nakada2019-05-301-2/+10
| | | | | * parse.y: continue parsing the rest of the here-document starting line, after the terminator was not found.