Commit graph

158 commits

Author SHA1 Message Date
yui-knk
5245123a4b Remove not used fields from DEFN 2023-10-10 11:05:29 +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
5c779dc45d Remove not used fields from MATCH3 2023-10-06 15:32:33 +09:00
yui-knk
58fc45325f Remove not used fields from YIELD 2023-10-06 07:31:53 +09:00
yui-knk
f6a2af255b Remove not used fields from ZLIST 2023-10-06 07:31:22 +09:00
Nobuyoshi Nakada
a5cc6341c0
Remove NODE_VALUES
This node type was added for the multi-value experiment back in 2004.
The feature itself was removed after a few years, but this is its
remnant.
2023-10-06 03:39:58 +09:00
Nobuyoshi Nakada
efa18fd6b3 Chain nodes to exit only 2023-10-05 14:23:42 +09:00
Nobuyoshi Nakada
696022a0cb Differentiate NODE_BREAK/NODE_NEXT/NODE_RETURN 2023-10-05 14:23:42 +09:00
Nobuyoshi Nakada
f5f3b35b93 Remove unused nodes in NODE_RETURN and NODE_REDO 2023-10-05 14:23:42 +09:00
Nobuyoshi Nakada
70e1635950 Move internal NODE_DEF_TEMP to parse.y 2023-10-05 14:23:42 +09:00
yui-knk
a472fd55da Remove not used fields from colon nodes 2023-10-05 13:19:09 +09:00
yui-knk
ed8a3428e4 Remove not used fields from variable nodes 2023-10-04 12:15:39 +09:00
yui-knk
81668579ed Remove not used fields from call nodes 2023-10-02 09:41:45 +09:00
yui-knk
08239fd6af Use rb_node_args_t and rb_node_args_aux_t instead of NODE 2023-10-01 19:38:03 +09:00
yui-knk
cecd1de2eb Use rb_node_opt_arg_t and rb_node_kw_arg_t instead of NODE 2023-10-01 09:19:42 +09:00
yui-knk
4997903c20 Remove not used fields from FOR_MASGN 2023-09-30 19:17:28 +09:00
yui-knk
1fbccd02ee Remove not used fields from OP_ASGN_AND, OP_ASGN_OR 2023-09-30 18:53:40 +09:00
yui-knk
eba19d86d4 Remove not used fields from HASH 2023-09-30 17:20:54 +09:00
yui-knk
97ac5deeec Remove not used fields from BEGIN 2023-09-30 17:20:16 +09:00
yui-knk
716a12902d Remove not used fields from ERROR 2023-09-30 17:02:50 +09:00
yui-knk
db18428fff Remove not used fields from ITER, FOR 2023-09-30 16:30:57 +09:00
yui-knk
4c18615ffe Remove not used fields from MODULE, SCLASS 2023-09-30 16:24:43 +09:00
yui-knk
4e90be4c93 Remove not used fields from ONCE 2023-09-30 13:23:32 +09:00
yui-knk
d293d9e191 Expand pattern_info struct into ARYPTN Node and FNDPTN Node 2023-09-30 13:11:32 +09:00
yui-knk
1b97c17e03 Remove not used fields from ARYPTN, FNDPTN 2023-09-30 13:11:32 +09:00
yui-knk
129d006852 Remove not used fields from argument nodes 2023-09-30 12:29:29 +09:00
yui-knk
83af0b9128 Remove not used fields from NTH_REF, BACK_REF 2023-09-30 12:28:06 +09:00
yui-knk
0a386b827b Remove not used fields from ERRINFO 2023-09-30 11:23:20 +09:00
yui-knk
fa54d06a40 Remove not used fields from POSTEXE 2023-09-30 11:22:06 +09:00
yui-knk
f9f728e804 Remove not used fields from DEFINED 2023-09-30 10:48:07 +09:00
yui-knk
ef37bdeb4d Remove not used fields from AND, OR 2023-09-30 10:27:39 +09:00
yui-knk
443099377f Remove not used fields from LAMBDA 2023-09-30 10:15:25 +09:00
yui-knk
7979f07427 Change NODE DEF_TEMP nd_cval to struct lex_context 2023-09-29 19:36:34 +09:00
yui-knk
68ae87546e Merge NODE_DEF_TEMP and NODE_DEF_TEMP2 2023-09-29 19:36:34 +09:00
yui-knk
5537a41059 Remove not used fields from CASE, CASE2, CASE3 2023-09-29 17:31:34 +09:00
yui-knk
b9bf419aa3 Remove not used fields from ALIAS, VALIAS, UNDEF 2023-09-29 11:43:04 +09:00
yui-knk
52f8b347a0 Remove not used fields from DOT2, DOT3, FLIP2, FLIP3 2023-09-29 10:09:04 +09:00
yui-knk
37a783a30c Merge RNode_OP_ASGN2 and RNode_OP_ASGN22 2023-09-29 08:36:39 +09:00
yui-knk
23bcdda377 Remove not used fields from SELF, NIL, TRUE, FALSE 2023-09-29 07:43:29 +09:00
yui-knk
74c6781153 Change RNode structure from union to struct
All kind of AST nodes use same struct RNode, which has u1, u2, u3 union members
for holding different kind of data.
This has two problems.

1. Low flexibility of data structure

Some nodes, for example NODE_TRUE, don’t use u1, u2, u3. On the other hand,
NODE_OP_ASGN2 needs more than three union members. However they use same
structure definition, need to allocate three union members for NODE_TRUE and
need to separate NODE_OP_ASGN2 into another node.
This change removes the restriction so make it possible to
change data structure by each node type.

2. No compile time check for union member access

It’s developer’s responsibility for using correct member for each node type when it’s union.
This change clarifies which node has which type of fields and enables compile time check.

This commit also changes node_buffer_elem_struct buf management to handle
different size data with alignment.
2023-09-28 11:58:10 +09:00
yui-knk
fb7a2ddb4b Directly free structure managed by imemo tmpbuf
NODE_ARGS, NODE_ARYPTN, NODE_FNDPTN manage memory of their
structure by imemo tmpbuf Object.
However rb_ast_struct has reference to NODE. Then these
memory can be freed directly when rb_ast_struct is freed.

This commit reduces parser's dependency on CRuby functions.
2023-09-22 11:25:53 +09:00
Nobuyoshi Nakada
fe73f9f24b
Replace only use of snprintf in parser 2023-08-25 23:34:02 +09:00
Nobuyoshi Nakada
503f98ebd3 Remove SCRIPT_LINES__ related member functions 2023-08-25 18:23:05 +09:00
卜部昌平
a736420ce5 define back snprintf 2023-08-25 17:27:53 +09:00
卜部昌平
140daab5ac #include <stdarg.h> for va_list 2023-08-25 17:27:53 +09:00
卜部昌平
fa327472ca snprintf could be defined
include/ruby/subst.h has `#define snprintf` which breaks here.
2023-08-25 17:27:53 +09:00
卜部昌平
ddc5c204b2 VALUE is already defined
This header is needed only when outside of the project
2023-08-25 17:27:53 +09:00
卜部昌平
c914382db2 do not redefine a typedef
duplicated typedef declaration was not allowed in C99.
2023-08-25 17:27:53 +09:00
yui-knk
00054de6b5 Remove nd_entry from NODE_GASGN and NODE_GVAR
After a0f12a0258 NODE_GASGN and
NODE_GVAR hold same value on both nd_vid and nd_entry.
This commit stops setting value to nd_entry and makes to use only
nd_vid.
2023-08-23 07:59:54 +09:00