PureBasic Help wrote:/PREPROCESS "Filename": Preprocess the source code and write the output in the specified "Filename". The processed file is a single file with all macro expanded, compiler directive handled and multiline resolved. This allows an easier parsing of a PureBasic source file, as all is expanded and is available in a flat file format. No comments are included by default, but the flag /COMMENTED can be used to have all untouched original source as comments and allow comments processing. The preprocessed file can be recompiled as any other PureBasic source file to create the final executable.
- Compiler shouldn't break
Don't know if it is possible, but I think the PREPROCESS feature should do what is written in the Help and nothing more. In my eyes, it makes no sense if the compiler breaks in the same cases, like the compiler would build a final exe. For exempel:To solve this problem and write the Declare command would be a typical job for users preprocessor.Code: Select all
Test() Procedure Test() MessageRequester ("", "TEST") EndProcedure
- Crate a second File with source-file and source-line
There should be a parallel file to the produced preprocessed file, where for each line in the preprocessed file is a line with information of source-file an source-line. So my preprocessor could give this informations back to the Ide.