Mercurial > hg > index.cgi
diff lwasm/pragma.c @ 562:6237505ee1dc
Add pragma nolistcode which works like nolist but also suppresses code lines
It is occasionally useful to suppress parts of a listing that generate code.
This nolistcode pragma works exactly like nolist but also suppresses code
for just that reason.
author | William Astle <lost@l-w.ca> |
---|---|
date | Fri, 01 Dec 2023 21:11:56 -0700 |
parents | 1260b4eec5a5 |
children |
line wrap: on
line diff
--- a/lwasm/pragma.c Thu Nov 30 16:54:12 2023 -0700 +++ b/lwasm/pragma.c Fri Dec 01 21:11:56 2023 -0700 @@ -55,6 +55,7 @@ { "pcaspcr", "nopcaspcr", PRAGMA_PCASPCR }, { "shadow", "noshadow", PRAGMA_SHADOW }, { "nolist", "list", PRAGMA_NOLIST }, + { "nolistcode", "listcode", PRAGMA_NOLISTCODE }, { "autobranchlength", "noautobranchlength", PRAGMA_AUTOBRANCHLENGTH }, { "export", "noexport", PRAGMA_EXPORT }, { "symbolnocase", "nosymbolnocase", PRAGMA_SYMBOLNOCASE }, @@ -147,6 +148,8 @@ } if (as -> pragmas & PRAGMA_NOLIST) l -> pragmas |= PRAGMA_NOLIST; + if (as -> pragmas & PRAGMA_NOLISTCODE) + l -> pragmas |= PRAGMA_NOLISTCODE; if (as->pragmas & PRAGMA_CC) { l->pragmas |= PRAGMA_CC; @@ -171,6 +174,8 @@ parse_pragma_string(as, ps, 1); if (as -> pragmas & PRAGMA_NOLIST) l -> pragmas |= PRAGMA_NOLIST; + if (as -> pragmas & PRAGMA_NOLISTCODE) + l -> pragmas |= PRAGMA_NOLISTCODE; if (as->pragmas & PRAGMA_CC) { l->pragmas |= PRAGMA_CC; @@ -226,6 +231,8 @@ } if (set_pragmas[i].flag == PRAGMA_NOLIST) l -> pragmas |= PRAGMA_NOLIST; + if (set_pragmas[i].flag == PRAGMA_NOLISTCODE) + l -> pragmas |= PRAGMA_NOLISTCODE; } } lw_free(pp); @@ -282,6 +289,8 @@ if (set_pragmas[i].flag == PRAGMA_NOLIST) l -> pragmas |= PRAGMA_NOLIST; + if (set_pragmas[i].flag == PRAGMA_NOLISTCODE) + l -> pragmas |= PRAGMA_NOLISTCODE; } } lw_free(pp);