summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
AgeCommit message (Collapse)Author
2019-05-17Fixed wrong overloading.Yukihiro "Matz" Matsumoto
`float op rational` should return `float`, since float is an inexact value.
2019-05-17Use `div` (integer divition) instead of `/` for rational numbers.Yukihiro "Matz" Matsumoto
2019-05-17Move `Numeric#div` to the core.Yukihiro "Matz" Matsumoto
2019-05-16Refactor `time.c` regarding memory allocation.Yukihiro "Matz" Matsumoto
2019-05-16Fix `Rational#==`KOBAYASHI Shuji
2019-05-16Enable `YYSTACK_USE_ALLOCA`.Yukihiro "Matz" Matsumoto
It used heap allocated memory for the parser stack, but there's possibility of parser termination by exceptions. In that case, the parser stack memory is leaked. We were afraid of stack consumption, but parser stack size is only 4KB, so we don't have to worry about it (at least for the parser).
2019-05-16Avoid potential type mismatch warnings in `pack.c`.Yukihiro "Matz" Matsumoto
2019-05-16Avoid potential integer overflow.Yukihiro "Matz" Matsumoto
2019-05-15Merge pull request #4435 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-typo-in-mrbgems-mruby-io-src-file_test.c Fix typo in `mrbgems/mruby-io/src/file_test.c` [ci skip]
2019-05-15FixUkrainskiy Sergey
2019-05-15Fix dependenciesUkrainskiy Sergey
2019-05-15Basic implementation of Complex and Rational classesUkrainskiy Sergey
2019-05-15Small refactoringUkrainskiy Sergey
2019-05-15Initial suffix supportUkrainskiy Sergey
2019-05-15Fix typo in `mrbgems/mruby-io/src/file_test.c` [ci skip]KOBAYASHI Shuji
2019-05-14Refine `Time#(to_s|inspect)`KOBAYASHI Shuji
For the following reasons: - Ruby compatibility. - Add UTC offset (time zone informations was not included by #4433). - More readable. Example: Before this patch: p Time.gm(2003,4,5,6,7,8,9) #=> Sat Apr 5 06:07:08 2003 p Time.local(2013,10,28,16,27,48) #=> Mon Oct 28 16:27:48 2013 After this patch: p Time.gm(2003,4,5,6,7,8,9) #=> 2003-04-05 06:07:08 UTC p Time.local(2013,10,28,16,27,48) #=> 2013-10-28 16:27:48 +0900 Implementation: I use `strftime(3)` because UTC offset can be added and program size become smaller than the other implementations (using `sprintf(3)`, self conversion etc) in my environment.
2019-05-13Fix `Time#(asctime|ctime)` according to ISO RubyKOBAYASHI Shuji
- A leading charactor for day is space. - Time zone does not included. Before this patch: Time.gm(1982,3,4,5,6,7).asctime #=> "Thu Mar 04 05:06:07 UTC 1982" After this patch: Time.gm(1982,3,4,5,6,7).asctime #=> "Thu Mar 4 05:06:07 1982"
2019-05-12Fix missing assertions in `mruby-time` testKOBAYASHI Shuji
2019-05-10Move `mrb_gc_arena_restore` to inside the loop in `mrb_file_s_chmod`KOBAYASHI Shuji
2019-05-10Raise `TypeError` if the argument type is unsupported in `mrb_stat0`KOBAYASHI Shuji
2019-05-08Use `mrb_string_value_cstr` in `mrb_str_to_dbl`KOBAYASHI Shuji
2019-05-07Refactor `mrb_str_to_cstr` and `mrb_string_value_cstr`KOBAYASHI Shuji
- Extract null byte check to function. - Avoid string allocation if null byte is included. - Use `str_new` instead of `mrb_str_dup` + `mrb_str_modify`
2019-05-06Avoid using `mrb_str_to_cstr` if possibleKOBAYASHI Shuji
Because it always allocate new string. Replace with the followings: - Use `RSRING_PTR` if string is guaranteed to be null-terminated. - Use `mrb_string_value_cstr` or `mrb_get_args("z")` if return value isn't modified.
2019-05-05Use `mrb_fixnum_to_str()` instead of `Fixnum#to_s`KOBAYASHI Shuji
2019-05-03Clean duplicate codedearblue
Removed duplicates in the code entered for "Concatenate string literal".
2019-05-02Use a normal method instead of a lambda in bintest/mruby; ref #4416Yukihiro "Matz" Matsumoto
2019-05-01Small fix in `mruby-bin-mruby`KOBAYASHI Shuji
- Modify some error messages for consistency. - Add test for codegen error. - Use regular expression for error message matching in test.
2019-04-30Refine error message output for `mruby` commandKOBAYASHI Shuji
- Write message to stderr instead of stdout. - Avoid duplicate message output (`SyntaxError`, `ScriptError` etc). - Refine invalid option message. - Suppress redundant usage output. - Fix some incorrect exit code.
2019-04-29Fix missing assertions in `mruby-io` testKOBAYASHI Shuji
2019-04-28Commented out "Struct.new removes existing constant" testKOBAYASHI Shuji
Because this test is always skipped.
2019-04-27Remove duplicated `String#each_char`KOBAYASHI Shuji
2019-04-25Singleton class of frozen object should be frozenKOBAYASHI Shuji
Before this patch: p (class << Object.new.freeze; self end).frozen? #=> false sc = class << (o=Object.new); self end; o.freeze; p sc.frozen? #=> false After this patch / Ruby: p (class << Object.new.freeze; self end).frozen? #=> true sc = class << (o=Object.new); self end; o.freeze; p sc.frozen? #=> true
2019-04-24Fix modiying class variable to frozen class/moduleKOBAYASHI Shuji
2019-04-22Merge pull request #4356 from shuujii/add-assert_match-and-assert_not_matchYukihiro "Matz" Matsumoto
Add `assert_match` and `assert_not_match`
2019-04-21Commented out `String#scan` because it is not implemented yetKOBAYASHI Shuji
2019-04-17Add `Array#sample` testKOBAYASHI Shuji
And simplify tests for `Array#shuffle` and `Array#shuffle!`.
2019-04-16Merge branch 'master' into fix_mruby-io_testShokuji
2019-04-15Fix missing assertions in `mruby-random` testKOBAYASHI Shuji
2019-04-15Fix test, popen and cmd in mruby-ioShouji Kuboyama
2019-04-14Merge pull request #4376 from dearblue/leak-symbolsYukihiro "Matz" Matsumoto
Fix leaked function symbols
2019-04-14Add `assert_match` and `assert_not_match`KOBAYASHI Shuji
2019-04-14Fix leaked function symbolsdearblue
- `free_heap()` in src/gc.c - `symhash()` in src/symbol.c - `no_optimize()` in mrbgems/mruby-compiler/core/codegen.c
2019-04-14Fix string index for appendingdearblue
`sizeof(string-literal)` is included `'\0'` character
2019-04-14Fix hexdigits convertiondearblue
2019-04-12Deallocate `s->lines` in `codegen_error`; ref #4370Yukihiro "Matz" Matsumoto
2019-04-12The number of local variables should be less than 1024; fix #4370Yukihiro "Matz" Matsumoto
The `env` stores stack length in a 10 bit field. See `MRB_ENV_STACK_LEN()` macro.
2019-04-11Fix buffer overflows in parser.Clayton Smith
2019-04-10Merge pull request #4367 from shuujii/extract-frozen-checking-to-functionYukihiro "Matz" Matsumoto
Extract frozen checking to function
2019-04-10Fixed old style declaration; ref #4365Yukihiro "Matz" Matsumoto
2019-04-10Rename `itoa` to `dump_int` to avoid name crash; ref #4173Yukihiro "Matz" Matsumoto