mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ac96912e9 | |||
| 6a7561da5f | |||
| 628cf498a7 | |||
| cfc83bb6ac | |||
| 46e8101c03 | |||
| fff7db05bf | |||
| f98d6414dc | |||
| 8956c5abb5 | |||
| 8f3917f361 | |||
| 72c9e5d027 | |||
| 295b40534f | |||
| 5acc520a1e | |||
| f6f1a42039 | |||
| 9fff63b436 | |||
| 17ab42d4c9 | |||
| fcb665b88c | |||
| 550d10adb7 |
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"retryOn429": true,
|
||||
"retryCount": 3,
|
||||
"aliveStatusCodes": [
|
||||
200,
|
||||
206,
|
||||
502
|
||||
],
|
||||
"ignorePatterns": [
|
||||
{
|
||||
"pattern": "^https://github.com/mruby/mruby/commit/"
|
||||
},
|
||||
{
|
||||
"pattern": "^http://jp.rubyist.net/magazine/\\?0034-Enumerable_lz"
|
||||
},
|
||||
{
|
||||
"pattern": "^https://ruby-doc.org/core-2.3.3"
|
||||
},
|
||||
{
|
||||
"pattern": "^mailto:"
|
||||
},
|
||||
{
|
||||
"pattern": "^https://www.iso.org/"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
echo \`\`\`
|
||||
} > "$GITHUB_STEP_SUMMARY"
|
||||
- name: Upload coverage report
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: coverage-${{ github.sha }}
|
||||
path: coverage/
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
fuzz-seconds: 600
|
||||
dry-run: false
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
if: failure()
|
||||
with:
|
||||
name: artifacts
|
||||
|
||||
+2
-15
@@ -20,8 +20,8 @@ repos:
|
||||
- id: prettier
|
||||
name: run prettier
|
||||
description: format files with prettier
|
||||
entry: prettier --write '**/*.json' '**/*.md' '**/*.yaml' '**/*.yml'
|
||||
files: \.(json|md|ya?ml)$
|
||||
entry: prettier --write '**/*.md' '**/*.yaml' '**/*.yml'
|
||||
files: \.(md|ya?ml)$
|
||||
language: node
|
||||
additional_dependencies: ["prettier@3.7.4"]
|
||||
stages: [manual]
|
||||
@@ -55,9 +55,6 @@ repos:
|
||||
- id: check-executables-have-shebangs
|
||||
exclude: ^test/t/lang\.rb$
|
||||
- id: check-illegal-windows-names
|
||||
- id: pretty-format-json
|
||||
args: [--autofix, --no-sort-keys]
|
||||
- id: check-json
|
||||
- id: check-merge-conflict
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-vcs-permalinks
|
||||
@@ -107,16 +104,6 @@ repos:
|
||||
args: [--config=.github/linters/.markdown-lint.yml]
|
||||
types: [markdown]
|
||||
files: \.md$
|
||||
- repo: https://github.com/tcort/markdown-link-check
|
||||
rev: v3.14.2
|
||||
hooks:
|
||||
- id: markdown-link-check
|
||||
name: run markdown-link-check
|
||||
description: checks hyperlinks in Markdown files
|
||||
args: [--config=.github/linters/mlc_config.json, -q]
|
||||
stages: [manual]
|
||||
types: [markdown]
|
||||
files: \.md$
|
||||
- repo: https://github.com/rubocop/rubocop
|
||||
rev: v1.81.7
|
||||
hooks:
|
||||
|
||||
@@ -51,8 +51,6 @@ To get mruby, you can download the stable version 4.0.0 from the official mruby
|
||||
GitHub repository or clone the trunk of the mruby source tree with the "git
|
||||
clone" command. You can also install and compile mruby using [ruby-install](https://github.com/postmodern/ruby-install), [ruby-build](https://github.com/rbenv/ruby-build), [rvm](https://github.com/rvm/rvm), [conda](https://anaconda.org/channels/conda-forge/packages/mruby/overview) or [Homebrew](https://formulae.brew.sh/formula/mruby).
|
||||
|
||||
The release candidate version 4.0.0 of mruby can be downloaded via the following URL: [https://github.com/mruby/mruby/archive/4.0.0-rc.zip](https://github.com/mruby/mruby/archive/4.0.0-rc.zip)
|
||||
|
||||
The latest development version of mruby can be downloaded via the following URL: [https://github.com/mruby/mruby/zipball/master](https://github.com/mruby/mruby/zipball/master)
|
||||
|
||||
The trunk of the mruby source tree can be checked out with the
|
||||
|
||||
+68
-68
@@ -99,23 +99,23 @@ mrb_str_to_cstr(mrb, v) /* const char* from String value */
|
||||
|
||||
### Value Types
|
||||
|
||||
| `mrb_vtype` | Ruby Class | Notes |
|
||||
| ----------- | ---------- | ----- |
|
||||
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
|
||||
| `MRB_TT_TRUE` | TrueClass | |
|
||||
| `MRB_TT_INTEGER` | Integer | Immediate value |
|
||||
| `MRB_TT_FLOAT` | Float | May be immediate |
|
||||
| `MRB_TT_SYMBOL` | Symbol | Immediate value |
|
||||
| `MRB_TT_STRING` | String | Heap object |
|
||||
| `MRB_TT_ARRAY` | Array | Heap object |
|
||||
| `MRB_TT_HASH` | Hash | Heap object |
|
||||
| `MRB_TT_OBJECT` | Object | User-defined classes |
|
||||
| `MRB_TT_CLASS` | Class | |
|
||||
| `MRB_TT_MODULE` | Module | |
|
||||
| `MRB_TT_PROC` | Proc | |
|
||||
| `MRB_TT_CDATA` | (C data) | Wrapped C structs |
|
||||
| `MRB_TT_EXCEPTION` | Exception | |
|
||||
| `MRB_TT_FIBER` | Fiber | |
|
||||
| `mrb_vtype` | Ruby Class | Notes |
|
||||
| ------------------ | ------------------- | ------------------------ |
|
||||
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
|
||||
| `MRB_TT_TRUE` | TrueClass | |
|
||||
| `MRB_TT_INTEGER` | Integer | Immediate value |
|
||||
| `MRB_TT_FLOAT` | Float | May be immediate |
|
||||
| `MRB_TT_SYMBOL` | Symbol | Immediate value |
|
||||
| `MRB_TT_STRING` | String | Heap object |
|
||||
| `MRB_TT_ARRAY` | Array | Heap object |
|
||||
| `MRB_TT_HASH` | Hash | Heap object |
|
||||
| `MRB_TT_OBJECT` | Object | User-defined classes |
|
||||
| `MRB_TT_CLASS` | Class | |
|
||||
| `MRB_TT_MODULE` | Module | |
|
||||
| `MRB_TT_PROC` | Proc | |
|
||||
| `MRB_TT_CDATA` | (C data) | Wrapped C structs |
|
||||
| `MRB_TT_EXCEPTION` | Exception | |
|
||||
| `MRB_TT_FIBER` | Fiber | |
|
||||
|
||||
## Defining Classes and Modules
|
||||
|
||||
@@ -165,15 +165,15 @@ mrb_define_module_function(mrb, mod, "name", my_method, MRB_ARGS_ANY());
|
||||
|
||||
### Argument Specifiers
|
||||
|
||||
| Macro | Meaning |
|
||||
| ----- | ------- |
|
||||
| `MRB_ARGS_NONE()` | No arguments |
|
||||
| `MRB_ARGS_REQ(n)` | `n` required arguments |
|
||||
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
|
||||
| `MRB_ARGS_ARG(r,o)` | `r` required + `o` optional |
|
||||
| `MRB_ARGS_REST()` | Splat (`*args`) |
|
||||
| `MRB_ARGS_BLOCK()` | Block (`&block`) |
|
||||
| `MRB_ARGS_ANY()` | Any number (same as REST) |
|
||||
| Macro | Meaning |
|
||||
| ---------------------- | ------------------------------------- |
|
||||
| `MRB_ARGS_NONE()` | No arguments |
|
||||
| `MRB_ARGS_REQ(n)` | `n` required arguments |
|
||||
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
|
||||
| `MRB_ARGS_ARG(r,o)` | `r` required + `o` optional |
|
||||
| `MRB_ARGS_REST()` | Splat (`*args`) |
|
||||
| `MRB_ARGS_BLOCK()` | Block (`&block`) |
|
||||
| `MRB_ARGS_ANY()` | Any number (same as REST) |
|
||||
| `MRB_ARGS_KEY(n,rest)` | `n` keyword args, `rest`=1 for `**kw` |
|
||||
|
||||
These can be combined with `|`:
|
||||
@@ -192,27 +192,27 @@ mrb_int mrb_get_args(mrb_state *mrb, const char *format, ...);
|
||||
|
||||
### Format Specifiers
|
||||
|
||||
| Spec | Ruby Type | C Type(s) | Notes |
|
||||
| ---- | --------- | --------- | ----- |
|
||||
| `o` | any | `mrb_value` | No type check |
|
||||
| `i` | Numeric | `mrb_int` | Coerces to integer |
|
||||
| `f` | Numeric | `mrb_float` | Coerces to float |
|
||||
| `b` | any | `mrb_bool` | Truthiness |
|
||||
| `n` | String/Symbol | `mrb_sym` | Converts to symbol |
|
||||
| `s` | String | `const char*, mrb_int` | Pointer + length |
|
||||
| `z` | String | `const char*` | Null-terminated |
|
||||
| `S` | String | `mrb_value` | String value |
|
||||
| `A` | Array | `mrb_value` | Array value |
|
||||
| `H` | Hash | `mrb_value` | Hash value |
|
||||
| `C` | Class | `mrb_value` | Class/Module value |
|
||||
| `c` | Class | `struct RClass*` | Class pointer |
|
||||
| `a` | Array | `const mrb_value*, mrb_int` | Array pointer + length |
|
||||
| `d` | C Data | `void*` | Requires `mrb_data_type*` |
|
||||
| `&` | Block | `mrb_value` | Block argument |
|
||||
| `*` | rest | `const mrb_value*, mrb_int` | Rest arguments |
|
||||
| `\|` | — | — | Following args are optional |
|
||||
| `?` | — | `mrb_bool` | Was previous optional arg given? |
|
||||
| `:` | keywords | `mrb_kwargs` | Keyword arguments |
|
||||
| Spec | Ruby Type | C Type(s) | Notes |
|
||||
| ---- | ------------- | --------------------------- | -------------------------------- |
|
||||
| `o` | any | `mrb_value` | No type check |
|
||||
| `i` | Numeric | `mrb_int` | Coerces to integer |
|
||||
| `f` | Numeric | `mrb_float` | Coerces to float |
|
||||
| `b` | any | `mrb_bool` | Truthiness |
|
||||
| `n` | String/Symbol | `mrb_sym` | Converts to symbol |
|
||||
| `s` | String | `const char*, mrb_int` | Pointer + length |
|
||||
| `z` | String | `const char*` | Null-terminated |
|
||||
| `S` | String | `mrb_value` | String value |
|
||||
| `A` | Array | `mrb_value` | Array value |
|
||||
| `H` | Hash | `mrb_value` | Hash value |
|
||||
| `C` | Class | `mrb_value` | Class/Module value |
|
||||
| `c` | Class | `struct RClass*` | Class pointer |
|
||||
| `a` | Array | `const mrb_value*, mrb_int` | Array pointer + length |
|
||||
| `d` | C Data | `void*` | Requires `mrb_data_type*` |
|
||||
| `&` | Block | `mrb_value` | Block argument |
|
||||
| `*` | rest | `const mrb_value*, mrb_int` | Rest arguments |
|
||||
| `\|` | — | — | Following args are optional |
|
||||
| `?` | — | `mrb_bool` | Was previous optional arg given? |
|
||||
| `:` | keywords | `mrb_kwargs` | Keyword arguments |
|
||||
|
||||
Adding `!` to `S`, `A`, `H`, `C`, `c`, `s`, `z`, `a`, `d` allows `nil`
|
||||
(returns NULL/zero for nil).
|
||||
@@ -608,14 +608,14 @@ my_yield_method(mrb_state *mrb, mrb_value self)
|
||||
|
||||
### Fiber States
|
||||
|
||||
| State | Meaning |
|
||||
| ----- | ------- |
|
||||
| `MRB_FIBER_CREATED` | Created but not yet resumed |
|
||||
| `MRB_FIBER_RUNNING` | Currently executing |
|
||||
| `MRB_FIBER_RESUMED` | Resumed another fiber |
|
||||
| `MRB_FIBER_SUSPENDED` | Yielded, waiting to resume |
|
||||
| State | Meaning |
|
||||
| ----------------------- | -------------------------------- |
|
||||
| `MRB_FIBER_CREATED` | Created but not yet resumed |
|
||||
| `MRB_FIBER_RUNNING` | Currently executing |
|
||||
| `MRB_FIBER_RESUMED` | Resumed another fiber |
|
||||
| `MRB_FIBER_SUSPENDED` | Yielded, waiting to resume |
|
||||
| `MRB_FIBER_TRANSFERRED` | Transferred via `Fiber#transfer` |
|
||||
| `MRB_FIBER_TERMINATED` | Finished execution |
|
||||
| `MRB_FIBER_TERMINATED` | Finished execution |
|
||||
|
||||
**Limitation:** fibers cannot yield across C function boundaries.
|
||||
You cannot call `mrb_fiber_yield` from within a C-implemented
|
||||
@@ -644,13 +644,13 @@ mrb_ccontext_free(mrb, cxt);
|
||||
|
||||
The `mrb_ccontext` structure provides several flags:
|
||||
|
||||
| Field | Purpose |
|
||||
| ----- | ------- |
|
||||
| Field | Purpose |
|
||||
| ---------------- | --------------------------------------- |
|
||||
| `capture_errors` | Collect parse errors instead of raising |
|
||||
| `no_exec` | Compile without executing (get RProc) |
|
||||
| `no_optimize` | Disable peephole optimizations |
|
||||
| `no_ext_ops` | Disable extended operand instructions |
|
||||
| `keep_lv` | Preserve local variables across loads |
|
||||
| `no_exec` | Compile without executing (get RProc) |
|
||||
| `no_optimize` | Disable peephole optimizations |
|
||||
| `no_ext_ops` | Disable extended operand instructions |
|
||||
| `keep_lv` | Preserve local variables across loads |
|
||||
|
||||
### Loading with Context
|
||||
|
||||
@@ -843,14 +843,14 @@ $ build/host/bin/mruby-config --libs # libraries
|
||||
|
||||
Key macros that affect ABI:
|
||||
|
||||
| Macro | Effect |
|
||||
| ----- | ------ |
|
||||
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
|
||||
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
|
||||
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
|
||||
| `MRB_NO_FLOAT` | Disable Float support |
|
||||
| `MRB_INT64` | 64-bit integers |
|
||||
| `MRB_USE_FLOAT32` | 32-bit floats |
|
||||
| Macro | Effect |
|
||||
| ----------------- | ---------------------------------------- |
|
||||
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
|
||||
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
|
||||
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
|
||||
| `MRB_NO_FLOAT` | Disable Float support |
|
||||
| `MRB_INT64` | 64-bit integers |
|
||||
| `MRB_USE_FLOAT32` | 32-bit floats |
|
||||
|
||||
Mismatching these between library and application causes silent
|
||||
data corruption.
|
||||
|
||||
@@ -378,8 +378,8 @@ This means subclassing `Array` or `String` and adding `@fields` will raise an er
|
||||
|
||||
### Operator Overriding
|
||||
|
||||
Operators of primitive classes cannot be overridden by user code.
|
||||
Redefining `String#+` has no effect on the behavior of the `+` __operator__.
|
||||
Operators of primitive classes cannot be overridden by user code.
|
||||
Redefining `String#+` has no effect on the behavior of the `+` operator.
|
||||
|
||||
### Module Loading Hooks
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ Include `<mruby/class.h>` (which provides `mrb_mt_entry`,
|
||||
|
||||
```c
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static const mrb_mt_entry my_rom_entries[] = {
|
||||
MRB_MT_ENTRY(my_method_a, MRB_SYM(method_a), MRB_ARGS_REQ(1)),
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
*/
|
||||
#include <mruby/internal.h>
|
||||
|
||||
/*
|
||||
* The "mruby/presym.h" file is placed at the end of the mruby header file.
|
||||
*/
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* Define your own struct RBigint.
|
||||
*
|
||||
|
||||
+3
-1
@@ -1015,7 +1015,7 @@ typedef const char *mrb_args_format;
|
||||
* mrb_value str, kw_rest;
|
||||
* uint32_t kw_num = 3;
|
||||
* uint32_t kw_required = 1;
|
||||
* // Note that `#include <mruby/presym.h>` is required beforehand because `MRB_SYM()` is used.
|
||||
* // `MRB_SYM()` is available via `mruby.h` (which includes `mruby/presym.h`).
|
||||
* // If the usage of `MRB_SYM()` is not desired, replace it with `mrb_intern_lit()`.
|
||||
* mrb_sym kw_names[] = { MRB_SYM(x), MRB_SYM(y), MRB_SYM(z) };
|
||||
* mrb_value kw_values[kw_num];
|
||||
@@ -1594,6 +1594,8 @@ MRB_API mrb_value mrb_format(mrb_state *mrb, const char *format, ...);
|
||||
|
||||
#ifdef MRB_PRESYM_SCANNING
|
||||
# include <mruby/presym/scanning.h>
|
||||
#else
|
||||
# include <mruby/presym.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -57,7 +57,7 @@ MRB_BEGIN_DECL
|
||||
/*
|
||||
* Patch level string. (optional)
|
||||
*/
|
||||
#define MRUBY_PATCHLEVEL_STR "RC"
|
||||
#define MRUBY_PATCHLEVEL_STR ""
|
||||
|
||||
#ifndef MRUBY_PATCHLEVEL_STR
|
||||
# if MRUBY_PATCHLEVEL < 0
|
||||
@@ -80,17 +80,17 @@ MRB_BEGIN_DECL
|
||||
/*
|
||||
* Release year.
|
||||
*/
|
||||
#define MRUBY_RELEASE_YEAR 2026
|
||||
#define MRUBY_RELEASE_YEAR 2025
|
||||
|
||||
/*
|
||||
* Release month.
|
||||
*/
|
||||
#define MRUBY_RELEASE_MONTH 3
|
||||
#define MRUBY_RELEASE_MONTH 4
|
||||
|
||||
/*
|
||||
* Release day.
|
||||
*/
|
||||
#define MRUBY_RELEASE_DAY 5
|
||||
#define MRUBY_RELEASE_DAY 20
|
||||
|
||||
/*
|
||||
* Release date as a string.
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "socket_hal.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "socket_hal.h"
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/khash.h>
|
||||
#include <mruby/error.h>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "apiprint.h"
|
||||
|
||||
static void
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/internal.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <io.h> /* for setmode */
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/debug.h>
|
||||
#include <mruby/internal.h>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static mrb_value
|
||||
binding_in_c(mrb_state *mrb, mrb_value self)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/* Pre-defined symbols used by catch implementation */
|
||||
MRB_PRESYM_DEFINE_VAR_AND_INITER(catch_syms, 3, MRB_SYM(Object), MRB_SYM(new), MRB_SYM(call))
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* Get the name of a module/class.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
|
||||
#include <mruby.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifdef MRB_NO_FLOAT
|
||||
# error CMath conflicts with 'MRB_NO_FLOAT' configuration
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/debug.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "node.h"
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/re.h>
|
||||
@@ -3821,7 +3820,7 @@ codegen_array(codegen_scope *s, node *varnode, int val)
|
||||
node *elements = array->elements;
|
||||
int regular_elements = 0;
|
||||
int first = 1;
|
||||
int slimit = GEN_VAL_STACK_MAX;
|
||||
int slimit = GEN_LIT_ARY_MAX;
|
||||
|
||||
if (!val) return;
|
||||
|
||||
@@ -3831,7 +3830,7 @@ codegen_array(codegen_scope *s, node *varnode, int val)
|
||||
return;
|
||||
}
|
||||
|
||||
if (cursp() >= GEN_LIT_ARY_MAX) slimit = INT16_MAX;
|
||||
if (cursp() >= slimit) slimit = GEN_VAL_STACK_MAX;
|
||||
|
||||
/* Process each element using cons-list iteration, handling splats */
|
||||
node *current = elements;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "node.h"
|
||||
|
||||
#define YYLEX_PARAM p
|
||||
|
||||
@@ -85,7 +85,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "node.h"
|
||||
|
||||
#define YYLEX_PARAM p
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <float.h>
|
||||
|
||||
#ifdef MRB_NO_FLOAT
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define RDATA_LEN(st) RARRAY_LEN(st)
|
||||
#define RDATA_PTR(st) RARRAY_PTR(st)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "dir_hal.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define ENC_ASCII_8BIT "ASCII-8BIT"
|
||||
#define ENC_BINARY "BINARY"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/internal.h>
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o))
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/io.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "io_hal.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/io.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/internal.h>
|
||||
#include "io_hal.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <mruby/io.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "io_hal.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#endif
|
||||
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static void
|
||||
domain_error(mrb_state *mrb, const char *func)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/khash.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define MT_PROTECTED MRB_METHOD_PROTECTED_FL
|
||||
#define MT_NOPRIV (MRB_METHOD_PRIVATE_FL|MT_PROTECTED)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
// Defined by mruby-proc-ext on which mruby-method depends
|
||||
mrb_value mrb_proc_parameters(mrb_state *mrb, mrb_value proc);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef MRB_NO_FLOAT
|
||||
static mrb_value flo_remainder(mrb_state *mrb, mrb_value self);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/value.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct os_count_struct {
|
||||
mrb_int total;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/endian.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/variable.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/debug.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static mrb_bool
|
||||
r_less(mrb_state *mrb, mrb_value a, mrb_value b, mrb_bool excl)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef MRB_NO_FLOAT
|
||||
#include <math.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/khash.h>
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#endif
|
||||
|
||||
#include <mruby.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#include <mruby/io.h>
|
||||
#include "socket_hal.h"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/time.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define ENC_ASCII_8BIT "ASCII-8BIT"
|
||||
#define ENC_BINARY "BINARY"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define RSTRUCT_LEN(st) RARRAY_LEN(st)
|
||||
#define RSTRUCT_PTR(st) RARRAY_PTR(st)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <mruby/gc.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/time.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifdef MRB_NO_STDIO
|
||||
#include <string.h>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "value_array.h"
|
||||
|
||||
#define ARY_DEFAULT_LEN 4
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define MAX_IREP_REFCNT UINT16_MAX
|
||||
#define UNKNOWN_LINENO -1
|
||||
|
||||
@@ -456,7 +456,6 @@ mrb_dump_irep_cstruct(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE
|
||||
"#include <mruby/irep.h>\n"
|
||||
"#include <mruby/debug.h>\n"
|
||||
"#include <mruby/proc.h>\n"
|
||||
"#include <mruby/presym.h>\n"
|
||||
"\n") < 0) {
|
||||
return MRB_DUMP_WRITE_FAULT;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/* mrb_mt_tbl, union mrb_mt_ptr, mrb_mt_entry defined in internal.h */
|
||||
#define MT_PROTECTED MRB_METHOD_PROTECTED_FL
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <mruby.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/* internal method `__update_hash(oldhash, index, itemhash)` */
|
||||
static mrb_value
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
void
|
||||
mrb_exc_mesg_set(mrb_state *mrb, struct RException *exc, mrb_value mesg)
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifdef MRB_GC_STRESS
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* Checks if the method `mid` for object `obj` is implemented by
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef MRB_NO_FLOAT
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
MRB_API mrb_value
|
||||
mrb_num_add(mrb_state *mrb, mrb_value x, mrb_value y)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* Checks if two mruby values, `v1` and `v2`, are identical.
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <string.h>
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static const mrb_code call_iseq[] = {
|
||||
OP_CALL,
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define RANGE_INITIALIZED_FLAG 1
|
||||
#define RANGE_INITIALIZED(p) ((p)->flags |= RANGE_INITIALIZED_FLAG)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct mrb_shared_string {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef MRB_PRESYM_SCANNING
|
||||
/* const uint16_t presym_length_table[] */
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/* Instance variable table structure */
|
||||
typedef struct iv_tbl {
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/internal.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifdef MRB_NO_STDIO
|
||||
#if defined(__cplusplus)
|
||||
@@ -708,7 +707,9 @@ prepare_missing(mrb_state *mrb, mrb_callinfo *ci, mrb_value recv, mrb_sym mid, m
|
||||
}
|
||||
else {
|
||||
mrb_assert(ci->nk == 15);
|
||||
argv[1] = argv[ci->n];
|
||||
if (ci->n != CALL_MAXARGS) {
|
||||
argv[1] = argv[ci->n]; /* keyword arguments */
|
||||
}
|
||||
argv[2] = blk;
|
||||
}
|
||||
argv[0] = args; /* must be replaced after saving argv[0] as it may be a keyword argument */
|
||||
|
||||
+7
-9
@@ -7,8 +7,6 @@ all_prerequisites = ->(task_name, prereqs) do
|
||||
end
|
||||
|
||||
MRuby.each_target do |build|
|
||||
gensym_task = task(:gensym)
|
||||
|
||||
presym = build.presym
|
||||
|
||||
include_dir = "#{build.build_dir}/include"
|
||||
@@ -34,12 +32,12 @@ MRuby.each_target do |build|
|
||||
file presym.list_path => ppps do
|
||||
presyms = presym.scan(ppps)
|
||||
current_presyms = presym.read_list if File.exist?(presym.list_path)
|
||||
update = presyms != current_presyms
|
||||
presym.write_list(presyms) if update
|
||||
mkdir_p presym.header_dir
|
||||
%w[id table].each do |type|
|
||||
next if !update && File.exist?(presym.send("#{type}_header_path"))
|
||||
presym.send("write_#{type}_header", presyms)
|
||||
if presyms != current_presyms
|
||||
mkdir_p presym.header_dir
|
||||
%w[id table].each do |type|
|
||||
presym.send("write_#{type}_header", presyms)
|
||||
end
|
||||
presym.write_list(presyms)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,5 +53,5 @@ MRuby.each_target do |build|
|
||||
file prereq => presym.list_path
|
||||
end
|
||||
|
||||
gensym_task.enhance([presym.list_path])
|
||||
task gensym: presym.list_path
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user