mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-compiler: replace MRB_SYM_2() with MRB_SYM() macros
The _2 suffix variants accept an mrb_state* parameter that is always ignored with presym enabled. Replace all uses in codegen.c, parse.y, and y.tab.c with the standard macros. The _2 macro definitions are kept in presym headers for backward compatibility. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,8 +31,9 @@
|
||||
* excluding leading and ending punctuation.
|
||||
*
|
||||
* These macros are expanded to compile-time integer constants.
|
||||
* The `_2` suffix variants (e.g., `MRB_SYM_2`) accept an explicit
|
||||
* mruby state parameter but currently ignore it.
|
||||
* The `_2` suffix variants (e.g., `MRB_SYM_2`) are kept for backward
|
||||
* compatibility only; they accept an explicit `mrb_state*` parameter
|
||||
* but ignore it. New code should use the standard macros above.
|
||||
*/
|
||||
|
||||
#endif /* MRUBY_PRESYM_H */
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define MRB_SYM_E(name) MRB_SYM_E__##name
|
||||
#define MRB_SYM(name) MRB_SYM__##name
|
||||
|
||||
/* backward compatibility: _2 variants accept but ignore mrb_state* */
|
||||
#define MRB_OPSYM_2(mrb, name) MRB_OPSYM__##name
|
||||
#define MRB_GVSYM_2(mrb, name) MRB_GVSYM__##name
|
||||
#define MRB_CVSYM_2(mrb, name) MRB_CVSYM__##name
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define MRB_SYM_E(name) MRB_PRESYM_SCANNING_TAGGED(#name "=")
|
||||
#define MRB_SYM(name) MRB_PRESYM_SCANNING_TAGGED(#name)
|
||||
|
||||
/* backward compatibility: _2 variants accept but ignore mrb_state* */
|
||||
#define MRB_OPSYM_2(mrb, name) MRB_OPSYM__##name(mrb)
|
||||
#define MRB_GVSYM_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED("$" #name)
|
||||
#define MRB_CVSYM_2(mrb, name) MRB_PRESYM_SCANNING_TAGGED("@@" #name)
|
||||
|
||||
Reference in New Issue
Block a user