summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2019-06-17Fix wrong "void value expression" errorNobuyoshi Nakada
* 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]
2019-06-17Fix wrong "void value expression" errorNobuyoshi Nakada
* 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]
2019-06-17Support Bison 3Nobuyoshi Nakada
2019-06-16Fix memory leakNobuyoshi Nakada
* 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>
2019-06-15Revert github/pull/2230, commit missNobuyoshi Nakada
2019-06-15Prefer `enum yytokentype` to intNobuyoshi Nakada
2019-06-15Multiline method chain with leading dot works for blank linesJosh Cheek
2019-06-15Remove blank line I accidentally addedJosh Cheek
2019-06-15Rename LINEND to EMPTYLNJosh Cheek
2019-06-15Omg, it works!Josh Cheek
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).
2019-06-14An operator is not allowed just after `|>`Nobuyoshi Nakada
https://twitter.com/yukihiro_matz/status/1139454774640726019
2019-06-13Continue to the next line beginning with a pipelineNobuyoshi Nakada
2019-06-13parse.y: moved pipeline to exprNobuyoshi Nakada
To allow arguments without parentheses.
2019-06-13Add pipeline operator [Feature #15799]Nobuyoshi Nakada
2019-06-11Refined syntax error messagesNobuyoshi Nakada
2019-06-11&. is not allowed inside LHS of massignNobuyoshi Nakada
https://hackerone.com/reports/605262
2019-06-05Fix grammar of macro name: ECCESSED -> ECCESSIVEMartin Dürst
Fix the name of the macro variable introduced in 0872ea5330 from NODE_SPECIAL_EXCESSED_COMMA to NODE_SPECIAL_EXCESSIVE_COMMA.
2019-06-04node.h: Avoid a magic number to represent excessed commaYusuke Endoh
`(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.
2019-06-04EOF by 2 ^D on a TTYNobuyoshi Nakada
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.
2019-06-03Fix the error token on "invalid hex escape"Nobuyoshi Nakada
* parse.y (tok_hex): flush token after dispatching the "invalid hex escape" parse error.
2019-05-30parse.y: adjust here-doc error tokenNobuyoshi Nakada
* parse.y (here_document): adjust token to the here-doc identifier in compile_error when a here-document misses the closing identifier.
2019-05-30parse.y: continue after heredoc errorNobuyoshi Nakada
* parse.y: continue parsing the rest of the here-document starting line, after the terminator was not found.
2019-05-29parse.y: fix state after ivar/cvarNobuyoshi Nakada
* parse.y (parse_atmark): return EXPR_END or EXPR_ENDFN, depending on the previous state, even incomplete names consistently.
2019-05-29parse.y: flush invalid charNobuyoshi Nakada
2019-05-29parse.y: warn escaped whitespaceNobuyoshi Nakada
* parse.y (warn_space_char_code): warn whitespace characters escaped with meta/control prefix.
2019-05-28Skip following all digits after `@@`Nobuyoshi Nakada
2019-05-28parse.y: numbered parameter symbolNobuyoshi Nakada
* parse.y (parse_atmark): numbered parameter name is not allowed as a symbol regardless the context.
2019-05-27Do not make an incomplete escape a valid charNobuyoshi Nakada
2019-05-27Ripper#tokenNobuyoshi Nakada
* parse.y (ripper_token): added Ripper#token which returns the current token string. [EXPERIMENTAL]
2019-05-27parse.y: removed "parser_" prefix from tokadd_utf8Nobuyoshi Nakada
2019-05-27parse.y: broke the terminator condition downNobuyoshi Nakada
* parse.y (here_document): broke the terminator condition down into each piece, the positional condition, resetting the dedented here-document indentation, and matching identifier. suppress a false warning by icc.
2019-05-26parse.y: adjust error indicatorNobuyoshi Nakada
* parse.y (parser_yylex): adjust the error indicator of unexpected fraction part. before: ~~~ 1.2.3 ^~~ ~~~ after: ~~~ 1.2.3 ^~ ~~~
2019-05-26Fix scanner event at invalid syntaxNobuyoshi Nakada
* parse.y (parser_yyerror, parser_compile_error): revert r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred token".
2019-05-24Mixed encoding error can continue to parseNobuyoshi Nakada
2019-05-22Fix mixed encoding in heredocJeremy Evans
Heredocs are parsed line-by-line, so we need to keep track of the temporary encoding of the string. Previously, a heredoc would only detect mixed encoding errors if they were on the same line, this changes things so they will be caught on different lines. Fixes [Bug #15839]
2019-05-20Mixed encoding error can continue to parseNobuyoshi Nakada
2019-05-16Pack struct rb_strterm_heredoc_struct on 32-bit platformsNobuyoshi Nakada
2019-05-12Expect no conflict in the parserNobuyoshi Nakada
2019-05-10Propagate parser_params to rb_yytnamerrNobuyoshi Nakada
2019-05-1015f45ae4d1 and 56528da3e broke the darwin environment.Hiroshi SHIBATA
Revert "Propagate parser_params to rb_yytnamerr" This reverts commit 15f45ae4d12f14714ab3021b60887d8c7bf4b095.
2019-05-10Propagate parser_params to rb_yytnamerrNobuyoshi Nakada
2019-05-05Fix use of numbered parameter inside proc that is default value of optargJeremy Evans
This allows cases such as: ```ruby m ->(a = ->{@1}) {a} m.call.call(1) m2 ->(a: ->{@1}) {a} m2.call.call(2) ``` Previously, this would cause a syntax error. [Bug#15789]
2019-05-05Fix a case where numbered parameters should not be allowedJeremy Evans
Because `proc{|| @1}` is a syntax error, the following should also be syntax errors: ```ruby proc { | | @1} ``` ```ruby proc { |; a| @1 } ``` This fixes both cases. [Bug #15825]
2019-05-05parse.y: duplicated when clause warningNobuyoshi Nakada
* parse.y (case_args): moved "duplicated when clause" warning from compile phase, so that `ruby -wc` shows them.
2019-04-29Fixed HERETERM_LENGTH_MAX on IL32LLP64Nobuyoshi Nakada
2019-04-29Refactored rb_strterm_heredoc_tNobuyoshi Nakada
2019-04-29Disallow also CR in here-doc identifierNobuyoshi Nakada
* parse.y (heredoc_identifier): CR in here-document identifier might or might not result in a syntax error, by the EOL code. make a syntax error regardless of the EOL code.
2019-04-29parse.y: fix here-doc identifier with newlineNobuyoshi Nakada
* parse.y (heredoc_identifier): quoted here-document identifier must end within the same line. the only corner case that here-document identifier can contain a newline is that the closing qoute is placed at the beginning of the next line, and has been warned since 2.4. ```ruby <<"EOS " # warning: here document identifier ends with a newline EOS ```
2019-04-26Hide internal IDsNobuyoshi Nakada
* parse.y (internal_id): number the ID serial for internal use by counting down from the neary maximum value, not to accidentally match permanent IDs. [Bug #15768] Notes: Fixed: [Bug #15786]
2019-04-25Ripper does not use internal IDs directlyNobuyoshi Nakada