WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 7 forks source link

[BUG] unable to use macros with variables. #92

Open amqndin opened 4 months ago

amqndin commented 4 months ago

Describe the bug

unable to use macro in a line with variable operation of some sort. i get following error:

In src/code/arthealth/entity.jmc:67:5
Unexpected double variable sign at line 67 col 5.
66 |    // tf you looking at
67 |    $$uwu = namespace.$(owo):@s;
        ^^^^^
68 |    // tf you looking at

To Reproduce

[Steps to reproduce the behavior]

  1. type this in any function
    $$uwu = namespace.$(owo):@s;
  2. compile it

Expected behavior

i didnt expect any error.

Desktop

Additional context

if you do

$$uwu = $(owo):@s;

then its gonna work

Nico314159 commented 4 months ago

Try $ $uwu = namespace.$(owo):@s;?

amqndin commented 4 months ago

adding space still gives an error.

JMCSyntaxException
In src/code/arthealth/entity.jmc:66:5
Unexpected variable without name (`$`) at line 66 col 5.
65 |    $scoreboard players operation $resist __variable__ = @s resist.$(damage_type);
66 |    $ $resist = resist.$(damage_type):@s;
        ^
67 |    Hardcode.repeatLists(