Wataru Ashihara
01dc2265ff
Fix unintended variable shadowing
2020-11-23 14:48:14 +09:00
Yukihiro "Matz" Matsumoto
39a11f323e
Remove mrb_str_buf_new() and MRB_STR_BUF_MIN_SIZE; close #5171
2020-11-22 22:54:21 +09:00
Yukihiro "Matz" Matsumoto
abdd006df3
Strictly speaking NULL + 0 is a undefined behavior; ref #5157
2020-11-22 22:44:22 +09:00
Yukihiro "Matz" Matsumoto
2d9bf22730
Merge pull request #5173 from shuujii/refine-build-log-for-generated-files
...
Refine build log for generated files
2020-11-22 22:38:33 +09:00
Yukihiro "Matz" Matsumoto
17532874a8
Merge pull request #5174 from dearblue/doc
...
Add brief explanation about `bin/mruby`; ref #5157 [ci skip]
2020-11-22 22:37:29 +09:00
dearblue
a67b88e223
Add brief explanation about bin/mruby; ref #5157 [ci skip]
2020-11-22 20:49:59 +09:00
KOBAYASHI Shuji
2a97e97db4
Refine build log for generated files
...
* Output `GEN` log for generated files
* `MRBC` log is outputted one for each `mrbc` execution
#### Before this patch:
```console
CC src/array.c -> build/host/src/array.o
(snip)
GEN mrblib/*.rb -> build/host/mrblib/mrblib.c
MRBC mrblib/00class.rb
MRBC mrblib/10error.rb
(snip)
CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o
MRBC mrbgems/mruby-time/mrblib/time.rb
(snip)
CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o
MRBC mrbgems/mruby-socket/test/addrinfo.rb
MRBC mrbgems/mruby-socket/test/basicsocket.rb
(snip)
```
#### After this patch:
```console
GEN build/presym
GEN build/presym.inc
CC src/array.c -> build/host/src/array.o
(snip)
GEN mrblib/*.rb -> build/host/mrblib/mrblib.c
MRBC mrblib/00class.rb
mrblib/10error.rb
(snip)
CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o
GEN build/host/mrbgems/mruby-time/gem_init.c
MRBC mrbgems/mruby-time/mrblib/time.rb
(snip)
CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o
GEN build/host/mrbgems/mruby-socket/gem_test.c
MRBC mrbgems/mruby-socket/test/addrinfo.rb
MRBC mrbgems/mruby-socket/test/basicsocket.rb
(snip)
```
2020-11-22 20:31:01 +09:00
Yukihiro "Matz" Matsumoto
76b036a627
Merge pull request #5172 from shuujii/move-global-function-for-build-to-lib-mruby-core_ext.rb
...
Move global function for build to `lib/mruby/core_ext.rb`
2020-11-22 18:03:29 +09:00
Yukihiro "Matz" Matsumoto
ac2dfa8c47
Merge pull request #5170 from dearblue/gcmark
...
Fix GC mark leaks for `MRB_TT_BREAK`; fix #5168
2020-11-22 18:00:53 +09:00
KOBAYASHI Shuji
1c7a1926a3
Move global function for build to lib/mruby/core_ext.rb
...
Because `_pp` is originally defined in `lib/mruby/core_ext.rb`, other global
functions are moved to the file.
2020-11-22 16:53:13 +09:00
dearblue
fd3576e888
Fix GC mark leaks for MRB_TT_BREAK; fix #5168
2020-11-22 15:09:01 +09:00
Yukihiro "Matz" Matsumoto
1cd8b4c933
Merge pull request #5169 from shuujii/fix-size-of-local-variable-array-in-struct-dumped-file
...
Fix size of local variable array in struct dumped file
2020-11-22 14:41:48 +09:00
KOBAYASHI Shuji
1864816d1e
Fix size of local variable array in struct dumped file
2020-11-22 13:32:45 +09:00
Yukihiro "Matz" Matsumoto
e02d0ff78c
Merge pull request #5167 from dearblue/singleton-method
...
Improved `Object#define_singleton_method`
2020-11-22 00:02:34 +09:00
Yukihiro "Matz" Matsumoto
049e749c8b
Merge pull request #5166 from shuujii/rename-MRB_ENABLE-DISABLE_-to-MRB_USE-NO_
...
Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163
2020-11-21 23:59:32 +09:00
dearblue
b2bfcabae2
Improved Object#define_singleton_method
...
Integrate the implementation with `Module#define_method`.
- Introduce the internal function `mrb_mod_define_method_m()` (no static)
- The `Object#define_singleton_method` method can now accept a second argument
2020-11-21 22:31:13 +09:00
KOBAYASHI Shuji
3d056d084a
Rename MRB_{ENABLE,DISABLE}_ to MRB_{USE,NO}_; close #5163
...
| Previous Name | New Name |
|------------------------------|-------------------------|
| MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS |
| MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS |
| MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI |
| MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION |
| MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK |
| MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING |
| MRB_DISABLE_STDIO | MRB_NO_STDIO |
| ENABLE_LINENOISE | MRB_USE_LINENOISE |
| ENABLE_READLINE | MRB_USE_READLINE |
| DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE |
| DISABLE_GEMS | MRB_NO_GEMS |
* `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed.
* `MRB_` prefix is added to those without.
* The previous names can also be used for compatibility.
2020-11-21 21:14:40 +09:00
Yukihiro "Matz" Matsumoto
544784effd
Merge pull request #5157 from dearblue/detect-rb-mrb
...
Allow to mixed and specify `*.rb` and `*.mrb` in `bin/mruby`
2020-11-21 19:22:49 +09:00
dearblue
a045b6b8d9
Allow to mixed and specify *.rb and *.mrb in bin/mruby
...
It is not decides by the extension.
In order to be recognized as a `.mrb` file, the following three points must be satisfied:
- File starts with "RITE"
- At least `sizeof(struct rite_binary_header)` bytes can be read
- `NUL` is included in the first 64 bytes of the file
If these are not met, it is judged as a text file and it is processed as a Ruby script.
The `bin/mruby -b` switch is still available which treats the given file as a `.mrb` file.
New `MRB_API` function:
- `include/mruby/compile.h` and `mrbgems/mruby-compiler/core/parse.y`
- `mrb_load_detect_file_cxt()` (remove with `MRB_DISABLE_STDIO`)
NOTE:
- Even script files now always open in binary mode for `bin/mruby`.
The `\r\n` is handled by the `nextc()` function already, so there is no problem even on Windows.
- The `nextc0()` function in `mrbgems/mruby-compiler/core/parse.y` can now specify a string buffer and a file pointer at the same time.
In this case, get it from the string buffer first.
This patch includes modifies by comment of https://github.com/mruby/mruby/pull/5157 .
2020-11-21 19:05:46 +09:00
Yukihiro "Matz" Matsumoto
e3b91b8d41
Merge pull request #5165 from shuujii/fix-incorrect-build-name-and-simplify-build_config-boxing.rb
...
Fix incorrect build name and simplify `build_config/boxing.rb` [ci skip]
2020-11-21 17:53:42 +09:00
KOBAYASHI Shuji
a3685c4c04
Fix incorrect build name and simplify build_config/boxing.rb [ci skip]
...
`boxing-nan-m64` was duplicated.
2020-11-21 17:50:44 +09:00
Yukihiro "Matz" Matsumoto
a3221bf8cd
Merge pull request #5164 from shuujii/automatically-enable-MRB_ENABLE_DEBUG_HOOK-if-mruby-bin-debugger-is-used
...
Automatically enable `MRB_ENABLE_DEBUG_HOOK` if `mruby-bin-debugger` is used
2020-11-21 17:41:36 +09:00
KOBAYASHI Shuji
3179944e81
Automatically enable MRB_ENABLE_DEBUG_HOOK if mruby-bin-debugger is used
2020-11-21 17:15:47 +09:00
Yukihiro "Matz" Matsumoto
66d044ec3e
Remove -Wdeclaration-after-statement from gcc options; #5159
2020-11-21 17:05:16 +09:00
Yukihiro "Matz" Matsumoto
734f6b1cc4
Remove 2 restrictions from CONTRIBUTING.md; close #5159
...
* Allow mixed declarations, especially loop variables
* Allow C++ style commends `//`
2020-11-21 16:55:40 +09:00
Yukihiro "Matz" Matsumoto
55e1275778
Merge pull request #5161 from dearblue/ary-splice
...
Fix documents for `mrb_ary_splice()` [ci skip]
2020-11-21 16:08:44 +09:00
Yukihiro "Matz" Matsumoto
c6c18c32b0
Merge pull request #5162 from shuujii/move-some-.rake-files-to-tasks-directory-for-consistency
...
Move some `.rake` files to `tasks` directory for consistency
2020-11-21 16:07:03 +09:00
Yukihiro "Matz" Matsumoto
00751ccbcd
Reserve OP_SENDVK for the future keyword arguments like Ruby3.0.
2020-11-21 15:50:17 +09:00
Yukihiro "Matz" Matsumoto
59e581ed78
Fix infinite loop bug from super when method is prepended.
2020-11-21 15:50:16 +09:00
Yukihiro "Matz" Matsumoto
a7bcbd8bdc
Fix module order of #include; ruby-bug:7844
2020-11-21 15:50:16 +09:00
Yukihiro "Matz" Matsumoto
33f1970df2
Merge pull request #5160 from dearblue/cptr-obj
...
Unable for the `MRB_TT_CPTR` object to have a singleton class
2020-11-21 15:50:03 +09:00
Yukihiro "Matz" Matsumoto
07053e5654
Merge pull request #5158 from dearblue/typo
...
Fix typo "overfow" to "overflow" [ci skip]
2020-11-21 15:49:29 +09:00
dearblue
3ac6c3f090
Fix documents for mrb_ary_splice() [ci skip]
2020-11-21 15:47:59 +09:00
dearblue
7f9b4e056d
Unable for the MRB_TT_CPTR object to have a singleton class
...
This object is treated as an immediate value.
2020-11-21 15:36:56 +09:00
KOBAYASHI Shuji
551bf0c635
Move some .rake files to tasks directory for consistency
2020-11-21 15:36:46 +09:00
dearblue
1e340cf869
Fix typo "overfow" to "overflow" [ci skip]
2020-11-21 15:19:28 +09:00
Yukihiro "Matz" Matsumoto
eb52c29b2d
Test each combination of boxing, mrb_int size, and archtecture.
...
Boxing:
* `MRB_NO_BOXING` (`mrb_value` packed in `struct`)
* `MRB_WORD_BOXING` (`mrb_value` packed in `struct`) default
* `MRB_NAN_BOXING` (`mrb_value` packed in `double`)
`mrb_int` size
* `MRB_INT32` (`int32_t` as `mrb_int`)
* `MRB_INT64` (`int64` as `mrb_int`) conflict with `MRB_NAN_BOXING'
Architecture
* `MRB_64BIT` (`sizeof(void*)` is 64 bits)
* `MRB_32BIT` (`sizeof(void*)` is 32 bits)
2020-11-21 14:38:14 +09:00
Yukihiro "Matz" Matsumoto
8258b7b5b3
Specify conf explicitly for enable_debug.
2020-11-21 14:38:14 +09:00
Yukihiro "Matz" Matsumoto
1974aa0f72
Update Float#to_s to keep trailing zero as CRuby does; ref 68cebb6
2020-11-21 14:38:13 +09:00
Yukihiro "Matz" Matsumoto
5f7eb20256
Merge pull request #5156 from shuujii/improve-determining-C++-compiler-in-tasks-toolchains-gcc.rake
...
Improve determining C++ compiler in `tasks/toolchains/gcc.rake`
2020-11-21 14:38:00 +09:00
KOBAYASHI Shuji
98d0f1b98e
Improve determining C++ compiler in tasks/toolchains/gcc.rake
...
* Consider CC envvar as C compiler on which to make the decision.
* Consider the case where C compiler is `ccache gcc`, etc.
2020-11-21 12:25:50 +09:00
Yukihiro "Matz" Matsumoto
fb028b47aa
Merge pull request #5155 from shuujii/refactor-mrblib-mrblib.rake
...
Refactor `mrblib/mrblib.rake`
2020-11-20 23:13:08 +09:00
KOBAYASHI Shuji
1088feb110
Refactor mrblib/mrblib.rake
2020-11-20 22:55:49 +09:00
Yukihiro "Matz" Matsumoto
ebf380474c
Merge pull request #5153 from shuujii/refactor-src-mruby_core.rake
...
Refactor `src/mruby_core.rake`
2020-11-20 22:23:29 +09:00
Yukihiro "Matz" Matsumoto
749ac0a021
Merge pull request #5152 from shuujii/move-lib-mruby-core-ext.rb-to-lib-mruby-core_ext.rb-for-consistency
...
Move `lib/mruby-core-ext.rb` to `lib/mruby/core_ext.rb` for consistency
2020-11-20 22:22:14 +09:00
KOBAYASHI Shuji
aaa12911e2
Refactor src/mruby_core.rake
2020-11-20 17:55:26 +09:00
KOBAYASHI Shuji
56a60fa7b7
Move lib/mruby-core-ext.rb to lib/mruby/core_ext.rb for consistency
2020-11-20 16:58:08 +09:00
Yukihiro "Matz" Matsumoto
5dc9a8249f
Merge pull request #5150 from shuujii/allow-bintest-even-if-build-name-is-not-host
...
Allow `bintest` even if build name is not `host`
2020-11-19 12:41:53 +09:00
KOBAYASHI Shuji
fd113da3aa
Allow bintest even if build name is not host
2020-11-19 11:37:00 +09:00
Yukihiro "Matz" Matsumoto
15d6e172e9
Merge pull request #5146 from shuujii/fix-integer-overflow-error-in-mrdb-test
...
Fix integer overflow error in mrdb test
2020-11-18 19:19:48 +09:00