diff options
| author | KOBAYASHI Shuji <[email protected]> | 2020-11-11 23:59:45 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2020-11-13 13:41:20 +0900 |
| commit | 89f591485b91780c213f459f840111a99adca9d0 (patch) | |
| tree | d32adaba112c1cda8eeb5d6c7293a7a3e906bc89 /mrbgems/mruby-method | |
| parent | 6a5e97b448e82fe55348ab1a7e96b70b2c45f6c1 (diff) | |
| download | mruby-89f591485b91780c213f459f840111a99adca9d0.tar.gz mruby-89f591485b91780c213f459f840111a99adca9d0.zip | |
Change name and usage of presym macros
To be also able to build mruby without presym in the future. However,
`MRB_QSYM` has been removed and changed as follows:
### Example
| Type | Symbol | Previous Style | New Style |
|---------------------------|--------|------------------|----------------|
| Operator | & | MRB_QSYM(and) | MRB_OPSYM(and) |
| Class Variable | @@foo | MRB_QSYM(00_foo) | MRB_CVSYM(foo) |
| Instance Variable | @foo | MRB_QSYM(0_foo) | MRB_IVSYM(foo) |
| Method with Bang | foo! | MRB_QSYM(foo_b) | MRB_SYM_B(foo) |
| Method with Question mark | foo? | MRB_QSYM(foo_p) | MRB_SYM_Q(foo) |
| Mmethod with Equal | foo= | MRB_QSYM(foo_e) | MRB_SYM_E(foo) |
This change makes it possible to define, for example, `MRB_IVSYM(foo)` as
`mrb_intern_lit(mrb, "@" "foo")`, which is useful if we support building
without presym in the future.
Diffstat (limited to 'mrbgems/mruby-method')
| -rw-r--r-- | mrbgems/mruby-method/src/method.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-method/src/method.c b/mrbgems/mruby-method/src/method.c index 0a2897847..7699693fd 100644 --- a/mrbgems/mruby-method/src/method.c +++ b/mrbgems/mruby-method/src/method.c @@ -324,10 +324,10 @@ mrb_search_method_owner(mrb_state *mrb, struct RClass *c, mrb_value obj, mrb_sym if (unbound) { goto name_error; } - if (!mrb_respond_to(mrb, obj, MRB_QSYM(respond_to_missing_p))) { + if (!mrb_respond_to(mrb, obj, MRB_SYM_Q(respond_to_missing))) { goto name_error; } - ret = mrb_funcall_id(mrb, obj, MRB_QSYM(respond_to_missing_p), 2, mrb_symbol_value(name), mrb_true_value()); + ret = mrb_funcall_id(mrb, obj, MRB_SYM_Q(respond_to_missing), 2, mrb_symbol_value(name), mrb_true_value()); if (!mrb_test(ret)) { goto name_error; } |
