52 Commits

Author SHA1 Message Date
Hiroshi Mimaki 716e7b815f Fixed missing comma in mruby/mirb usage. 2018-12-11 09:37:23 +09:00
Yukihiro "Matz" Matsumoto b01b0d242b Free mrbc_context on exit from mruby. 2018-09-05 07:58:36 +09:00
Hiroshi Mimaki e76492c776 Fix CI build errors and warnings. 2018-05-08 09:55:09 +09:00
Hiroshi Mimaki d973a8ebc4 Add -r option for mruby and mirb. 2018-05-07 18:17:50 +09:00
Hiroshi Mimaki 0c01afc3c9 Fix CI build errors and warnings. 2018-05-07 12:23:32 +09:00
Hiroshi Mimaki 1d16646506 Add -d option for mruby and mirb. 2018-05-02 20:52:02 +09:00
Yukihiro "Matz" Matsumoto 7f9e333647 Should not update @objs from mruby-bin-mruby mrbgem.rake; fix #3751 2017-07-24 16:53:20 +09:00
Yukihiro "Matz" Matsumoto b9f771dc50 Handles exceptions from code generation phase; fix #3695 2017-06-07 13:29:08 +09:00
Yukihiro "Matz" Matsumoto 0bcf9e28fc Reorganize C++ exceptions; ref #3470
There are 3 levels of C++ exception handling:
* default - no C++ exception (use setjmp/longjmp)
* enable_cxx_exception (use C++ exceptions with C ABI)
* enable_cxx_abi (use C++ ABI including exceptions)
2017-03-02 10:58:26 +09:00
Yukihiro "Matz" Matsumoto 9b176a1ca8 Avoid using <mruby/throw.h> in mruby.c 2017-03-02 10:51:44 +09:00
Tomoyuki Sahara da4f8e19fa replace "yylval" with "pylval" to make it compile with byacc. 2017-02-24 11:47:48 +09:00
Uchio KONDO ab5812d0d8 Use standard Module(Class)#to_s 2017-02-02 18:09:27 +09:00
Bouke van der Bijl f7a891fa89 Mark all the built-in classes during GC sweep
Reported by https://hackerone.com/haquaman
2016-12-07 15:14:12 -05:00
Yukihiro "Matz" Matsumoto 3623a833a4 Protect exceptions within main() function 2016-12-06 11:23:23 +09:00
Yukihiro "Matz" Matsumoto 5c405dea3d include changed from by quotes ("") to by brackets (<>); close #3032 2015-11-27 17:48:23 +09:00
Yukihiro "Matz" Matsumoto 4440566b95 DISABLE_STDIO/ENABLE_DEBUG macros to rename; close #3014
changes:
 * rename DISABLE_STDIO -> MRB_DISABLE_STDIO
 * rename ENABLE_DEBUG -> MRB_ENABLE_DEBUG_HOOK
 * no more opposite macro definitions (e.g. ENABLE_STDIO, DISABLE_DEBUG).
 * rewrite above macro references throughout the code.
 * update documents
2015-11-17 07:30:34 +09:00
Yasuhiro Matsumoto 545d649eff fix tests on windows.
'bin/mruby' not work on windows. so correct command name and quoted arguments.
2015-09-30 16:13:02 +09:00
Yasuhiro Matsumoto 8277e950ee Support windows locale
Add mrb_utf8_from_locale, mrb_utf8_free, mrb_locale_from_utf8, mrb_locale_free. Just works for windows.
2015-09-11 11:12:03 +09:00
cremno 0f284091d1 delete mrb_free()-related non-NULL checks
No need to optimize since a program only exits once and errors are rare.
Also the mruby source code doesn't have these kind of checks elsewhere.

The ones in {Time,Random}#initialize are kept because there it actually
matters
since initialization always happens and re-initialization is unlikely.
2015-07-16 04:58:21 +02:00
Terence Lee 7e087d7191 Need mruby-compiler to build mruby-bin-mruby and mruby-bin-mirb for
cross compiles
2015-06-22 13:01:15 -04:00
cremno 5e8d2a4b84 refactor code to call mrb_inspect() instead
mrb_inspect() also calls mrb_obj_as_string() after #inspect to ensure
the mrb_value is a string.
2015-06-13 14:59:57 +02:00
Kouhei Sutou 09419874c8 Suppress warnings generated by -Wwrite-strings
Here are suppressed warnings:

    src/fmt_fp.c: In function 'fmt_fp':
    src/fmt_fp.c:124:16: warning: initialization discards 'const' qualifier from pointer target type
         char *ss = (t&32)?"inf":"INF";
                    ^
    src/fmt_fp.c:125:17: warning: assignment discards 'const' qualifier from pointer target type
         if (y!=y) ss=(t&32)?"nan":"NAN";
                     ^
    mrbgems/mruby-string-ext/src/string.c: In function 'mrb_str_succ_bang':
    mrbgems/mruby-string-ext/src/string.c:302:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "1";
                               ^
    mrbgems/mruby-string-ext/src/string.c:305:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "a";
                               ^
    mrbgems/mruby-string-ext/src/string.c:308:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "A";
                               ^
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c: In function 'main':
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:213:13: warning: assignment discards 'const' qualifier from pointer target type
         cmdline = args.cmdline ? args.cmdline : "-";
                 ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c: In function 'print_breakpoint':
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
       char* enable_letter[] = {BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE};
       ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
2015-04-18 21:43:58 +09:00
Tatsuhiko Kubo dae42ffe54 Removed duplicated declarations.
* `mrb_show_version()`
 * `mrb_show_copyright()`
2015-01-03 22:56:36 +09:00
Yukihiro "Matz" Matsumoto fcbb7ec49d Fix crash if #inspect does not return a string value 2014-12-16 19:26:40 +09:00
take_cheeze aa187956cf Add test for end-of-program marker. 2014-06-08 01:38:44 +09:00
Nobuyoshi Nakada ab67c57f65 remove trailing spaces 2014-04-30 09:50:14 +09:00
take_cheeze 18718e065a Add test of $0 value in bin/mruby related to #2103 . 2014-04-22 19:19:08 +09:00
iTitou 6676bd61a7 Also set $0 for binary files 2014-04-21 16:37:52 +02:00
take_cheeze c73f8d4def move summary of mrbgems in default gembox to its spec 2014-03-17 00:34:24 +09:00
Masaki Muranaka 40f57f7b42 Use mrb_str_new_cstr() instead of mrb_str_new() with strlen(). 2014-03-09 16:45:29 +09:00
Tatsuya Matsumoto 43944a0d3a fix mruby command returning EXIT_SUCCESS when program file can't be
opened.
2014-03-05 16:51:57 +09:00
Tatsuya Matsumoto 23cb0bb64b mruby command should not execute program on "syntax only option(-c)". 2014-03-05 12:49:58 +09:00
take_cheeze 24e3e33cb6 use tempfile module 2014-03-03 17:01:47 +09:00
cubicdaiya 94c5a5ee73 use mrb_str_new_lit instead of mrb_str_new for C string literals 2014-02-26 02:23:50 +09:00
Yukihiro "Matz" Matsumoto d7960bf2a9 resolve conflict in travis_config.rb 2014-02-10 09:50:32 +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 aa655b9ee1 remove superfluous includes
- reduce compile time by a little bit (full-core: ~0.7s for me)
- thanks to 'include-what-you-use' for some help
- include Standard C header files before any other (coding style)
2014-01-07 17:56:30 +01: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
fleuria 995e0f89cf add regression for #1572 2013-11-16 15:05:15 +08:00
fleuria 2d646a13f7 add regression for #1564 2013-11-16 14:32:43 +08: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
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
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
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
Tomoyuki Sahara 116f75a8ce "spec.author" is better for single-author gems.
"spec.author=" expects a String represents a single author.
"spec.authors=" expects an Array which is a list of multiple authors.

http://guides.rubygems.org/specification-reference/
2013-07-23 10:09:24 +09:00
Yukihiro "Matz" Matsumoto 6557ee938a mruby error messages should be directed to stderr 2013-05-26 02:13:02 +09:00
Yukihiro "Matz" Matsumoto 7921fd545c move mruby's showcallinfo into the core 2013-05-13 10:40:43 +09:00