Comments (2)
I propose that a better alternative is block-based dead code elimination:
const int DEBUG = 0;
if (DEBUG) {...}
else {...}
And the compiler discards the first block and makes the second one unconditional.
Advantages:
- your code in the discarded block needs to be syntactically valid, so less lilely to bitrot
- can conditionally replace smaller bits of code that a full line
- optimizes all other such blocks where a feature is disabled
- removing
const
from the definition lets you change it to a runtime condition instead - less confusing than figuring out which 5% subset of the C preprocessor is actually supported
Edit: of course, proper, full CPP support would be great, but that's a bigger task. Maybe integrate mcpp?
from neverwinter.nim.
This is resolved by #124
from neverwinter.nim.
Related Issues (20)
- nwn_script_comp: Too many open files
- nwn_script_comp: Allow case-insensitive script parsing HOT 3
- Script comp fails on PRC includes HOT 1
- nwn_script_comp: v1.7.1 doesn't properly utilize threads HOT 2
- nwn_script_comp: Existing but null/empty include files trigger an "ERROR: FILE NOT FOUND" when compiling the script HOT 1
- nwn_script_comp: Mismatched data type between function declaration and implementation is not properly detected
- scriptcomp: Ability to emit warnings
- nwn_script_comp: type mismatch on assignment isn't detected in non-void-main and non-starting-conditional scripts
- nwn_script_comp: Wrong error type detected upon using an unknown identifier as an if() argument
- Error when using a positive value with the + sign HOT 1
- nwn_nwsync_write throw error about size HOT 1
- nwn_script_comp: Issues building on Windows 10 and not picking up $NWN_ROOT and $NWN_HOME environment variables on WSL2 HOT 2
- Windows releases have double ".exe.exe" extensions HOT 3
- Install Error: cannot open file: std/db_sqlite HOT 2
- NWN_GFF Assert Defects with gff output in stdout [Windows] HOT 3
- nwn_script_comp: Illegal storage access
- scriptcomp: ERROR: "for" STATEMENT CANNOT BE FOLLOWED BY A NULL STATEMENT.
- nwn_script_comp: Info level logs sent to stderr instead of stdout in node HOT 6
- nwn_script_comp: Custom directories for includes doesn't seem to be supported HOT 2
- nwn_script_comp: Cannot compile an include file on its own HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neverwinter.nim.