jmc icon indicating copy to clipboard operation
jmc copied to clipboard

[BUG] `EVAL` throws errors in macro factories

Open Nico314159 opened this issue 7 months ago • 1 comments

Describe the bug [A clear and concise description of what the bug is.]

When using #define, defining another macro factory in terms of EVAL expressions results in a parsing error.

To Reproduce [Steps to reproduce the behavior]

  1. Write the following code in a .hjmc file:
#define SCALE 480
#bind EVAL
#define Units(x) EVAL((x * SCALE) \ 1)
  1. Use jmc compile
  2. Read the error message that appears in console.

Expected behavior [A clear and concise description of what you expected to happen.]

I expect that the code would compile without error, and that if something like Units(1.5) appeared in the main code, it would be automatically replaced with 720

Actual behavior

I get the following error.

EvaluationException
Unable to evaluate expression '(x * 480)\1'`

Desktop

  • Can replicate on both my 2020 M1 MacBook Air and my 2022 M2 MacBook Air, running MacOS Sonoma

Nico314159 avatar Jul 26 '24 05:07 Nico314159