summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h2
-rw-r--r--include/mruby/compile.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 030e00c9f..a6914cdb4 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -49,6 +49,8 @@
/* initial minimum size for string buffer */
//#define MRB_STR_BUF_MIN_SIZE 128
+/* array size for parser buffer */
+//#define MRB_PARSER_BUF_SIZE 1024
/* -DDISABLE_XXXX to drop following features */
//#define DISABLE_STDIO /* use of stdio */
diff --git a/include/mruby/compile.h b/include/mruby/compile.h
index 8b0743fa3..26f8a597f 100644
--- a/include/mruby/compile.h
+++ b/include/mruby/compile.h
@@ -65,6 +65,7 @@ struct mrb_parser_message {
#define STR_FUNC_SYMBOL 0x10
#define STR_FUNC_ARRAY 0x20
#define STR_FUNC_HEREDOC 0x40
+#define STR_FUNC_XQUOTE 0x80
enum mrb_string_type {
str_not_parsing = (0),
@@ -77,6 +78,7 @@ enum mrb_string_type {
str_ssymbols = (STR_FUNC_PARSING|STR_FUNC_SYMBOL|STR_FUNC_ARRAY),
str_dsymbols = (STR_FUNC_PARSING|STR_FUNC_SYMBOL|STR_FUNC_ARRAY|STR_FUNC_EXPAND),
str_heredoc = (STR_FUNC_PARSING|STR_FUNC_HEREDOC),
+ str_xquote = (STR_FUNC_PARSING|STR_FUNC_XQUOTE|STR_FUNC_EXPAND),
};
/* heredoc structure */
@@ -89,6 +91,10 @@ struct mrb_parser_heredoc_info {
mrb_ast_node *doc;
};
+#ifndef MRB_PARSER_BUF_SIZE
+# define MRB_PARSER_BUF_SIZE 1024
+#endif
+
/* parser structure */
struct mrb_parser_state {
mrb_state *mrb;
@@ -111,7 +117,7 @@ struct mrb_parser_state {
mrb_ast_node *locals;
mrb_ast_node *pb;
- char buf[1024];
+ char buf[MRB_PARSER_BUF_SIZE];
int bidx;
mrb_ast_node *heredocs; /* list of mrb_parser_heredoc_info* */