Stevertus / mcscript

A programming language for Minecraft Vanilla
https://mcscript.stevertus.com
MIT License
236 stars 17 forks source link

`#file` creates erroneous files in root data pack folder #37

Open Nixinova opened 3 years ago

Nixinova commented 3 years ago

Using #file: with content above it creates erroneous files that are placed in the root data pack directory.

Example:

#Header#
#file: ./x
/say hi
#file: ./y
/say hello

When compiled, the following occurs:

 Generated    #Header#.mcfunction
 Generated    .//data/DATAPACK/functions/x.mcfunction
 Generated    .//data/DATAPACK/functions/y.mcfunction

The content above the first #file should either be:

  1. disregarded, or
  2. compiled to a folder in its local directory with the same name as the mcscript filename. E.g., if the example above was in file A.mcscript it should be compiled to .//data/DATAPACK/functions/A.mcfunction, not ./#Header#.mcfunction.
Nixinova commented 3 years ago

Also, the syntax of .//data (erroneous ./) is a minor issue.