Yukihiro "Matz" Matsumoto
bf524e7002
time.c: calendar clock should use CLOCK_REALTIME; 5e95f11
...
The issue was reported by @shuujii
2021-03-14 14:54:53 +09:00
Yukihiro "Matz" Matsumoto
f92a27f918
codegen.c: fix memory leak from new_litbn().
2021-03-13 09:33:16 +09:00
Yukihiro "Matz" Matsumoto
bf2110d206
codegen.c: need to preserve neg info.
2021-03-12 18:34:29 +09:00
Yukihiro "Matz" Matsumoto
b52078aa92
codegen.c: avoid integer comparison of different sign.
2021-03-12 16:26:51 +09:00
Yukihiro "Matz" Matsumoto
4ae5ae3535
codegen.c: no integer overflow error in codegen; close #5376
...
Add new pool value type `IREP_TT_BIGINT` and generate integer overflow
error in the VM. In the future, `mruby` will support `Bignum` for
integers bigger than `mrb_int` (probably using `mpz`).
2021-03-12 16:21:32 +09:00
John Bampton
3c1ce680a3
chore: fix grammar
2021-03-09 04:35:03 +10:00
Yukihiro "Matz" Matsumoto
f2b3529441
time.c: fix errors on Windows and macOS; ref #5354
...
`gmtime_r` detection logic was too strict.
2021-03-08 15:23:29 +09:00
Yukihiro "Matz" Matsumoto
cb3a6dd168
ISO C99 doesn't support unnamed unions; fix #5354
2021-03-08 11:50:52 +09:00
Yukihiro "Matz" Matsumoto
2be1a9c3c7
time.c: timespec_get() never fails.
2021-03-03 12:01:49 +09:00
Yukihiro "Matz" Matsumoto
42afafbd23
time.c: fixed wrong condition to include unistd.h.
2021-03-03 10:15:50 +09:00
Yukihiro "Matz" Matsumoto
79e2ad9a44
time.c: Windows does not have unistd.h.
2021-03-03 10:01:32 +09:00
Yukihiro "Matz" Matsumoto
5e95f11756
time.c: use clock_gettime() if possible.
2021-03-03 09:53:11 +09:00
Yukihiro "Matz" Matsumoto
0c631a4c08
time.c: adjust buffer size in mrb_time_asctime().
2021-03-03 09:52:26 +09:00
Yukihiro "Matz" Matsumoto
384209b8dd
time.c: fix compile errors in mrb_time_asctime().
2021-03-03 09:51:27 +09:00
Yukihiro "Matz" Matsumoto
187384124b
Merge pull request #5368 from jbampton/add-pre-commit-framework
...
feat: add pre-commit framework
2021-03-02 16:53:33 +09:00
Yukihiro "Matz" Matsumoto
f3507818e7
binding-core.c: add cast to remove warnings; ref #5362
2021-03-01 11:38:30 +09:00
Yukihiro "Matz" Matsumoto
935a135553
time.c: fixed a bug on no builtin overflow (e.g. VC).
2021-03-01 11:35:15 +09:00
John Bampton
1c9b1bfeb7
feat: add pre-commit framework
2021-03-01 10:06:17 +10:00
Yukihiro "Matz" Matsumoto
65add8c650
time.c: avoid using mrb_int_{add,sub}_overflow().
...
The size and signedness of `mrb_int` and `time_t` may differ.
2021-03-01 07:58:14 +09:00
Yukihiro "Matz" Matsumoto
eb68adafa1
Merge pull request #5367 from dearblue/libedit
...
Support libedit on mirb for FreeBSD
2021-02-28 20:26:33 +09:00
Yukihiro "Matz" Matsumoto
03eb3b5e87
time.c: check overflow in addition and subtraction of Time.
2021-02-28 19:33:57 +09:00
Yukihiro "Matz" Matsumoto
8684abd697
Remove periods from error messages according to the convention.
2021-02-28 19:32:52 +09:00
Yukihiro "Matz" Matsumoto
b61766473b
time.c: change RuntimeError to ArgumentError.
2021-02-28 19:26:40 +09:00
dearblue
15a7d5be3d
Support libedit on mirb for FreeBSD
2021-02-28 16:23:37 +09:00
Yukihiro "Matz" Matsumoto
3da372b30f
pack.c: add more checks for pack_pack().
2021-02-27 12:00:24 +09:00
Yukihiro "Matz" Matsumoto
5d37160455
Use MRB_SYM() more extensively.
2021-02-26 15:05:55 +09:00
Yukihiro "Matz" Matsumoto
192f3df9a1
Merge pull request #5362 from dearblue/binding
...
Binding
2021-02-25 21:15:24 +09:00
Yukihiro "Matz" Matsumoto
f1c2096f8e
parse.y: endless_method_name should allow ==.
...
e.g. `def ==(v) = true`. The issue is reported by @shuujii
2021-02-24 22:20:16 +09:00
Yukihiro "Matz" Matsumoto
386b53e6d9
parse.y: upgrade endless def syntax.
...
- prohibit defining setter method
- allow endless def without parentheses
2021-02-24 16:56:55 +09:00
dearblue
927615e1f0
Added other methods for Binding
...
- Added to `mruby-binding-core`
- `Binding#local_variable_defined?`
- `Binding#local_variable_get`
- `Binding#local_variable_set`
- `Binding#local_variables`
- `Binding#receiver`
- `Binding#source_location`
- `Binding#inspect`
- Added to `mruby-proc-binding`
- `Proc#binding`
The reason for separating `Proc#binding` is that core-mrbgems has a method that returns a closure object to minimize possible problems with being able to manipulate internal variables.
By separating it as different mrbgem, each user can judge this problem and incorporate it arbitrarily.
2021-02-22 23:32:43 +09:00
dearblue
792f6ac670
Adjustment of the current HEAD and bindings, and separation
...
Make changes to make `Binding` work.
At the same time, it separates `Binding#eval`, which depends on `mruby-eval`, from `mruby-binding-core`.
2021-02-22 23:32:18 +09:00
dearblue
935ffa46a3
Change mruby-binding to mruby-binding-core
2021-02-22 22:15:46 +09:00
dearblue
297c5ac598
Merge branch 'binding' of https://github.com/ksss/mruby into HEAD
2021-02-22 22:14:46 +09:00
dearblue
7ef4e54370
Comment out warn used in the Array#fetch method
...
I get an error because the current mruby does not have a `Kernel#warn` method.
But the warning itself is useful and I'll just comment it out in case it's implemented in the future.
2021-02-20 18:19:00 +09:00
Yukihiro "Matz" Matsumoto
0d7f5b8216
metaprog.c: fix a methods() bug with false argument; fix #5351
2021-02-20 14:56:55 +09:00
Yukihiro "Matz" Matsumoto
8ed15c078b
metaprog.c: remove unused argument from a private function.
2021-02-20 13:20:14 +09:00
KOBAYASHI Shuji
a6a76d8fd2
Add -s option to mrbc for make variable static
2021-02-14 11:55:53 +09:00
John Bampton
6204244b41
chore: fix missing HTTPS on links
2021-02-13 18:17:47 +10:00
John Bampton
be40e9c783
chore: fix spelling
...
Normally a single spell checker can't find all the mistakes or check all types of code.
These mistakes were found by another spell checker inside my editor with a more manual sift / find.
2021-02-13 17:21:17 +10:00
John Bampton
d55a74c418
feat(CI): check for trailing whitespace
...
Run on pull request only.
Use a shell script to check for trailing whitespace in all files.
Fail if trailing whitespace is found.
2021-02-13 16:37:46 +10:00
Yukihiro "Matz" Matsumoto
94fb86f89b
parse.y: string buffer (tokbuf) can overflow.
...
Check if `esclen` is smaller than `len` (original string length).
2021-02-13 14:06:37 +09:00
Yukihiro "Matz" Matsumoto
5ba37db981
Merge pull request #5336 from shuujii/fix-build-mruby-catch-gem-without-presym
...
Fix build `mruby-catch` gem without presym
2021-02-12 21:11:59 +09:00
KOBAYASHI Shuji
8ba7be0999
Fix build mruby-catch gem without presym
2021-02-12 19:19:32 +09:00
KOBAYASHI Shuji
955464ca3c
Add UncaughtThrowError#{tag,value} for Ruby compatibility
2021-02-12 19:09:18 +09:00
Yukihiro "Matz" Matsumoto
793fbab7d5
Rename mrb_sleep.c to sleep.c in mruby-sleep gem.
2021-02-12 11:11:10 +09:00
Yukihiro "Matz" Matsumoto
0db6e3eb6f
Rename mruby-catch.c to catch.c; ref #5328
2021-02-12 10:09:19 +09:00
Yukihiro "Matz" Matsumoto
c7809ca025
Refactor mruby-catch; ref #5328
...
- Move `#catch` definition to `mruby-catch.c` to avoid tweaking
- Remove `#__preserve_catch_method`
- Implement whole `#throw` method in C
2021-02-10 20:09:00 +09:00
Yukihiro "Matz" Matsumoto
f0e25121fd
Merge branch 'mruby-catch' of https://github.com/dearblue/mruby into dearblue-mruby-catch
2021-02-10 15:43:24 +09:00
Yukihiro "Matz" Matsumoto
aa5b7fbd80
i_gcd() does not work for MRB_INT_MIN.
2021-02-08 21:18:50 +09:00
Yukihiro "Matz" Matsumoto
530afca2d7
Move F(x) definition inside of #ifdef; fix #5330
2021-02-07 15:28:23 +09:00