Dmitry Ivankov
2007-06-23 16:01:45 UTC
Following macros won't work:
macro MyYield (expr = null)
syntax ("MyYield", expr)
{
<[ yield $expr ]>
}
It fails to expand, because first it expands into "yield $expr", and then
immediately to hacky dont_use_me, without being intercepted by Typer.
This case can be fixed by creating non-recursive
MacroRegistry.expand_single_macro and fixing Typer.TypeExpr call to
expand_macro.
But expand_macro is also used in PrettyPrint.SprintExpr and
Macros.TraverseExpr, how should these methods interact with
yield,checked,unchecked macros?
macro MyYield (expr = null)
syntax ("MyYield", expr)
{
<[ yield $expr ]>
}
It fails to expand, because first it expands into "yield $expr", and then
immediately to hacky dont_use_me, without being intercepted by Typer.
This case can be fixed by creating non-recursive
MacroRegistry.expand_single_macro and fixing Typer.TypeExpr call to
expand_macro.
But expand_macro is also used in PrettyPrint.SprintExpr and
Macros.TraverseExpr, how should these methods interact with
yield,checked,unchecked macros?