mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ac96912e9 |
+6
-6
@@ -100,7 +100,7 @@ mrb_str_to_cstr(mrb, v) /* const char* from String value */
|
|||||||
### Value Types
|
### Value Types
|
||||||
|
|
||||||
| `mrb_vtype` | Ruby Class | Notes |
|
| `mrb_vtype` | Ruby Class | Notes |
|
||||||
| ----------- | ---------- | ----- |
|
| ------------------ | ------------------- | ------------------------ |
|
||||||
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
|
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
|
||||||
| `MRB_TT_TRUE` | TrueClass | |
|
| `MRB_TT_TRUE` | TrueClass | |
|
||||||
| `MRB_TT_INTEGER` | Integer | Immediate value |
|
| `MRB_TT_INTEGER` | Integer | Immediate value |
|
||||||
@@ -166,7 +166,7 @@ mrb_define_module_function(mrb, mod, "name", my_method, MRB_ARGS_ANY());
|
|||||||
### Argument Specifiers
|
### Argument Specifiers
|
||||||
|
|
||||||
| Macro | Meaning |
|
| Macro | Meaning |
|
||||||
| ----- | ------- |
|
| ---------------------- | ------------------------------------- |
|
||||||
| `MRB_ARGS_NONE()` | No arguments |
|
| `MRB_ARGS_NONE()` | No arguments |
|
||||||
| `MRB_ARGS_REQ(n)` | `n` required arguments |
|
| `MRB_ARGS_REQ(n)` | `n` required arguments |
|
||||||
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
|
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
|
||||||
@@ -193,7 +193,7 @@ mrb_int mrb_get_args(mrb_state *mrb, const char *format, ...);
|
|||||||
### Format Specifiers
|
### Format Specifiers
|
||||||
|
|
||||||
| Spec | Ruby Type | C Type(s) | Notes |
|
| Spec | Ruby Type | C Type(s) | Notes |
|
||||||
| ---- | --------- | --------- | ----- |
|
| ---- | ------------- | --------------------------- | -------------------------------- |
|
||||||
| `o` | any | `mrb_value` | No type check |
|
| `o` | any | `mrb_value` | No type check |
|
||||||
| `i` | Numeric | `mrb_int` | Coerces to integer |
|
| `i` | Numeric | `mrb_int` | Coerces to integer |
|
||||||
| `f` | Numeric | `mrb_float` | Coerces to float |
|
| `f` | Numeric | `mrb_float` | Coerces to float |
|
||||||
@@ -609,7 +609,7 @@ my_yield_method(mrb_state *mrb, mrb_value self)
|
|||||||
### Fiber States
|
### Fiber States
|
||||||
|
|
||||||
| State | Meaning |
|
| State | Meaning |
|
||||||
| ----- | ------- |
|
| ----------------------- | -------------------------------- |
|
||||||
| `MRB_FIBER_CREATED` | Created but not yet resumed |
|
| `MRB_FIBER_CREATED` | Created but not yet resumed |
|
||||||
| `MRB_FIBER_RUNNING` | Currently executing |
|
| `MRB_FIBER_RUNNING` | Currently executing |
|
||||||
| `MRB_FIBER_RESUMED` | Resumed another fiber |
|
| `MRB_FIBER_RESUMED` | Resumed another fiber |
|
||||||
@@ -645,7 +645,7 @@ mrb_ccontext_free(mrb, cxt);
|
|||||||
The `mrb_ccontext` structure provides several flags:
|
The `mrb_ccontext` structure provides several flags:
|
||||||
|
|
||||||
| Field | Purpose |
|
| Field | Purpose |
|
||||||
| ----- | ------- |
|
| ---------------- | --------------------------------------- |
|
||||||
| `capture_errors` | Collect parse errors instead of raising |
|
| `capture_errors` | Collect parse errors instead of raising |
|
||||||
| `no_exec` | Compile without executing (get RProc) |
|
| `no_exec` | Compile without executing (get RProc) |
|
||||||
| `no_optimize` | Disable peephole optimizations |
|
| `no_optimize` | Disable peephole optimizations |
|
||||||
@@ -844,7 +844,7 @@ $ build/host/bin/mruby-config --libs # libraries
|
|||||||
Key macros that affect ABI:
|
Key macros that affect ABI:
|
||||||
|
|
||||||
| Macro | Effect |
|
| Macro | Effect |
|
||||||
| ----- | ------ |
|
| ----------------- | ---------------------------------------- |
|
||||||
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
|
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
|
||||||
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
|
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
|
||||||
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
|
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
|
||||||
|
|||||||
Reference in New Issue
Block a user