dbaumgarten / yodk

Development Kit for Starbase's ingame programming language YOLOL
MIT License
57 stars 16 forks source link

Include directive dislikes directories #104

Closed TheCodedOne closed 3 years ago

TheCodedOne commented 3 years ago

Describe the bug When using include and directories, if you include a file that includes another, it attempts to include the sub-include based on the directory of the original script rather than of the script actually trying to include.

To Reproduce Create 3 scripts

/a.nolol
/b.nolol
/c/c.nolol

have b include a, and c include b. see c error that it cannot find a

Code

/a.nolol

hello=world

/b.nolol

include "a"

/c/c.nolol

include "../b"

Expected behaviour Nolol compilation should include based on the local directory of the file including, or have a way of defining a root directory to base all includes from

Platform:

dbaumgarten commented 3 years ago

You are right. Includes are currently always relative to the main-file, which causes issues with nested includes accross multiple directories. Making all includes relative to the current file would probably be the best solution.

dbaumgarten commented 3 years ago

Published as part of v0.1.10