small preprocessor - #ifdef like statement ? #242
Replies: 7 comments
-
Posted at 2014-03-17 by @gfwilliams Hmm, it's a thought. I wonder whether minification could be modified to do what you want though. For instance:
That actually works fine when minified - it goes down to:
However when in a function, it doesn't work properly (because it thinks that the state of DBG might get changed).
And that minifies down really nicely:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-17 by Sacha Hello Gordon, Adding such a feature to the minifcation would be great. Regards Sacha |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-26 by rwaldron There are several new syntax proposals for ES7 that would like to make use of "#", as it's one of the last ascii characters available. I strongly recommend avoiding the introduction of non-standard syntactic forms. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-26 by @gfwilliams @rwaldron: any thoughts on telling the minifier that |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-26 by rwaldron Right, that won't work— |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-26 by @gfwilliams I'm not talking about extending Espruino at all here... I can want a way to tell someone else's minifier that a value isn't going to change. I guess I could pre-parse the code, detect the pattern |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-26 by rwaldron I see, I misunderstood. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-03-17 by Sacha
Hi Gordon,
It would be very nice if a tiny preprocessor with #ifdef / #endif statements where included in WebIDE. I would like to strip out debug code that way.
Regards
Sacha
Beta Was this translation helpful? Give feedback.
All reactions