Commit Graph

15065 Commits

Author SHA1 Message Date
dearblue 8665f88791 Allow an empty string for String#bytesplice 2023-04-15 21:26:01 +09:00
dearblue 59931e95c4 Prohibit string lengths less than 0 in String#bytesplice 2023-04-15 21:26:00 +09:00
dearblue 5bc3a48ecb Handling negative indices in String#bytesplice 2023-04-15 21:25:59 +09:00
dearblue dcced0016c Countermeasure to overflow for String#bytesplice 2023-04-15 21:25:58 +09:00
dearblue 73b6c6619c Need type check for replace by String#bytesplice 2023-04-15 21:25:57 +09:00
dearblue 2e9ac8f448 Returns self for String#bytesplice 2023-04-15 21:25:56 +09:00
dearblue c981e151ae Sign extension with OP_LOADI32 in get_int_operand()
Previously, the following code did not give the expected result.

```
% bin/mruby -e 'p "%08X" % ~(-1 << 16)'
"..F0000FFFF"

% ruby32 -e 'p "%08X" % ~(-1 << 24)'
"00FFFFFF"
```

For information: this problem arises in the process of folding numbers through optimisation.
2023-04-15 20:52:43 +09:00
Yukihiro "Matz" Matsumoto 836bebc708 mruby-compar-ext/compar.rb: Comparable#clamp to accept nil as arguments 2023-04-14 01:06:29 +09:00
Yukihiro "Matz" Matsumoto 68c58eac91 Merge pull request #5981 from dearblue/binding-only-ruby
`Kernel#binding` responds only to calls from Ruby
2023-04-14 01:06:16 +09:00
Yukihiro "Matz" Matsumoto c80db85ed5 Merge pull request #5980 from dearblue/binding-noise
Remove noise in new `mruby-binding`
2023-04-14 01:05:05 +09:00
Yukihiro "Matz" Matsumoto 4f125a3f19 mruby-struct/struct.c: allow struct size differ from members
The situation may be caused by `Struct.new(...).alloc` etc.
2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto 8af45425d0 mruby-struct/struct.c: Struct.new should take 1+ arguments 2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto bb7b4b67ae mruby-struct/struct.c (struct_corrupted): fix error message 2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto a7c96edf6f mruby-struct/struct.c: prohibit Struct.allocate; ref #5979 2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto 9822c843e9 mruby-array-ext/array.c: remove mrb_ prefix from static functions 2023-04-13 07:39:05 +09:00
John Bampton 00d43ad960 Add Docker to build and run all mruby tests
Run `pre-commit` and  generate `YARD` docs with Docker

Update CONTRIBUTING
2023-04-13 00:12:32 +10:00
John Bampton 976ec87100 Add the pull request labeler Action
https://github.com/actions/labeler
https://github.com/marketplace/actions/labeler

Verified Action

Update labeler.yml
2023-04-12 19:25:51 +10:00
Yukihiro "Matz" Matsumoto 8d014e9f43 Merge pull request #5984 from mruby/dependabot/github_actions/github/super-linter-5.0.0
build(deps): bump github/super-linter from 4.10.1 to 5.0.0
2023-04-12 09:12:00 +09:00
dependabot[bot] 71e78428ea build(deps): bump github/super-linter from 4.10.1 to 5.0.0
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.10.1 to 5.0.0.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v4.10.1...v5.0.0)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-11 14:57:54 +00:00
Yukihiro "Matz" Matsumoto 0df3e68a5d Merge pull request #5979 from dearblue/allocate-undef
Allow `Class#allocate` to be prohibited
2023-04-10 10:45:00 +09:00
dearblue 5cb2764279 Kernel#binding responds only to calls from Ruby
This follows the behavior changed in CRuby 3.2.
2023-04-09 21:15:13 +09:00
dearblue 93e07eec1c Remove noise in new mruby-binding
`Binding#eval` should not be defined in `mruby-binding`.
2023-04-09 21:14:33 +09:00
dearblue d3128ce58a Allow Class#allocate to be prohibited
Calling `Class#allocate` with `UnboundMethod#bind_call` usually succeeds without problems.
If this behavior does not make us happy, we can now prohibit it with `MRB_SET_INSTANCE_TT(klass, MRB_TT_UNDEF)`.

At the same time, it applies to the `Binding`, `Complex`, `Data`, `Float`, `Integer`, `Method`, `Rational` and `UnboundMethod` classes.
2023-04-09 21:14:07 +09:00
Yukihiro "Matz" Matsumoto c3ba76794f Merge pull request #5977 from dearblue/setup_debug
Make `MRuby::Build#enable_debug` compiler flag setting abstract
2023-04-09 15:51:44 +09:00
dearblue 0f2c1caa96 Make MRuby::Build#enable_debug compiler flag setting abstract
Previously, compiler flags were only added for GCC or similar.
The situation has not changed, but it has become easier to improve.

I expect `MRuby::Command::Compiler#setup_debug` to be defined as a singleton method inside the block given to `MRuby::Toolchain.new`.
2023-04-09 11:21:50 +09:00
Yukihiro "Matz" Matsumoto 64536b866b string.c (str_escape): simplify the logic 2023-04-07 13:53:19 +09:00
Yukihiro "Matz" Matsumoto d0653ca908 cdump.c: escape filename debug information; fix #5974
Windows path separator is "\" so that it needs to be escaped.
2023-04-07 13:51:59 +09:00
Yukihiro "Matz" Matsumoto 27a14f0a9a vm.c (OP_CMP): fixed wrong numeric comparison for integers; fix #5975
MRB_TT_INTEGER value may not be fixnum (immediate integer), so we should
not use mrb_fixnum() here.
2023-04-07 10:46:01 +09:00
Yukihiro "Matz" Matsumoto 761816bf8a fmt_fp.c (mrb_format_float): change else indentation style 2023-04-06 16:49:08 +09:00
Yukihiro "Matz" Matsumoto 956d0c5127 fmt_fp.c (mrb_format_float): set minimum precision 1 for "%e" 2023-04-06 16:47:43 +09:00
Yukihiro "Matz" Matsumoto 31c99eb99b debug.c (mrb_debug_get_position): do not keep lp and fp uninitialized 2023-04-06 15:47:24 +09:00
Yukihiro "Matz" Matsumoto ce86040a0f Merge pull request #5973 from dearblue/envadjust
Small improvements to `envadjust()`
2023-04-06 10:48:49 +09:00
Yukihiro "Matz" Matsumoto 9e4b3af553 Merge pull request #5972 from dearblue/simple-mrb_top_run
Simplify `mrb_top_run()`
2023-04-06 10:46:56 +09:00
Yukihiro "Matz" Matsumoto b4d7b269b0 Merge pull request #5971 from dearblue/simple-raise.2
Remove unnecessary branches in `L_RAISE` block
2023-04-06 10:46:02 +09:00
dearblue 17abe548a7 Small improvements to envadjust()
- Calculate the difference between `oldbase` and `newbase` only once outside the loop.
  - To make sure they are within range, the comparison is done only once instead of twice.
2023-04-05 22:29:27 +09:00
dearblue b90f59d36e Simplify mrb_top_run() 2023-04-05 22:11:36 +09:00
dearblue b46a852acb Remove unnecessary branches in L_RAISE block
The previous `while` loop ends if the catch handler pointer `ch` is not `NULL`.

Supplement to #5843.
2023-04-05 21:52:21 +09:00
Yukihiro "Matz" Matsumoto 35a3bab369 Merge pull request #5966 from jbampton/add-mruby-debugger
Update `default.gembox` add mruby debugger `mrdb`
2023-04-05 15:11:29 +09:00
Yukihiro "Matz" Matsumoto 8e9da2130f Merge pull request #5968 from jbampton/add-mruby-logo-to-readme
Add `mruby` logo to the README
2023-04-05 15:10:26 +09:00
Yukihiro "Matz" Matsumoto 730cbe7c0c Merge pull request #5969 from jbampton/docs-fix-grammar
Fix grammar in `mruby-YOUR-bigint/TODO-HINT.md`
2023-04-05 15:08:44 +09:00
Yukihiro "Matz" Matsumoto 19a2145204 Merge pull request #5970 from jbampton/fix-spelling-of-homepage
`README.md` fix spelling: `home-page` -> `homepage`
2023-04-05 15:07:44 +09:00
John Bampton 6467488854 Add mruby logo to the README
Center logo, mruby title and linter badge

Fix for YARD and Doxygen output
2023-04-05 15:53:02 +10:00
John Bampton e9756c77ea README.md fix spelling: home-page -> homepage
https://en.wikipedia.org/wiki/Home_page
2023-04-05 13:39:41 +10:00
John Bampton ebdb03b4d4 Fix grammar in mruby-YOUR-bigint/TODO-HINT.md 2023-04-05 11:26:05 +10:00
Yukihiro "Matz" Matsumoto 8171edc4eb Merge pull request #5967 from jbampton/sort-gitignore
Sort and remove blank lines from `.gitignore`
2023-04-05 08:05:45 +09:00
John Bampton 076520cac1 Sort and remove blank lines from .gitignore 2023-04-05 03:49:49 +10:00
Yukihiro "Matz" Matsumoto 90e3022936 Merge pull request #5965 from jbampton/fix-word-case-yard
Fix word case: `yard` -> `YARD`
2023-04-04 23:12:48 +09:00
John Bampton b486a3c425 Update default.gembox add mruby debugger mrbd 2023-04-04 19:31:42 +10:00
John Bampton 7082e95fa2 Fix word case: yard -> YARD
https://yardoc.org/
2023-04-04 18:20:52 +10:00
Yukihiro "Matz" Matsumoto b44d757b8c Merge pull request #5962 from jbampton/code-blocks-add-languages
docs: add language `console` to code blocks
2023-04-04 12:09:54 +09:00