Skip to content

Making the preproccessor quieter by default (verbose option)#5

Merged
Patronics merged 4 commits intoPatronics:masterfrom
jgOhYeah:verboseSwitchAttempt2
Apr 18, 2022
Merged

Making the preproccessor quieter by default (verbose option)#5
Patronics merged 4 commits intoPatronics:masterfrom
jgOhYeah:verboseSwitchAttempt2

Conversation

@jgOhYeah
Copy link
Copy Markdown
Contributor

@jgOhYeah jgOhYeah commented Dec 2, 2021

Hi Patrick,
It has been a while, but I have made the preprocessor a bit quieter by default and added a --verbose option to make it print debugging messages again. This was mainly because I was getting a little tired of the amount of scrolling up required to look at previous commands when there are lots of directives in a document.

Stuff that used to call print() and I classified as more of a debugging message than anything else (up for debate) now calls preprocessor_info() that may or may not print anything.

The branch this pull request is from should hopefully have just the verbose option changes if you would like to add it.

Kind regards
Jotham

@jgOhYeah
Copy link
Copy Markdown
Contributor Author

jgOhYeah commented Dec 2, 2021

I also found and hopefully fixed a minor bug where a macro was substituted uncommented out in areas that should be commented out and a macro with no parameters had the first line commented out as there was no new line after the start of macro comment, such as

#macro TEST()
    sertxd("Hello World", cr, lf)
    sertxd("Another line", cr, lf)
#endmacro

; Commented out #define SOMETHING

#ifdef SOMETHING
    TEST()
#endif

was preprocessing to

'-----PREPROCESSED BY picaxepreprocess.py-----
'----UPDATED AT 05:31PM, December 02, 2021----
'----SAVING AS compiled.bas ----

'---BEGIN test.bas ---
'PARSED MACRO TEST
; Commented out #define SOMETHING

; ; #ifdef SOMETHING [#IF CODE REMOVED]
;     'Start of macro: TEST    sertxd("Hello World", cr, lf)       <------- Should be on its own line / not have a comment before it
    sertxd("Another line", cr, lf)                                 <------ Not commented out
'--END OF MACRO: TEST() [#IF CODE REMOVED]
; #endif
'---END test.bas---

Now it preprocesses to

'-----PREPROCESSED BY picaxepreprocess.py-----
'----UPDATED AT 05:30PM, December 02, 2021----
'----SAVING AS compiled.bas ----

'---BEGIN test.bas ---
'PARSED MACRO TEST
; Commented out #define SOMETHING

; ; #ifdef SOMETHING [#IF CODE REMOVED]
;     'Start of macro: TEST
;     sertxd("Hello World", cr, lf)
;     sertxd("Another line", cr, lf)
; '--END OF MACRO: TEST()
; [#IF CODE REMOVED]
; #endif
'---END test.bas---

@Patronics Patronics merged commit 5aa76fa into Patronics:master Apr 18, 2022
@Patronics
Copy link
Copy Markdown
Owner

Thanks, merged! :)

@jgOhYeah jgOhYeah deleted the verboseSwitchAttempt2 branch December 5, 2023 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants