| Age | Commit message (Collapse) | Author |
|
|
|
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `int`.
|
|
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `inum`.
|
|
|
|
Because the current behavior of `__method__` is equivalent to `__callee__`.
Example:
# example.rb
def src
__send__(ARGV[0])
end
alias dst src
%w[src dst].each {|n| puts "call #{n} => #{__send__(n).inspect}"}
Ruby:
$ ruby example.rb __method__
call src => :src
call dst => :src
$ ruby example.rb __callee__
call src => :src
call dst => :dst
mruby:
$ mruby example.rb __method__
call src => :src
call dst => :dst
|
|
And merged to `mrb_f_integer()` which is only usage of the function.
|
|
They return the checking argument without modification, so the values
are already there. Maybe we should change the return type to `void` but
keep them unchanged for compatibility.
|
|
|
|
|
|
Consistent number conversion function names:
* `mrb_value` to immediate (C) value
* `mrb_int()` -> `mrb_as_int()`
* `mrb_to_flo()` -> `mrb_as_float()`
* `mrb_value` to `mrb_value` (converted)
* `mrb_to_int()'
* `mrb_Integer()` - removed
* `mrb_Float()` -> `mrb_to_float`
Consistent function name (avoid `_flo` suffix):
* `mrb_div_flo()` -> `mrb_div_float`
|
|
The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.
Running these checks:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true
https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter
Added the GitHub Super Linter badge to the README.
Also updated the pre-commit framework and added
more documentation on pre-commit.
Added one more pre-commit check: check-executables-have-shebangs
Added one extra check for merge conflicts to our
GitHub Actions.
EditorConfig and Markdown linting.
Minor grammar and spelling fixes.
Update linter.yml
|
|
This reverts commit dc51d89ac22acc60b9bfeed87115863565b74085.
|
|
Instead of including `mruby/presym.h` everywhere, we provided the
fallback `mruby/presym.inc` under `include/mruby` directory, and specify
`-I<build-dir>/include` before `-I<top-dir>/include` in `presym.rake`.
So even when someone drops `-I<build-dir>/include` in compiler options,
it just compiles without failure.
|
|
Addressed an issue where existing programs linking `libmruby.a` could only
be built by adding `<build-dir>/include` to compiler's include path.
|
|
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.
|
|
Rename new functions:
- `mrb_convert_type(mrb,val,type,tname,method)`
=> `mrb_type_convert(mrb,val,type,tname,method)`
- `mrb_check_convert_type(mrb,val,type,tname,method)`
=> `mrb_type_convert_check(mrb,val,type,tname,method)`
Old names are defined by macros (support `tname` drop and
`char*` => `mrb_sym` conversion).
|
|
* The `Fixnum` constant is now an alias for the `Integer` class.
* Remove `struct mrb_state::fixnum_class` member.
If necessary, use `struct mrb_state::integer_class` instead.
|
|
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT`
- `MRB_USE_FLOAT` => `MRB_USE_FLOAT32`
The former is to use `USE_XXX` naming convention. The latter is to make
sure `float` is 32bit float and not floating point number in general.
|
|
- `mrb_convert_type`
- `mrb_check_convert_type`
Those function no longer take `tname` string representation of desired
type, and take method symbols instead of `const char*` names. This is
incompatible change. I hope no third-party gems use those functions.
|
|
Except for support files e.g. `mruby-test/driver.c`, which are not
target of symbol collection via `rake gensym`.
|
|
`mrb_get_arg1()` raises `ArgumentError` if the method does not receive one
argument.
And replaces all `mrb_get_args(mrb, "o", &arg)` by the new function.
|
|
|
|
For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for
all `enum mrb_vtype`).
|
|
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in
my environment than before the introduction of new specifiers/modifiers
(5116789a) with this change.
------------+-------------------+-------------------+--------
BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO
------------+-------------------+-------------------+--------
mruby | 593416 bytes | 593208 bytes | -0.04%
libmruby.a | 769048 bytes | 767264 bytes | -0.23%
------------+-------------------+-------------------+--------
BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613,
so I put it back.
|
|
|
|
#4449
The former should contain function like methods, and the latter should
contain methods shared by all objects.
|
|
|
|
|
|
We have added internal convenience method `__to_str` which
does string type check.
The issue #3854 was fixed but fundamental flaw of lack of stack
depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA`
for workaround.
|
|
The ISO standard does not include implicit type conversion using
`to_int`. This implicit conversion often causes vulnerability.
There will be no more attacks like #4120.
In addition, we have added internal convenience method `__to_int` which
does type check and conversion (from floats).
|
|
|
|
|
|
|
|
|
|
The new API is:
int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc)
The new argument `trunc` is a boolean value that specifies
whether the function truncates the range. The new return value
is an integer instead of a boolean, that is:
0: not a range
1: range with proper edges
2: out of range
To get the old behavior, you have to rewrite:
mrb_range_beg_len(mrb, range, &beg, &len, len)
to:
mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1
[Breaking Change]
|
|
|
|
|
|
|
|
This reverts commit 5cdcce8dbddd94ecb9503a0a1d47370c4ef97177.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|