summaryrefslogtreecommitdiffhomepage
path: root/tools/mirb/mirb.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mirb/mirb.c')
-rw-r--r--tools/mirb/mirb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c
index e20de629d..c771535c6 100644
--- a/tools/mirb/mirb.c
+++ b/tools/mirb/mirb.c
@@ -6,6 +6,7 @@
** immediately. It's a REPL...
*/
+#include <stdlib.h>
#include <string.h>
#include <mruby.h>
@@ -38,7 +39,7 @@ is_code_block_open(struct mrb_parser_state *parser)
int code_block_open = FALSE;
/* check for unterminated string */
- if (parser->sterm) return TRUE;
+ if (parser->lex_strterm) return TRUE;
/* check for heredoc */
if (parser->heredoc_starts_nextline) return TRUE;
@@ -132,7 +133,8 @@ is_code_block_open(struct mrb_parser_state *parser)
}
/* Print a short remark for the user */
-void print_hint(void)
+static void
+print_hint(void)
{
printf("mirb - Embeddable Interactive Ruby Shell\n");
printf("\nThis is a very early version, please test and report errors.\n");
@@ -260,6 +262,9 @@ main(void)
else {
/* no */
printf(" => ");
+ if (!mrb_respond_to(mrb,result,mrb_intern(mrb,"inspect"))){
+ result = mrb_any_to_s(mrb,result);
+ }
p(mrb, result);
}
}