| Age | Commit message (Collapse) | Author |
|
Fix take over file scope variables with `mruby` and `mirb` command
|
|
|
|
ref #4576 and ref #4947
* Need MRBAPI functions without `MRB_DISABLE_STDIO`:
* mrbgems/mruby-bin-debugger
* mrbgems/mruby-bin-mirb
* mrbgems/mruby-bin-mrbc
* mrbgems/mruby-bin-mruby
* mrbgems/mruby-bin-strip
* Need `stdio.h`:
* mrbgems/mruby-io
* mrbgems/mruby-print
* Need `snprintf()` in `stdio.h`:
* mrbgems/mruby-pack
* mrbgems/mruby-sprintf
|
|
'stdio.h' is included in 'mruby.h' ('mrbconf.h').
However, keep 'stdio.h' used by mruby-test.
|
|
|
|
|
|
Resolve #4931
|
|
|
|
|
|
#### Before this patch:
```
$ bin/mruby --verbose -e 'p 1'
bin/mruby: Cannot open program file: --verbose
```
#### After this patch:
```
$ bin/mruby --verbose -e 'p 1'
00001 NODE_SCOPE:
(snip)
irep 0x7fe97041df30 nregs=4 nlocals=1 pools=0 syms=1 reps=0 iseq=11
file: -e
1 000 OP_LOADSELF R1
(snip)
1
```
|
|
#### Before this patch:
```
$ bin/mruby -e 'p ARGV' -- -x
bin/mruby: invalid option -- (-h will show valid options)
```
#### After this patch:
```
$ bin/mruby -e 'p ARGV' -- -x
["-x"]
```
|
|
#### Before this patch:
```
$ bin/mruby -e 'p ARGV' a b
["bin/mruby", "-e", "p ARGV", "a", "b"]
```
#### After this patch:
```
$ bin/mruby -e 'p ARGV' a b
["a", "b"]
```
|
|
#### Before this patch:
```
$ bin/mruby -ce 1
bin/mruby: Cannot open program file: 1
```
#### After this patch:
```
$ bin/mruby -ce 1
Syntax OK
```
|
|
|
|
- I think "Info" is used only to `skip`, so change to "Skip".
- Changed the default value of `assert` and specify the argument explicitly
at the caller of `assert` because it is unnatural "Assertion failed" is
output even though the assertion doesn't fail.
== Example:
def assert_foo(exp, act)
assert do
assert_equal exp[0], act[0]
assert_equal exp[1], act[1]
end
end
def assert_bar(exp, act)
assert do
skip
end
end
def assert_baz(exp, act)
assert do
assert_equal exp, act
assert_bar exp, act
end
end
assert 'test#skip_in_nested_assert' do
assert_baz 1, 1
end
=== Before this patch:
?..
Info: test#skip_in_nested_assert (core)
- Assertion[1]
Info: Assertion failed (core)
- Assertion[1-2]
Skip: Assertion failed (core)
Total: 3
OK: 2
KO: 0
Crash: 0
Warning: 0
Skip: 1
=== After this patch:
???
Skip: test#skip_in_nested_assert (core)
- Assertion[1]
Skip: assert (core)
- Assertion[1-2]
Skip: assert (core)
Total: 3
OK: 0
KO: 0
Crash: 0
Warning: 0
Skip: 3
|
|
|
|
|
|
- Modify some error messages for consistency.
- Add test for codegen error.
- Use regular expression for error message matching in test.
|
|
- 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.
|
|
|
|
Example:
# example.rb
p(2e308)
p(-2e308)
Good:
$ bin/mruby example.rb
inf
-inf
Bad:
$ bin/mrbc example.rb
$ bin/mruby -b example.mrb
0
-0
Cause:
Float infinity representation is `inf` on dump and it is converted by
corresponding `String#to_f` on load.
Treatment:
- Introduce new representations (`i`: +infinity, `I`: -infinity)
- Allow old representations (`inf`, `-inf`, `infinity`, `-infinity`) too
- Raise error for unknown representations (use corresponding `Kernel#Float`)
|
|
`Kernel#p` etc are used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
Reported by https://hackerone.com/haquaman
|
|
|
|
|
|
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
|
|
'bin/mruby' not work on windows. so correct command name and quoted arguments.
|
|
Add mrb_utf8_from_locale, mrb_utf8_free, mrb_locale_from_utf8, mrb_locale_free. Just works for windows.
|
|
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.
|
|
cross compiles
|
|
mrb_inspect() also calls mrb_obj_as_string() after #inspect to ensure
the mrb_value is a string.
|
|
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
|
|
* `mrb_show_version()`
* `mrb_show_copyright()`
|
|
|
|
|
|
|
|
|
|
|