| 1 |
/** |
| 2 |
** @file mruby/presym.h - Preallocated Symbols |
| 3 |
** |
| 4 |
** See Copyright Notice in mruby.h |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef MRUBY_PRESYM_H |
| 8 |
#define MRUBY_PRESYM_H |
| 9 |
|
| 10 |
#if defined(MRB_NO_PRESYM) |
| 11 |
# include <mruby/presym/disable.h> |
| 12 |
#elif !defined(MRB_PRESYM_SCANNING) |
| 13 |
# include <mruby/presym/enable.h> |
| 14 |
#endif |
| 15 |
|
| 16 |
/* |
| 17 |
* Where `mrb_intern_lit` is allowed for symbol interning, it is directly |
| 18 |
* replaced by the symbol ID if presym is enabled by using the following |
| 19 |
* macros. |
| 20 |
* |
| 21 |
* MRB_OPSYM(xor) //=> ^ (Operator) |
| 22 |
* MRB_CVSYM(xor) //=> @@xor (Class Variable) |
| 23 |
* MRB_IVSYM(xor) //=> @xor (Instance Variable) |
| 24 |
* MRB_SYM_B(xor) //=> xor! (Method with Bang) |
| 25 |
* MRB_SYM_Q(xor) //=> xor? (Method with Question mark) |
| 26 |
* MRB_SYM_E(xor) //=> xor= (Method with Equal) |
| 27 |
* MRB_SYM(xor) //=> xor (Word characters) |
| 28 |
* |
| 29 |
* For `MRB_OPSYM`, specify the names corresponding to operators (see |
| 30 |
* `MRuby::Presym::OPERATORS` in `lib/mruby/presym.rb` for the names that |
| 31 |
* can be specified for it). Other than that, describe only word characters |
| 32 |
* excluding leading and ending punctuations. |
| 33 |
* |
| 34 |
* These macros are expanded to `mrb_intern_lit` if presym is disabled, |
| 35 |
* therefore the mruby state variable is required. The above macros can be |
| 36 |
* used when the variable name is `mrb`. If you want to use other variable |
| 37 |
* names, you need to use macros with `_2` suffix, such as `MRB_SYM_2`. |
| 38 |
*/ |
| 39 |
|
| 40 |
#endif /* MRUBY_PRESYM_H */ |