diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-18 10:15:28 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-18 10:15:28 -0800 |
commit | 514455525bf4f8e4e72ccdef7d3f88b26fbc77e5 (patch) | |
tree | fac7943f216b8d40d7a4021d53d4b6649e4dee18 /src/parseTools.js | |
parent | e1fe780c97060da9d8be70a2391d19e0834879b4 (diff) |
handle #if !X in preprocessor
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 1c70a018..e09cd2e2 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -46,7 +46,11 @@ function preprocess(text) { error('unsupported preprecessor op ' + op); } } else { - showStack.push(ident in this && this[ident] > 0); + if (ident[0] === '!') { + showStack.push(!(this[ident.substr(1)] > 0)); + } else { + showStack.push(ident in this && this[ident] > 0); + } } } else if (line[2] == 'n') { // include var included = read(line.substr(line.indexOf(' ')+1)); |