From d35cd42dc8843cd69b7a01ebf2fe91bcea85a5a7 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Thu, 7 Jan 2021 16:38:46 +0900 Subject: Add scan target functions for presym Add the following functions: - mrb_intern_cstr - mrb_define_singleton_method - mrb_define_class_under - mrb_define_module_under --- include/mruby/presym.h | 4 ++-- include/mruby/presym/scanning.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mruby/presym.h b/include/mruby/presym.h index fd326c758..d5ed72e72 100644 --- a/include/mruby/presym.h +++ b/include/mruby/presym.h @@ -29,8 +29,8 @@ * MRB_SYM(xor) //=> xor (Word characters) * * For `MRB_OPSYM`, specify the names corresponding to operators (see - * `MRuby::Presym::OPERATORS` in `lib/mruby/presym.rb for the names that can - * be specified for it). Other than that, describe only word characters + * `MRuby::Presym::OPERATORS` in `lib/mruby/presym.rb` for the names that + * can be specified for it). Other than that, describe only word characters * excluding leading and ending punctuations. * * These macros are expanded to `mrb_intern_lit` if presym is disabled, diff --git a/include/mruby/presym/scanning.h b/include/mruby/presym/scanning.h index 11a3ba312..0a9844913 100644 --- a/include/mruby/presym/scanning.h +++ b/include/mruby/presym/scanning.h @@ -11,14 +11,19 @@ #undef mrb_intern_lit #define mrb_intern_lit(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name) +#define mrb_intern_cstr(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_class_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name) +#define mrb_define_singleton_method(mrb, c, name, f, a) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_class(mrb, name, s) MRB_PRESYM_SCANNING_TAGGED(name) +#define mrb_define_class_under(mrb, o, name, s) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_module(mrb, name) MRB_PRESYM_SCANNING_TAGGED(name) +#define mrb_define_module_under(mrb, o, name) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_module_function(mrb, c, name, f, s) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_const(mrb, c, name, v) MRB_PRESYM_SCANNING_TAGGED(name) #define mrb_define_global_const(mrb, name, v) MRB_PRESYM_SCANNING_TAGGED(name) + #define MRB_OPSYM(name) MRB_OPSYM__##name(mrb) #define MRB_CVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@@" #name) #define MRB_IVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@" #name) -- cgit v1.2.3