Replies: 0 comments 6 replies
-
Is there any case in which the HL-ZASM preprocessor accepts things that the C preprocessor doesn't, or cases in which they both accept it but behave differently? |
Beta Was this translation helpful? Give feedback.
-
The HL-ZASM preprocessor has some specific pragma commands (pragma is compiler-specific anyway). Except that there should be nothing which the C preprocessor doesn't have. |
Beta Was this translation helpful? Give feedback.
-
What about this https://github.com/willsteel/lcpp? Maybe we could embed it in the compiler. |
Beta Was this translation helpful? Give feedback.
-
@suunrider Are you sure this library doesn't depend on the presence of LuaJIT? But other than that, I think I'll ✅ support this idea |
Beta Was this translation helpful? Give feedback.
-
It works, but there are 2 problems: It doesn't properly check if the first character of line is "#", instead it looks for every single character. The other problem is that it takes much time when compiling >200 lines of code (maybe because it checks for every single character). Setting |
Beta Was this translation helpful? Give feedback.
-
I fixed the first problem, also found out it fixes #619. |
Beta Was this translation helpful? Give feedback.
-
It would be better if the preprocessor should be executed before any compilation process and not during it. That means that the preprocessor tries to resolve the label, which leads to errors.
An ANSI-C preprocessor would replace all
MY_FUNCTION
s in the source code withsome_func
. It doesn't throw an error if a function or variable calledsome_func
doesn't exist.However the HL-ZASM compiler throws an error. This can be annoying if you want to have all
#define
s before the actual source code.This idea is taken from an ANSI-C compiler, because the HL-ZASM preprocessor is just poor.
Beta Was this translation helpful? Give feedback.
All reactions