summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 23:08:58 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 23:08:58 -0800
commit9b06a4506ed2ae222b19cafd184c66521b720581 (patch)
tree7284c80d736823c33978dce1f217973d108a905f /include
parent7ba3275bf70fa62a34ea9015e2b03eefd180afe9 (diff)
parente0f25b1fda0c9c67526885fafdabf35d4d4039b7 (diff)
downloadmruby-9b06a4506ed2ae222b19cafd184c66521b720581.tar.gz
mruby-9b06a4506ed2ae222b19cafd184c66521b720581.zip
Merge pull request #850 from mattn/pluggable_regexp
Pluggable regexp
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h2
-rw-r--r--include/mruby/class.h4
-rw-r--r--include/mruby/compile.h1
-rw-r--r--include/mruby/string.h4
4 files changed, 3 insertions, 8 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 17f6a0fc3..da60086bf 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -44,7 +44,7 @@
//#define POOL_PAGE_SIZE 16000
/* -DDISABLE_XXXX to drop the feature */
-#define DISABLE_REGEXP /* regular expression classes */
+//#define DISABLE_REGEXP /* regular expression classes */
//#define DISABLE_SPRINTF /* Kernel.sprintf method */
//#define DISABLE_MATH /* Math functions */
//#define DISABLE_TIME /* Time class */
diff --git a/include/mruby/class.h b/include/mruby/class.h
index eda54dff9..ca05c0d9f 100644
--- a/include/mruby/class.h
+++ b/include/mruby/class.h
@@ -42,13 +42,11 @@ mrb_class(mrb_state *mrb, mrb_value v)
case MRB_TT_MAIN:
return mrb->object_class;
-#ifdef ENABLE_REGEXP
case MRB_TT_REGEX:
case MRB_TT_MATCH:
- mrb_raise(mrb, E_TYPE_ERROR, "type mismatch: %s given",
+ mrb_raisef(mrb, E_TYPE_ERROR, "type mismatch: %s given",
mrb_obj_classname(mrb, v));
return mrb->nil_class; /* not reach */
-#endif
default:
return mrb_object(v)->c;
}
diff --git a/include/mruby/compile.h b/include/mruby/compile.h
index 5bdc7ccea..d0de0153b 100644
--- a/include/mruby/compile.h
+++ b/include/mruby/compile.h
@@ -72,6 +72,7 @@ struct mrb_parser_state {
enum mrb_lex_state_enum lstate;
int sterm;
+ int regexp;
unsigned int cond_stack;
unsigned int cmdarg_stack;
diff --git a/include/mruby/string.h b/include/mruby/string.h
index fca8b5b47..426cbe9ff 100644
--- a/include/mruby/string.h
+++ b/include/mruby/string.h
@@ -11,10 +11,6 @@
extern "C" {
#endif
-#ifdef INCLUDE_ENCODING
-#include "encoding.h"
-#endif
-
#ifndef RB_GC_GUARD
#define RB_GC_GUARD(v) v
#endif