summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
AgeCommit message (Collapse)Author
2020-12-26Add support for squiggly heredocsSeeker
2020-12-25Improves out of memory messages for `eval`dearblue
The comment says that if `mrb_parse_nstring()` returns `NULL`, it is only out of memory. I'm worried about compatibility if I set the exception class to `NoMemoryError`, so it's still `RuntimeError`.
2020-12-24Reset paren_nest at tAREF and tASET.Yukihiro "Matz" Matsumoto
2020-12-24Avoid division by zero in `rational_to_f()`.Yukihiro "Matz" Matsumoto
2020-12-19Merge pull request #5232 from jbampton/lint-markdownYukihiro "Matz" Matsumoto
feat(CI): add a GitHub Action to lint the Markdown
2020-12-19Merge pull request #5230 from dearblue/mruby-config.2Yukihiro "Matz" Matsumoto
Ignore `mruby-bin-config` in cross-building
2020-12-19feat(CI): add a GitHub Action to lint the MarkdownJohn Bampton
Run on pull request only Using https://www.npmjs.com/package/markdownlint-cli Lint Markdown for rules: - MD009/no-trailing-spaces - MD012/no-multiple-blanks - MD022/blanks-around-headings - MD031/blanks-around-fences - MD032/blanks-around-lists
2020-12-19🔒 Fix missing HTTPS on linksJohn Bampton
2020-12-19🔒 Fix missing HTTPS on linksJohn Bampton
2020-12-19Warn that it was ignored in crossbuilddearblue
2020-12-17feat(CI): add a GitHub Action to check spellingJohn Bampton
- Fix spelling - Run only on pull request - Using https://github.com/client9/misspell
2020-12-15refactor: remove trailing whitespace from C, Header, Ruby and YAML filesJohn Bampton
Lint
2020-12-13Fix spellingJohn Bampton
2020-12-09Argument forwarding with `...` now supports leading arguments.Yukihiro "Matz" Matsumoto
```ruby def method_missing(meth, ...) send(:"do_#{meth}", ...) end ```
2020-12-08Fix a bug caused by `tBDOT3` (argument forwarding).Yukihiro "Matz" Matsumoto
2020-12-05Fixed a memory leak bug on `codegen_error()` when `irep->rlen>255`.Yukihiro "Matz" Matsumoto
2020-12-05Make it possible that `libmruby.a` is not createdKOBAYASHI Shuji
Previously, `libmruby.a` was created even if only `mruby-bin-mrbc` or` mruby-compiler` was specified for gem, but by specifying `disable_libmruby`, the creation of `libmruby.a` can be suppressed. ### Note The https://github.com/mruby/mruby/pull/5084#issuecomment-723521971 incompatibility seems to be difficult for users to avoid, so the original behavior has been restored. Therefore, if we need `mrbc` other than the `host` build, we need to explicitly specify `mruby-bin-mrbc` gem. Due to the above changes, `build_config/boxing.rb` etc. will not work, but I have added` mruby-bin-mrbc` to `default.gembox` to fix it. I don't think this change is a big deal because originally `mruby-compiler` was included.
2020-12-04Move `mrbc` test to `mruby-bin-mrbc` gem from `mruby-compiler` gemKOBAYASHI Shuji
2020-12-02Fix build for C++ version >= C++11 when `enable_cxx_exception`; close #5199KOBAYASHI Shuji
2020-12-02Use `JMPLINK_START` instead of zero for a link start marker.Yukihiro "Matz" Matsumoto
2020-12-02Remove assertions to check catch handler offset to be in 16bits.Yukihiro "Matz" Matsumoto
2020-12-02Fixed memory leaks from `codegen_error`.Yukihiro "Matz" Matsumoto
2020-12-01Fix a ``OP_JMP` bug from `0` marker and address `0`.Yukihiro "Matz" Matsumoto
2020-11-29Change the catch handler address to 32 bitsdearblue
Follow commit 7150c6753933f12a2ba63769fb7b3a44cfcddd3d .
2020-11-26Avoid integer overflow in `rational_new`.Yukihiro "Matz" Matsumoto
2020-11-26Fix loop condition in `mrb_sym_all_symbols`KOBAYASHI Shuji
2020-11-26Make `OP_JMP*` operand address to be relative.Yukihiro "Matz" Matsumoto
Jump target address is `operand (16bit)` + `address of next instruction`. In addition, `ilen` was made `uint32_t` so that `iseq` length limitation of 65536 is removed. Only jump target address should be within signed 16bit (-32768 .. 32767).
2020-11-26Fix `Symbol.all_symbols` to include preallocated symbols; ref #5116Yukihiro "Matz" Matsumoto
2020-11-26Symbols should work with `MRB_USE_ALL_SYMBOLS`; fix #5116Yukihiro "Matz" Matsumoto
2020-11-25Replace mere `enable_debug` by clearer `conf.enable_debug` [ci skip]Yukihiro "Matz" Matsumoto
2020-11-24Use more `mrb_int_value()` instead of `mrb_fixnum_value()`.Yukihiro "Matz" Matsumoto
2020-11-24Move `MRB_NO_FLOAT` detection in `mruby-math`; #5185Yukihiro "Matz" Matsumoto
2020-11-22Remove `mrb_str_buf_new()` and `MRB_STR_BUF_MIN_SIZE`; close #5171Yukihiro "Matz" Matsumoto
2020-11-22Strictly speaking `NULL + 0` is a undefined behavior; ref #5157Yukihiro "Matz" Matsumoto
2020-11-22Refine build log for generated filesKOBAYASHI Shuji
* 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-22Merge pull request #5167 from dearblue/singleton-methodYukihiro "Matz" Matsumoto
Improved `Object#define_singleton_method`
2020-11-21Improved `Object#define_singleton_method`dearblue
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-21Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163KOBAYASHI Shuji
| 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-21Allow to mixed and specify `*.rb` and `*.mrb` in `bin/mruby`dearblue
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-19Allow `bintest` even if build name is not `host`KOBAYASHI Shuji
2020-11-18Fix integer overflow error in mrdb testKOBAYASHI Shuji
2020-11-18Retrieve `irep` from `proc` after `MRB_PROC_CFUNC_P` check; ref #5140Yukihiro "Matz" Matsumoto
2020-11-17Check division overflow (`MRB_INT_MIN` and `-1`).Yukihiro "Matz" Matsumoto
2020-11-17Overflown integers should not be fall back to float values.Yukihiro "Matz" Matsumoto
2020-11-14Merge pull request #5130 from ↵Yukihiro "Matz" Matsumoto
shuujii/workaround-to-build-mirb-with-Homebrews-readline-on-Mac Workaround to build `mirb` with Homebrew's readline on Mac; fix #4537
2020-11-14Workaround to build `mirb` with Homebrew's readline on Mac; fix #4537KOBAYASHI Shuji
2020-11-14Don't use private structs with `mrb_mt_foreach()`dearblue
The `MRB_API` function `mrb_mt_foreach()` previously used the private structure `struct mt_elem`. Therefore, use `mrb_method_t` instead.
2020-11-13Rename `mrb_os_memsize_of_hash_table` to `mrb_hash_memsize`KOBAYASHI Shuji
* The term `hash_table` can be misleading because the return value of this function includes memory usage of entire `Hash` object, including not only hash table part but also entry list part, etc. * This function takes a `Hash` object as a receiver and is defined in `src/hash.c`, so it is natural to have a `mrb_hash_` prefix.
2020-11-13Merge pull request #5122 from shuujii/change-name-and-usage-of-presym-macrosYukihiro "Matz" Matsumoto
Change name and usage of presym macros
2020-11-13Change name and usage of presym macrosKOBAYASHI Shuji
To be also able to build mruby without presym in the future. However, `MRB_QSYM` has been removed and changed as follows: ### Example | Type | Symbol | Previous Style | New Style | |---------------------------|--------|------------------|----------------| | Operator | & | MRB_QSYM(and) | MRB_OPSYM(and) | | Class Variable | @@foo | MRB_QSYM(00_foo) | MRB_CVSYM(foo) | | Instance Variable | @foo | MRB_QSYM(0_foo) | MRB_IVSYM(foo) | | Method with Bang | foo! | MRB_QSYM(foo_b) | MRB_SYM_B(foo) | | Method with Question mark | foo? | MRB_QSYM(foo_p) | MRB_SYM_Q(foo) | | Mmethod with Equal | foo= | MRB_QSYM(foo_e) | MRB_SYM_E(foo) | This change makes it possible to define, for example, `MRB_IVSYM(foo)` as `mrb_intern_lit(mrb, "@" "foo")`, which is useful if we support building without presym in the future.