Open Y-Less opened 6 years ago
Consider the following directory structure:
- ABCDE
- default.inc
- ABCDE.inc
What should happen if someone tries to do #include <ABCDE>
?
When a user tries #include <ABC>
, the compiler looks for a file in the following order:
ABC
ABC.inc
ABC.p
Should the same rule be applied for default
?
Should this work for current path (using #include "ABC"
)?
I think for (1), the file ABCDE.inc
should be included because the library developer has intentionally kept ABCDE.inc
when there's a folder ABCDE
. Moreover, this will not break old codebases (where there are folders and files with the same name and the file is included).
For (2), I think the same rules should be followed for consistency. So when searching for default file, the compiler should first check for default
followed by default.inc
and so on.
Yes, check all files first, then defaults in directories.
This issue has been automatically marked as stale because it has not had recent activity.
Is this a BUG REPORT, FEATURE REQUEST or QUESTION?:
What happened:
The file
default.inc
is automatically included when you compile. It would be nice to extend this to other directories - similar to theindex.js
feature in JS 6:Current file structure in YSI:
What you expected to happen:
If doing
#include <directory>
looked for adefault.inc
in that directory the code could change to:Which would put less stuff in the root directory.
In terms of
-Z
, the guard should be generated as if the filename was purely the containing directory.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment: