Commit Graph

2137 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 25ea4d751b use powf() instead of pow() on MRB_USE_FLOAT 2014-02-17 09:34:56 +09:00
Yukihiro "Matz" Matsumoto b4bc395680 fdigit may be negative due to error if mrb_float is 32bit (e.g. 10**36 on 32bit arch); ref #1713 #1714 2014-02-17 09:27:53 +09:00
h2so5 db80a9a2ce fix mrb_flo_to_str() exponent problem 2014-02-17 07:53:02 +09:00
Yukihiro "Matz" Matsumoto 41a77111ea Merge pull request #1710 from takkaw/flo_to_str
modify mrb_to_str() in order to display big float number
2014-02-16 01:33:43 +09:00
Yukihiro "Matz" Matsumoto e29efb02bd normalize NaN after division that may generate NaN; fix #1712 2014-02-15 19:59:26 +09:00
takkaw 0a48fb0407 modify mrb_to_str() in order to display big float number 2014-02-15 15:40:51 +09:00
Li Yazhou adbf1eba99 clearn up warning in hash.c
/home/fleuria/code/mruby/src/hash.c:159:1: warning: ‘mrb_hash_dp`defined but not used [-Wunused-function]
 mrb_hash_dup(mrb_state *mrb, mrb_value hash)
     ^

this commit defines Hash#dup to take advantage of mrb_hash_dup, however
it seems that Hash#dup is not in ISO standard.
2014-02-14 13:22:30 +08:00
Yukihiro "Matz" Matsumoto ba8a8e75c7 Merge pull request #1702 from cremno/hash-hash-ext-changes
hash / hash-ext: various small changes
2014-02-14 01:29:19 +09:00
cremno 8bbc2c107b mrb_str_cat2: deprecated since 0cedf8f 2014-02-13 13:45:28 +01:00
cremno 4ffea85b62 hash / hash-ext: various small changes
src/hash.c:
 - mrb_hash_(aget|aset|dup|delete): internal linkage
 - remove documentation of methods which are not implemented (in here)
 - remove #assoc; unused, not in ISO spec
 - remove #rassoc: same, implementation is also wrong

hash-ext mrbgem:
 - remove header "mruby/khash.h"
 - remove mrb_hash_values_at (move code into hash_values_at, i: long -> int)
 - less whitespace in gem_init function
2014-02-13 13:39:09 +01:00
Yukihiro "Matz" Matsumoto 7a32c7b183 remove direct inclusion of mruby/version.h from version.c; #1698 2014-02-13 00:45:56 +09:00
Yukihiro "Matz" Matsumoto 26781692b7 Merge pull request #1697 from cremno/array-changes
array implementation: several small changes
2014-02-12 09:31:28 +09:00
Yukihiro "Matz" Matsumoto 67d63387ee Merge pull request #1695 from cremno/clang-and-icl-define-direct-threaded
Clang and ICC/ICL: define DIRECT_THREADED
2014-02-12 09:28:12 +09:00
cremno 7691b64963 array implementation: several small changes
src/array.c:
 - make various functions without declaration in the mruby headers static
 - removed all uncessary int casts and two useless comments
 mrb_ary_new_from_values: move to similar functions
 mrb_check_array_type: fix indentation

include/mruby/array.h:
 mrb_shared_array: padding (default "mrbconf.h" on an usual 64-bit system)
                   sizeof(mrb_int)==sizeof(int)==4 && sizeof(mrb_value*)==8

both:
 mrb_ary_aget:  remove declaration in header and make static
                nobody uses it which is not surprising since it has 1 req arg!
 mrb_assoc_new: small optimization and move to similar functions
 mrb_ary_len:   re-implement as static inline function (it is used by mrbgems)
                programmers should directly use RARRAY_LEN instead
2014-02-12 00:37:47 +01:00
cremno 8a3a3a5a49 Clang and ICC/ICL: define DIRECT_THREADED
This is most likely only needed on Windows be-
cause __GNUC__ is not defined by both compilers.

It might fail with some unusual configurations.
If that is the case, feel free to open an issue.
2014-02-11 23:55:52 +01:00
Yukihiro "Matz" Matsumoto 27dbcd0f0d add RUBY_ENGINE; ref #576 2014-02-11 15:37:03 +09:00
Pavel 411168deab Fix Kernel#global_variables for $1-$9 2014-02-09 23:54:49 +07:00
Yukihiro "Matz" Matsumoto 00bdaec766 initialize ci->stackent at the top; #1691 2014-02-09 19:20:16 +09:00
Yukihiro "Matz" Matsumoto ee0b7d150b Merge branch 'original2' of https://github.com/miura1729/mruby into miura1729-original2 2014-02-09 18:37:20 +09:00
Yukihiro "Matz" Matsumoto 19a08b8455 Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUE
use mrb_bool, FALSE and TRUE more
2014-02-09 18:35:20 +09:00
Miura Hideki 5df82e357c Store raw stack address in callinfo instead of offset from stbas 2014-02-09 16:42:25 +09:00
Yukihiro "Matz" Matsumoto 4a2c37df93 made mrb_define_class to return existing class, with heavy refactoring 2014-02-08 13:44:31 +09:00
Yukihiro "Matz" Matsumoto 5da7bd3a91 rename mrb_name_class and make it static 2014-02-08 10:20:23 +09:00
Yukihiro "Matz" Matsumoto 95e2be6508 forgot to add new files 2014-02-07 12:24:24 +09:00
Yukihiro "Matz" Matsumoto 3ff9aad22f move version info from gems to core; ref #576 #1684 2014-02-07 12:18:55 +09:00
Yukihiro "Matz" Matsumoto c3f02afa21 Merge pull request #1688 from cubicdaiya/issues/unnecessary_semicolon
Remove unnecessary semicolon
2014-02-06 21:16:24 +09:00
cubicdaiya 360d92dc28 remove unnecessary semicolon 2014-02-06 19:05:45 +09:00
Yukihiro "Matz" Matsumoto 7ba4612956 use mrb_str_new_lit() more widely 2014-02-06 08:54:47 +09:00
Yukihiro "Matz" Matsumoto ed1bf9aa80 introduce mrb_str_new_lit() to create strings from C string litrals 2014-02-06 07:50:34 +09:00
MATSUMOTO Ryosuke dadf06f72b Add global constant MRUBY_COPYRIGHT 2014-02-05 23:54:15 +09:00
MATSUMOTO Ryosuke 456a765e53 replace Kernel.show_version with MRUBY_DESCRIPTION 2014-02-05 22:17:44 +09:00
MATSUMOTO Ryosuke e0c10d03da Add pluggable versioning by mruby-version 2014-02-05 18:45:09 +09:00
Yukihiro "Matz" Matsumoto 04eb577b69 Fiber.new{break} caused SEGV 2014-02-05 12:51:17 +09:00
Yukihiro "Matz" Matsumoto be0cc4f90e better codedump format 2014-02-04 23:04:34 +09:00
Tomoyuki Sahara 7bf63c2876 add Float#nan? 2014-02-03 15:18:52 +09:00
h2so5 b53d91e6e2 fix NODE_SPLAT codegen 2014-02-01 12:22:28 +09:00
cremno 4507985c3e use mrb_bool, FALSE and TRUE more
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0
but I prefer a type (alias) which emphasizes boolean vars to int.
I changed 1/0 to FALSE/TRUE anyway.
2014-01-31 18:00:36 +01:00
cremno a2cfc9a9af rework mruby-objectspace and gc.[ch]
- functions should have C linkage (for C++ code)
- add prefix to each_object_callback
- use more appropriate variable types / initialization
- ObjectSpace::count_objects has 1 opt. arg.
- prefer mrb_intern_lit to mrb_intern_cstr for str. lit.
- mruby/value.h is included by mruby.h
- adjust coding style
2014-01-31 17:42:05 +01:00
Yukihiro "Matz" Matsumoto 7c9a1accff remove conflict 2014-01-31 17:09:04 +09:00
Yukihiro "Matz" Matsumoto 6cf42a8200 Merge pull request #1671 from cremno/extern-cleanup
clean up external symbols
2014-01-31 00:03:28 -08:00
Yukihiro "Matz" Matsumoto 4e2a9509dc Merge pull request #1669 from cremno/copyright-2014
update copyright year
2014-01-31 00:01:09 -08:00
h2so5 650ffb9d84 reindent parse.y 2014-01-31 11:30:58 +09:00
cremno f2a62a74ed clean up external symbols
remove unused and unneeded:
- sysexit_status
- type (a global variable)

add mrb_ prefix to:
- codedump_all
- class_instance_method_list
- parser_dump

make various functions static, incl.:
- yyparse
- make_exception
2014-01-31 01:30:18 +01:00
cremno 3ee946dab4 Happy new year! (update copyright year)
Let's not wait until May this time
(f0a9b95af3)!
2014-01-30 23:17:24 +01:00
cremno d90f52f552 etc.c: small cleanup (delete unused functions)
mrb_data_object_alloc: unnecessary cast
mrb_lastline_get: mruby doesn't support $_, weird and unused code
mrb_exec_recursive: see 4e46abb869
mrb_block_proc: unused, doesn't really do anything (or needs to be
rewritten)
mrb_obj_to_sym: actually use id (and MSVC detected unreachable code)
2014-01-30 23:16:46 +01:00
Yukihiro "Matz" Matsumoto a68a517028 refactor parser lineno adjustment; ref #1667 2014-01-31 00:49:46 +09:00
Yukihiro "Matz" Matsumoto dd70ae0b6e add semicolon after the statements 2014-01-30 22:08:31 +09:00
Yukihiro "Matz" Matsumoto 5815ac4fed Merge pull request #1667 from h2so5/backtrace-lineno
more accurate backtrace lineno
2014-01-30 03:53:03 -08:00
Yukihiro "Matz" Matsumoto aa08158f67 Array#[]= is now range aware 2014-01-30 10:50:56 +09:00
h2so5 36e0925053 more accurate backtrace lineno 2014-01-30 10:08:04 +09:00