diff options
| author | Yukihiro Matz Matsumoto <[email protected]> | 2013-02-10 01:11:09 +0900 |
|---|---|---|
| committer | Yukihiro Matz Matsumoto <[email protected]> | 2013-02-10 01:11:09 +0900 |
| commit | 06c06d5c36814e8e5321923fa2e0483e6ea9abc5 (patch) | |
| tree | 824fb95520c7fb9b089a90bb7090fa1958961733 | |
| parent | 84a7c9ed1c7781b53344c14adac722bc27798dcf (diff) | |
| parent | 9a439245dfcbe520a9d2f6b70cb056b9ad351365 (diff) | |
| download | mruby-06c06d5c36814e8e5321923fa2e0483e6ea9abc5.tar.gz mruby-06c06d5c36814e8e5321923fa2e0483e6ea9abc5.zip | |
Merge branch 'master' of github.com:mruby/mruby
| -rw-r--r-- | doc/compile/README.md | 9 | ||||
| -rw-r--r-- | src/parse.y | 2 | ||||
| -rw-r--r-- | src/vm.c | 2 | ||||
| -rw-r--r-- | tasks/mruby_build_commands.rake | 6 | ||||
| -rw-r--r-- | tasks/mruby_build_gem.rake | 2 | ||||
| -rw-r--r-- | test/assert.rb | 2 | ||||
| -rw-r--r-- | test/driver.c | 7 |
7 files changed, 26 insertions, 4 deletions
diff --git a/doc/compile/README.md b/doc/compile/README.md index c6ab2f584..ce968b36e 100644 --- a/doc/compile/README.md +++ b/doc/compile/README.md @@ -64,6 +64,15 @@ Toolchain configuration for Visual Studio 2012 on Windows. toolchain :vs2012 +#### Android + +Toolchain configuration for Android. + + toolchain :androideabi + +Requires the custom standalone Android NDK and the toolchain path +in ```ANDROID_STANDALONE_TOOLCHAIN```. + ### Binaries It is possible to select which tools should be compiled during the compilation diff --git a/src/parse.y b/src/parse.y index 9ee9c9bec..91fb1a8e8 100644 --- a/src/parse.y +++ b/src/parse.y @@ -3000,7 +3000,7 @@ yywarn(parser_state *p, const char *s) } #endif } - else if (p->nerr < sizeof(p->warn_buffer) / sizeof(p->warn_buffer[0])) { + else if (p->nwarn < sizeof(p->warn_buffer) / sizeof(p->warn_buffer[0])) { n = strlen(s); c = (char *)parser_palloc(p, n + 1); memcpy(c, s, n + 1); @@ -1160,7 +1160,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) L_RAISE: ci = mrb->ci; mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern(mrb, "lastpc"), mrb_voidp_value(pc)); - mrb_obj_iv_set(mrb, mrb->exc, mrb_intern(mrb, "ciidx"), mrb_fixnum_value(ci - mrb->cibase)); + mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern(mrb, "ciidx"), mrb_fixnum_value(ci - mrb->cibase)); eidx = ci->eidx; if (ci == mrb->cibase) { if (ci->ridx == 0) goto L_STOP; diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index b3c83277c..884f2027f 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -68,7 +68,11 @@ module MRuby def define_rules(build_dir, source_dir='') @out_ext = build.exts.object - generated_file_matcher = Regexp.new("^#{build_dir}/(.*)#{Regexp.escape out_ext}$") + if build_dir.include? "mrbgems/" + generated_file_matcher = Regexp.new("^#{build_dir}/(.*)#{Regexp.escape out_ext}$") + else + generated_file_matcher = Regexp.new("^#{build_dir}/(?!mrbgems/.+/)(.*)#{Regexp.escape out_ext}$") + end source_exts.each do |ext, compile| rule generated_file_matcher => [ proc { |file| diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index 80990773d..69dd4cafc 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -5,7 +5,9 @@ module MRuby gemrake = File.join(gemdir, "mrbgem.rake") fail "Can't find #{gemrake}" unless File.exists?(gemrake) + Gem.current = nil load gemrake + return nil unless Gem.current Gem.current.dir = gemdir Gem.current.build = MRuby::Build.current diff --git a/test/assert.rb b/test/assert.rb index 4fe95de9d..218a911d4 100644 --- a/test/assert.rb +++ b/test/assert.rb @@ -23,6 +23,7 @@ end # which will be tested by this # assertion def assert(str = 'Assertion failed', iso = '') + print(str, (iso != '' ? " [#{iso}]" : ''), ' : ') if $mrbtest_verbose begin if(!yield) $asserts.push(assertion_string('Fail: ', str, iso)) @@ -37,6 +38,7 @@ def assert(str = 'Assertion failed', iso = '') $kill_test += 1 print('X') end + print("\n") if $mrbtest_verbose end ## diff --git a/test/driver.c b/test/driver.c index 788a77b2d..5183145b4 100644 --- a/test/driver.c +++ b/test/driver.c @@ -36,7 +36,7 @@ check_error(mrb_state *mrb) } int -main(void) +main(int argc, char **argv) { mrb_state *mrb; mrb_value return_value; @@ -52,6 +52,11 @@ main(void) return EXIT_FAILURE; } + if (argc == 2 && strncmp(argv[1], "-v", 2) == 0) { + printf("verbose mode: enable\n\n"); + mrb_gv_set(mrb, mrb_intern(mrb, "$mrbtest_verbose"), mrb_true_value()); + } + mrb_init_mrbtest(mrb); /* evaluate the test */ return_value = mrb_load_string(mrb, prog); |
