Граф коммитов

2404 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 40e3f782dd Extract `forwarding_arg_check` function 2023-12-22 23:08:10 +09:00
Nobuyoshi Nakada 11c2aa035b Extract `arg_splat` nonterminal symbol 2023-12-22 23:08:10 +09:00
Nobuyoshi Nakada 92b10f5be7 [Bug #20062] Fixed numbered parameter syntax error
At the method definition, the local scope that saves the context of
the numbered parameters needs to be pushed before saving.
2023-12-16 02:11:51 +09:00
Nobuyoshi Nakada 9b7a964318 [Bug #19877] Flip-flop needs to be direct condition 2023-12-08 12:53:47 +09:00
Takashi Kokubun c6eb355e04 Revert "Warn `it` only with -W:deprecated"
This reverts commit 5458252bb0.

Revert "Fallback rb_warn_deprecated for UNIVERSAL_PARSER"

This reverts commit 680be886f4.

matz actually preferred always warning `it`.
2023-12-07 00:03:03 -08:00
Takashi Kokubun 680be886f4 Fallback rb_warn_deprecated for UNIVERSAL_PARSER 2023-12-07 00:00:36 -08:00
Takashi Kokubun 5458252bb0 Warn `it` only with -W:deprecated 2023-12-06 23:44:02 -08:00
Takashi Kokubun ae76c8a11e
Warn `it` (#9152)
https://bugs.ruby-lang.org/issues/18980
2023-12-07 07:14:59 +00:00
Nobuyoshi Nakada a607d62d8c [Bug #20033] Dynamic regexp should not assign captures 2023-12-02 03:57:41 +09:00
Nobuyoshi Nakada e5e1f9813e [Bug #19838] Flush delayed token nonconsecutive with the next token 2023-12-02 02:41:39 +09:00
Nobuyoshi Nakada add0ab07e8 Extract `end_with_newline_p` 2023-12-02 02:41:39 +09:00
Nobuyoshi Nakada 6e2b10d456 Prefer proper enum over bare int 2023-12-02 02:41:39 +09:00
Nobuyoshi Nakada e36b9760fd
Dispatch invalid hex escape content too 2023-12-01 15:04:30 +09:00
Nobuyoshi Nakada d503e1b95a
[Bug #20030] dispatch invalid escaped character without ignoring it 2023-12-01 15:04:30 +09:00
Nobuyoshi Nakada 1802d14ca8 [Bug #19877] Assign captures for direct regexp literal only 2023-11-30 21:40:22 +09:00
TSUYUSATO Kitsune fe746747b4 Reject 'class << (return); end` by "void value expression" 2023-11-21 14:07:47 +09:00
yui-knk 51149f335e Keep unused literal nodes
For static analysis, it’s better to keep unused literal nodes.
If simply change `block_append` to fall through, both "unused literal ignored"
and "possibly useless use of a literal in void context" warnings
are shown for the same line. But it’s verbose then remove
"unused literal ignored" warning.

This kind of optimization is already implemented on compile.c.
`compile_block` calls `iseq_compile_each0` with `popped = 1` when NODE_BLOCK
has next.
2023-10-31 17:49:12 +09:00
Nobuyoshi Nakada 13c9cbe09e
Embed `rb_args_info` in `rb_node_args_t` 2023-10-30 00:19:43 +09:00
Nobuyoshi Nakada c8d162c889
[Bug #19973] Warn duplicated keyword arguments after keyword splat 2023-10-26 14:28:39 +09:00
Nobuyoshi Nakada 2f8a719b6a Removed unused argument
Eventually, `read_escape` does not use `encp`.
2023-10-25 21:40:41 +09:00
Nobuyoshi Nakada 839b763119 Use named reference for dyna_push 2023-10-23 17:40:33 +09:00
Nobuyoshi Nakada 7e80f0b5a2 Extract p_in_kwarg to save and update lexer contexts 2023-10-23 17:40:33 +09:00
Nobuyoshi Nakada 428f9f5dc0 Move push_pvtbl and push_pktbl in nterms 2023-10-23 17:40:33 +09:00
Nobuyoshi Nakada 3b05238289 Extract p_assoc and p_in to save lexer contexts 2023-10-23 17:40:33 +09:00
yui-knk 08e25985d1 Expand OP_ASGN1 nd_args to nd_index and nd_rvalue
ARGSCAT has been used for nd_args to hold index and rvalue,
because there was limitation on the number of members for Node.
We can easily change structure of node now, let's expand it.
2023-10-20 07:56:20 +09:00
yui-knk 606452d1a9 Remove not used fields from STR 2023-10-15 16:16:06 +09:00
yui-knk 5342dbf00b Check node type before accessing nd_next
This is also a preparation for removing not_used members from
STR NODE. Current codes work without node type check because NODE_STR
has not_used2 member corresponding to nd_next of NODE_LIST and
NODE_DSTR. However it causes problme once not_used members are
removed from NODE_STR.
2023-10-15 16:16:06 +09:00
yui-knk e7e31d7784 Stop updating node type from NODE_STR to NODE_DSTR
This is a preparation for removing not_used members from STR NODE.
Once not_used members are removed from STR NODE, STR NODE is smaller than
DSTR NODE. Therefore allocate NODE_DSTR instead of reusing NODE_STR.
2023-10-15 16:16:06 +09:00
yui-knk a4e3d595cd Remove not used fields from XSTR 2023-10-15 16:16:06 +09:00
yui-knk cab67d227a Remove not used fields from LIT 2023-10-15 16:16:06 +09:00
yui-knk 25072d2e87 Fix node type casts
Use new node type set by nd_set_type.
2023-10-14 11:12:20 +09:00
Nobuyoshi Nakada a405b28e85 Delete heredoc line mark references 2023-10-14 11:08:43 +09:00
Nobuyoshi Nakada 5fc9810bf3 Shorten `rb_strterm_literal_t` members 2023-10-14 11:08:43 +09:00
Nobuyoshi Nakada a075c55d0c Manage `rb_strterm_t` without imemo 2023-10-14 11:08:43 +09:00
Nobuyoshi Nakada cb06b6632a Remove unions in `rb_strterm` structs for alignment 2023-10-14 11:08:43 +09:00
yui-knk 2794a8fef6 [Bug #19919] Warn class variable assignment and constant declaration in condition 2023-10-13 07:35:24 +09:00
Nobuyoshi Nakada 81399a5c46
Use `lex_eol` macros 2023-10-13 02:32:45 +09:00
Nobuyoshi Nakada 17b0643392
[Bug #19924] Source code should be unsigned char stream
Use `peekc` or `nextc` to fetch the next character, instead of reading
from `lex.pcur` directly, for compilers that plain char is signed.
2023-10-13 02:28:35 +09:00
yui-knk f9fe7aeef4 Extract NODE_FL_NEWLINE access to macro 2023-10-11 19:22:34 +09:00
Nobuyoshi Nakada a84d0945fa
Semicolon after `SWITCH_BY_COND_TYPE` for auto-indent [ci skip] 2023-10-11 10:37:40 +09:00
Nobuyoshi Nakada 47274ba8c1 Extract numparam nterms 2023-10-10 16:32:40 +09:00
Nobuyoshi Nakada 9095e712a3 Use `rb_node_exits_t` instead of `NODE` 2023-10-10 16:32:40 +09:00
Nobuyoshi Nakada e2998c42e1 Forward declaration of `struct RNode_DEF_TEMP` and its typedef 2023-10-10 16:32:40 +09:00
yui-knk 5245123a4b Remove not used fields from DEFN 2023-10-10 11:05:29 +09:00
Nobuyoshi Nakada a8d71535ff Pre-allocate `NODE_DEFN`/`NODE_DEFS` nodes
To fix the order of node IDs, for typeprof tests.
2023-10-10 00:09:52 +09:00
Nobuyoshi Nakada 4c00ab7fd6 Refactor NODE_DEF_TEMP
Use `NODE_DEF_TEMP` as the wrapper of `NODE_DEFS` in ripper, not only
of `NODE_DEFN`, so that `endless_method_name` works consistently.
2023-10-10 00:09:52 +09:00
yui-knk b9a2348632 Take care of internal node type
In parse.y, node can be NODE_DEF_TEMP or NODE_EXITS.
Hit "unknown node" without taking care of them.
For example `ruby --dump=y lib/cgi/util.rb` causes
"[BUG] unknown node: 107".
2023-10-09 12:38:32 +09:00
yui-knk b5d74f4f26 Remove not used fields from EVSTR 2023-10-08 16:34:32 +09:00
yui-knk 5810304c2e Remove not used fields from asgn nodes 2023-10-07 17:54:35 +09:00
yui-knk b7ee728a83 Correctly casting node for accessing nd_value and nd_vid in parse.y 2023-10-07 17:54:35 +09:00