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? |
|
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. |
|
What about this https://github.com/willsteel/lcpp? Maybe we could embed it in the compiler. |
|
@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 |
|
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 |
|
I fixed the first problem, also found out it fixes #619. |
Uh oh!
There was an error while loading. Please reload this page.
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_FUNCTIONs in the source code withsome_func. It doesn't throw an error if a function or variable calledsome_funcdoesn't exist.However the HL-ZASM compiler throws an error. This can be annoying if you want to have all
#defines before the actual source code.This idea is taken from an ANSI-C compiler, because the HL-ZASM preprocessor is just poor.
All reactions