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 8 forks source link

Macro Factories with multiple parameters will merge results #44

Open w00tyd00d opened 10 months ago

w00tyd00d commented 10 months ago

Describe the bug

Creating a new macro factory using #define that has more than one parameter will produce commands that have their arguments concatenated together instead of being separated by a space.

To Reproduce

  1. Create a macro factory with more than one parameter. eg: #define tp_to(x, y) tp x y
  2. Use the macro factory somewhere within your project and compile it. If the example was used, the resulting command will incorrectly have both player names/selectors merged together.

Screenshots

image image image

Desktop

Additional context

One thing that does fix this behavior is by adding an extra space in the macro factory wherever the space is missing from the end result (eg: #define tp_to(x,y) to x y -- notice the two spaces between x and y). Obviously this fix isn't ideal, I just thought that it might help debug the behavior.