tools/PascalPreprocessor.hs
changeset 6453 11c578d30bd3
parent 6425 1ef4192aa80d
child 6891 ab9843957664
--- a/tools/PascalPreprocessor.hs	Sun Nov 27 19:34:08 2011 +0300
+++ b/tools/PascalPreprocessor.hs	Sun Nov 27 23:13:22 2011 +0300
@@ -58,6 +58,7 @@
         s <- choice [
             include
             , ifdef
+            , if'
             , elseSwitch
             , endIf
             , define
@@ -89,10 +90,20 @@
         
         updateState $ \(m, b) ->
             (m, (f $ d `Map.member` m) : b)
-        
       
         return ""
+
+    if' = do
+        s <- try (string "IF" >> notFollowedBy alphaNum)
         
+        manyTill anyChar (char '}')
+        --char '}'
+        
+        updateState $ \(m, b) ->
+            (m, False : b)
+      
+        return ""
+
     elseSwitch = do
         try $ string "ELSE}"
         updateState $ \(m, b:bs) -> (m, (not b):bs)