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

129 Коммитов

Автор SHA1 Сообщение Дата
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
S-H-GAMELINKS a792890e9b Remove uneeded fix2int and rational_raw property for Universal Parser 2023-08-11 13:50:00 +09:00
S-H-GAMELINKS 4e7e972841 Remove uneeded int2big property for Universal Parser 2023-08-05 11:39:38 +09:00
S-H-GAMELINKS acd9c208d5 Move some macro for universal parser 2023-07-09 15:00:52 +09:00
S-H-GAMELINKS 8b2a0ec8df Move ISASCII defination to parse.y 2023-07-08 15:26:55 +09:00
Nobuyoshi Nakada 3443e43b62 Remove `st_functions_t` 2023-06-24 19:17:37 +09:00
yui-knk d444f1b1fa Specify int bitfield as signed int bitfield
sunc treats int bitfield as unsigned int.
This commit will fix build failure on sunc.

* http://rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20230617T100003Z.fail.html.gz
* http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20230617T090011Z.fail.html.gz
2023-06-17 22:02:13 +09:00
yui-knk 19c62b400d Replace parser & node compile_option from Hash to bit field
This commit reduces dependency to CRuby object.
2023-06-17 16:41:08 +09:00
yui-knk b481b673d7 [Feature #19719] Universal Parser
Introduce Universal Parser mode for the parser.
This commit includes these changes:

* Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions
  are passed via `struct rb_parser_config_struct` when this macro is enabled.
* Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu.
2023-06-12 18:23:48 +09:00