66 Commits

Author SHA1 Message Date
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
Yukihiro "Matz" Matsumoto 52a9712c26 link libncurses when there's /usr/include/curses.h; fix #2905 2015-08-01 16:16:22 +09: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
Huei-Horng Yo 2f4f36b334 Remove unused libterminfo detection code.
The detection code is unused even on OpenBSD 5.7,
because of the standard installation is libtermcap be installed, not libterminfo.

This fixes #2829

Tested on Arch Linux (x86_64) & OpenBSD 5.7 (amd64).

Signed-off-by: Huei-Horng Yo <hiroshi@ghostsinthelab.org>
2015-06-10 12:40:18 +08:00
Huei-Horng Yo be2c156876 Detect if ncurses' backend is terminfo or termcap. fixes #2662
Borrowed from @mattn's code at:
https://github.com/mruby/mruby/issues/2662#issuecomment-65535705

Signed-off-by: Huei-Horng Yo <hiroshi@ghostsinthelab.org>
2015-06-09 21:07:12 +08:00
Tomoyuki Sahara 486870e353 NetBSD does not have libreadline but readline(3) is in libedit. 2015-05-20 12:43:44 +09:00
Yukihiro "Matz" Matsumoto d764632f86 Merge pull request #2680 from sdottaka/add-fflush
mrdb, mirb: Add fflush() so that a external program can read output imme...
2015-01-19 08:30:52 +09:00
Tatsuhiko Kubo dae42ffe54 Removed duplicated declarations.
* `mrb_show_version()`
 * `mrb_show_copyright()`
2015-01-03 22:56:36 +09:00
sdottaka 9a0fb6f91b mrdb, mirb: Add fflush() so that a external program can read output immediately. 2014-12-19 16:09:55 +09:00
Yukihiro "Matz" Matsumoto 9723d6e4ba mirb dies if #inspect returns a non-string value; fix #2666 2014-12-12 13:14:56 +09:00
M.Naruoka 14bc76d578 Under cygwin host, ncurses.a is only available instead of termcap.a. 2014-10-31 16:48:50 +09:00
Tatsuhiko Kubo 6c7ba826dd Use sizeof() instead of strlen(). 2014-08-22 20:37:34 +09:00
Tatsuhiko Kubo 55ee7fe79c Fix error handlings in mirb.
mrb_parser_new() and mrb_generate_code() may return NULL.
2014-08-19 16:04:48 +09:00
cremno 82a335643e call mrb_malloc_simple instead of malloc 2014-07-12 11:50:51 +02:00
cremno 9d597f4d9f allocate history_path dynamically
`PATH_MAX` doesn't have to be defined and if it is, then its value is
usually incorrect (possible buffer overflow).
Use `malloc` and `snprintf` instead to prevent this.

https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html
2014-07-11 13:03:13 +02:00
take_cheeze a656daf4c5 Use TRUE instead of 1 in mirb code. 2014-06-30 23:26:23 +09:00
Kouhei Sutou 4f3114dbc9 Add a missing space after "," 2014-06-09 23:00:02 +09:00
cremno 71c7d58736 partially revert 1a5841b for mirb
Fix compilation fail caused by GNU Readline and `ISPRINT`.
Also add missing `unsigned char` cast.
2014-06-06 00:13:24 +02:00
cremno 1a5841b4b1 use uppercase US-ASCII ctype macros 2014-06-05 21:00:47 +02:00
Yukihiro "Matz" Matsumoto 0651051ded allow quit/exit to work within mirb; fix #2253 close #2254
also allow spaces around quit/exit.
2014-05-15 12:07:02 +09:00
Yukihiro "Matz" Matsumoto 0265b47833 remove unnecessary semicolons from a38f8f 2014-05-13 20:17:54 +09:00
Yukihiro "Matz" Matsumoto a38f8fe606 support comments in user-input; also add checks for buffer overflow 2014-05-13 16:03:41 +09:00
Tomoyuki Sahara 6a41149585 libreadline requires libtermcap on OpenBSD. 2014-05-09 14:26:12 +09:00
take_cheeze cf5155f8f7 Suppress warning when using readline in mirb. 2014-05-03 21:24:03 +09:00
take_cheeze 052fe51279 Use header searcher to find readline and linenoise. 2014-05-01 16:49:55 +09:00
Nobuyoshi Nakada ab67c57f65 remove trailing spaces 2014-04-30 09:50:14 +09:00
Yukihiro "Matz" Matsumoto b046ded67d remove mirb regression test that fails on travis-ci only 2014-04-12 23:10:58 +09:00
take_cheeze c73f8d4def move summary of mrbgems in default gembox to its spec 2014-03-17 00:34:24 +09:00
takkaw 0d4bd01cf1 support linenoise in mirb 2014-03-08 01:22:31 +09:00
takkaw d7d8b09580 small refactor 2014-03-05 23:35:34 +09:00
kyab 1cf619d3b4 Fix unused function warning when readline enabled (mirb) 2014-02-23 20:43:43 +09:00
Li Yazhou 876e7de7ec add a regression test for #1706 2014-02-14 11:32:59 +08:00
Li Yazhou 9ebfeac111 keep stack with nlocals instead of nregs; fix #1706 2014-02-14 11:16:56 +08:00
Yukihiro "Matz" Matsumoto d7960bf2a9 resolve conflict in travis_config.rb 2014-02-10 09:50:32 +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
Daniel Bovensiepen 5056a29d93 Remove notice of early version 2014-02-08 03:06:05 +08: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 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 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 14429ef268 add regression for #1563 2013-11-16 15:05:21 +08: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 f80401de6c resolved conflicts and updated to latest return value change of mrb_generate_code() 2013-11-05 00:13:01 +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 0be572df62 change return value from mrb_generate_code() 2013-11-02 23:20:04 +09:00
Lukas Stabe 5692b5ade1 fix no multiline strings in mirb 2013-10-04 06:03:53 +02: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