From 514455525bf4f8e4e72ccdef7d3f88b26fbc77e5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 18 Jan 2014 10:15:28 -0800 Subject: handle #if !X in preprocessor --- src/parseTools.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/parseTools.js') 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)); -- cgit v1.2.3-18-g5258