Commit Graph

308 Commits

Author SHA1 Message Date
Tomoyuki Sahara 120a02c15d add String#partition and String#rpartition. 2013-12-27 15:30:20 +09:00
take_cheeze df780ae5e9 add mrb_intern_lit for creating symbol from string literal 2013-12-01 10:38:59 +09:00
Yukihiro "Matz" Matsumoto 9c6398a444 rename mrb_intern2() to mrb_intern(); huge API incompatibility; close #1513 2013-11-29 08:47:28 +09:00
Yukihiro "Matz" Matsumoto 04a2c58e94 add new function mrb_load_irep_file_cxt() and simplifies mruby.c 2013-11-15 10:49:40 +09:00
Yukihiro "Matz" Matsumoto d8f9a30ef3 fix irep memory leak 2013-11-15 10:35:45 +09:00
bggd 86c80139ab Changed a variable declaration to top of block 2013-11-13 22:35:25 +09:00
Yukihiro "Matz" Matsumoto a725bd7a23 call codedump_all() from mirb if --verbose is set; close #1559 2013-11-10 04:34:53 +09:00
Yukihiro "Matz" Matsumoto e92d4e2680 modified to use irep->reps to reference child ireps. preparation for
removing irep array from mrb_state.  note that instructions OP_LAMBDA,
OP_EXEC and OP_EPUSH are incompatible, and dumped mrb format has changed.
2013-11-07 03:54:22 +09:00
Yukihiro "Matz" Matsumoto f80401de6c resolved conflicts and updated to latest return value change of mrb_generate_code() 2013-11-05 00:13:01 +09:00
Yukihiro "Matz" Matsumoto e386760cc7 add Fiber.current 2013-11-04 23:58:32 +09:00
fleuria 82c5b486e0 mirb: reset stack in the first command 2013-11-03 12:05:48 +08:00
fleuria a511957ec8 refactor mrb_context_run() 2013-11-03 12:05:25 +08:00
fleuria d75a907edf introduce mrb_context_run()
currently there are two scnenario to call mrb_run(), the first is
calling a proc, in this case mrb should create a new environment,
discarding all the variables except args, reciever and block.

the second is calling the newly generated irep, like in mirb.
in this case, the variables should be kept after mrb_run().
so we introduce mrb_context_run() to handle this seperately.
2013-11-03 11:32:59 +08:00
Yukihiro "Matz" Matsumoto 1910798f47 small style fix 2013-11-03 08:34:36 +09:00
Yukihiro "Matz" Matsumoto 756c3fbff1 Merge branch 'master' of github.com:mruby/mruby 2013-11-03 08:33:10 +09:00
Emiliano Lesende 80d8b5e2e7 Added support for Random as an argument to shuffle and shuffle!. Refactored random gem to use DATA instance type and hold mt_state inside the DATA_PTR instead of in an instance variable. 2013-11-02 12:07:34 -03:00
Yukihiro "Matz" Matsumoto 0be572df62 change return value from mrb_generate_code() 2013-11-02 23:20:04 +09:00
Emiliano Lesende d8cc37cdf9 Added shuffle and shuffle! to the Array class in the Random gem. 2013-11-01 11:44:40 -03:00
Yukihiro "Matz" Matsumoto 73f6d7080e Merge pull request #1510 from schmurfy/freebsd_fix
fixed compilation on freebsd releases witout log2 function
2013-10-30 01:24:23 -07:00
skandhas 81c0fda8ec add some methods to Symbol 2013-10-08 21:47:11 +08:00
Lukas Stabe 5692b5ade1 fix no multiline strings in mirb 2013-10-04 06:03:53 +02:00
Yuichi Nishiwaki 0e4a7b2a03 eliminate use of traditional intern API (mrb_intern()) completely 2013-09-23 19:36:50 -07:00
Julien Ammous 19f5430967 support freebsd versions without log2 function 2013-09-23 15:14:19 +02:00
Yukihiro "Matz" Matsumoto 3995e7ff8f rename voidp to cptr 2013-09-21 17:28:47 +09:00
Tomoyuki Sahara f77dc2e6cb Merge branch 'mruby' into pr-typeerror-string-start-end-with
Conflicts:
	mrbgems/mruby-string-ext/src/string.c
	mrbgems/mruby-string-ext/test/string.rb
2013-08-26 23:20:22 +09:00
Yukihiro "Matz" Matsumoto 91b878e5df Merge pull request #1485 from fjmilens3/string_end_with
Bug in String#end_with? resulting from incorrect length determination
2013-08-26 04:17:20 -07:00
Tomoyuki Sahara 0e8efd4a21 Check type of arguments for #start_with and #end_with. 2013-08-23 15:06:26 +09:00
Frederick John Milens III 2548569f60 Refactor of String#start_with? comparison logic. 2013-08-22 19:29:36 -05:00
Frederick John Milens III d682be9d32 Refactor of String#end_with? comparison logic. 2013-08-22 19:23:53 -05:00
Frederick John Milens III a0183b394a Fix for string-length-related issue in String#end_with? logic. 2013-08-22 18:55:07 -05:00
Frederick John Milens III d42427870b Added test case for String#end_with? with string of length 2. 2013-08-22 18:41:23 -05:00
Frederick John Milens III 28211d6771 Fix for string-length-related issue in String#start_with? logic. 2013-08-22 16:44:00 -05:00
Frederick John Milens III de5f5732fe Added test case for String#start_with? with string of length 1. 2013-08-22 16:37:42 -05:00
wanabe c9ac35f3ba android doesn't have log2 2013-08-19 01:34:07 +09:00
Yukihiro "Matz" Matsumoto b12d9a8700 remove alloc from Time class 2013-08-15 01:37:03 +09:00
Yukihiro "Matz" Matsumoto b225e4cc82 redesign mruby/data.h API; use DATA_PTR() for raw data pointer, DATA_GET_PTR() to type safe retrieval (TypeError will be raised), DATA_CHECK_GET_PTR() to get nil if type mismatched 2013-08-15 01:33:36 +09:00
Yukihiro "Matz" Matsumoto b7d6b4d0ce define allocation method for Time class; close #1474 2013-08-14 16:50:52 +09:00
Jack Danger Canty 2bf4952284 Adding line numbers to the output of mirb.
Before:

    > "hi"
    hi
    > d
    (mirb):1: undefined method 'd' for main (NoMethodError)
    > d
    (mirb):1: undefined method 'd' for main (NoMethodError)
    > "hi"
    hi
    > "#{'}"
    line 1: unterminated string meets end of file

After

    > "hi"
    hi
    > d
    (mirb):2: undefined method 'd' for main (NoMethodError)
    > d
    (mirb):3: undefined method 'd' for main (NoMethodError)
    > "hi"
    hi
    > "#{'}"
    line 5: unterminated string meets end of file
2013-08-13 09:53:52 -07:00
Cremno ba027d7806 don't use str{cpy,cat} in mruby and mrbc
The length of each string is known. It should be used.
2013-08-07 19:58:06 +02:00
Yukihiro "Matz" Matsumoto 40e6cdcb5c rename mrb_value_p() to mrb_ptr() since _p means predicate in mruby source 2013-08-07 17:39:28 +09:00
Yuichi Nishiwaki 8dc2fa3bc8 add read barrier to value.p
API changes:
- value.p must be accessed via mrb_value_p macro
- value.p must be mutated via MRB_SET_VALUE_P macro
2013-08-03 14:03:44 -07:00
Blaž Hrastnik ac4a6d35b9 muby-time: use mrb_free directly 2013-08-05 18:55:55 +02:00
Daniel Bovensiepen aa3ff53f04 Improve test of mruby-objectspace-ext GEM 2013-08-04 22:42:57 +08:00
Daniel Bovensiepen 1d58f29e9b Improve test of mruby-toplevel-ext GEM 2013-08-04 22:42:39 +08:00
Daniel Bovensiepen a28c7c081a Improve test of mruby-symbol-ext GEM 2013-08-04 22:42:27 +08:00
Daniel Bovensiepen 181733bcfe Improve test of mruby-string-ext GEM 2013-08-04 22:42:15 +08:00
Daniel Bovensiepen d10763190e Improve test of mruby-range-ext GEM 2013-08-04 22:42:06 +08:00
Daniel Bovensiepen 8936965945 Improve test of mruby-proc-ext GEM 2013-08-04 22:41:56 +08:00
Daniel Bovensiepen b99aa126a6 Improve test of mruby-object-ext GEM 2013-08-04 22:41:45 +08:00
Daniel Bovensiepen 9a7efd69ee Improve test of mruby-numeric-ext GEM 2013-08-04 22:41:26 +08:00