Skip to content

Fix parsing of non-trailing if bodies inside macro expressions#14505

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:bug/macro-if-call
Apr 19, 2024
Merged

Fix parsing of non-trailing if bodies inside macro expressions#14505
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:bug/macro-if-call

Conversation

@HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Apr 18, 2024

Fixes #14214.

The debug in the following will now be a Var instead of a Call:

{%
  if true
    debug
  end
%}

but it will run just fine because the macro interpreter has a special rule for treating Vars as top-level macro method calls if the variables do not actually exist.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser topic:lang:macros labels Apr 18, 2024
@straight-shoota straight-shoota added this to the 1.13.0 milestone Apr 18, 2024
@straight-shoota straight-shoota merged commit 0706bc8 into crystal-lang:master Apr 19, 2024
@HertzDevil HertzDevil deleted the bug/macro-if-call branch April 19, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser topic:lang:macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-trailing macro if inside a macro for breaks parsing

2 participants