packages feed

highlighting-kate 0.5.3.3 → 0.5.3.4

raw patch · 97 files changed

+3101/−2910 lines, 97 filesdep +highlighting-kate

Dependencies added: highlighting-kate

Files

ParseSyntaxFiles.hs view
@@ -168,8 +168,7 @@            unlines includeImports ++            "import Text.ParserCombinators.Parsec hiding (State)\n\            \import Control.Monad.State\n\-           \import Data.Char (isSpace)\n\-           \import Data.Maybe (fromMaybe)\n" +++           \import Data.Char (isSpace)\n" ++            (if null (synLists syntax)                then "\n"                else "import qualified Data.Set as Set\n\n") ++@@ -215,7 +214,7 @@                           text "              updateState $ \\st -> st{ synStPrevChar = '\\n' }" $$                           text "              pEndLine" $$                           text "return result")-      defaultAttributes = text $ "defaultAttributes = " ++ (show $ map (\cont -> ((synLanguage syntax, contName cont), labelFor syntax $ contAttribute cont)) $ synContexts syntax)+      -- defaultAttributes = text $ "defaultAttributes = " ++ (show $ map (\cont -> ((synLanguage syntax, contName cont), labelFor syntax $ contAttribute cont)) $ synContexts syntax)       -- Note: lineBeginContexts seems not to be used in any of the xml files       -- lineBeginContexts =       --   text $ "lineBeginContexts = " ++ (show $ map (\cont -> (contName cont, contLineBeginContext cont)) $ synContexts syntax)@@ -246,13 +245,16 @@       endLineParser = text "pEndLine = do" $$                       (nest 2 $ text "updateState $ \\st -> st{ synStPrevNonspace = False }" $$                                 text "context <- currentContext" $$-                                text "case context of" $$-                                (nest 2 $ (vcat $ map (\cont -> text (show (synLanguage syntax, contName cont)) <> text " -> " <>+                                text "contexts <- synStContexts `fmap` getState" $$+                                text "if length contexts >= 2" $$+                                text "  then case context of" $$+                                (nest 4 $ (vcat $ map (\cont -> text (show (synLanguage syntax, contName cont)) <> text " -> " <>                                             switchContext (synLanguage syntax, contLineEndContext cont) (<> text " >> ") <>                                             if "#pop" `isPrefixOf` (contLineEndContext cont)                                                then text "pEndLine"                                                else text "return ()") $ synContexts syntax) $$-                                          (text $ "_ -> return ()")))+                                          (text $ "_ -> return ()")) $$+                                text "  else return ()")                                 {- text "pushContext (synLanguage syntax, fromMaybe \"#stay\" $ lookup context lineBeginContexts)" $$ -}       -- we use 'words "blah blah2 blah3"' to keep ghc from inlining the list, which makes compiling take a long time       listDef (n, list) = text $ listName n ++ " = Set.fromList $ words $ " ++@@ -264,8 +266,8 @@       regexes = vcat $ map regexDef $ nub $ [parserString x | x <- concatMap contParsers (synContexts syntax),                                                               parserType x == "RegExpr", parserDynamic x == False]   in  vcat $ intersperse (text "") $ [name, exts, mainFunction, lineParser, parseExpression, initState,-                                      endLineParser, withAttr, lists, regexes,-                                      defaultAttributes {- , lineBeginContexts -}] ++ contexts ++ [foreignContexts, contextCatchAll]+                                      endLineParser, withAttr, lists, regexes+                                      {- ,defaultAttributes , lineBeginContexts -}] ++ contexts ++ [foreignContexts, contextCatchAll]  mkAlternatives :: [Doc] -> Doc mkAlternatives docs =@@ -280,7 +282,7 @@       fallthroughParser = if contFallthrough context                              then [parens (switchContext (synLanguage syntax, contFallthroughContext context) (<> text " >> ") <>                                    text "currentContext >>= parseRules")]-                             else [parens $ text $ "currentContext >>= \\x -> guard (x == " ++ show ctx ++ ") >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup " ++ show ctx ++ " defaultAttributes)"]+                             else [parens $ text $ "currentContext >>= \\x -> guard (x == " ++ show ctx ++ ") >> pDefault >>= withAttribute " ++ show (labelFor syntax (contAttribute context))]   in  text ("parseRules " ++ show ctx ++ " =") $$       if null (contParsers context) && null fallthroughParser          then nest 2 (text "pzero")
Text/Highlighting/Kate/Common.hs view
@@ -73,6 +73,7 @@ popContext :: KateParser () popContext = do st <- getState                 case synStContexts st of+                    [x]    -> return () -- stay if we're at the root                     (_:xs) -> updateState $ \st -> st{ synStContexts = xs }                     []     -> fail "Stack empty" @@ -293,7 +294,7 @@   modify $ \st -> st{ synStLineNumber = synStLineNumber st + 1 }   st <- get   let lineName = "line " ++ show (synStLineNumber st)-  let pline = do ts <- many parseExpression+  let pline = do ts <- manyTill parseExpression eof                  s  <- getState                  return (s, ts)   let (newst, result) = case runParser pline st lineName ln of
Text/Highlighting/Kate/Format/HTML.hs view
@@ -105,7 +105,7 @@          tablespec = [            "table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {"           ,"  margin: 0; padding: 0; vertical-align: baseline; border: none; }"-          ,"table.sourceCode { width: 100%; " +++          ,"table.sourceCode { width: 100%; line-height: 100%; " ++              maybe "" (\c -> "background-color: " ++ fromColor c ++ "; ") (backgroundColor f) ++              maybe "" (\c -> "color: " ++ fromColor c ++ "; ") (defaultColor f) ++              "}"
Text/Highlighting/Kate/Syntax/Actionscript.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,15 +42,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("ActionScript 2.0","Normal") -> return ()-    ("ActionScript 2.0","String") -> (popContext) >> pEndLine-    ("ActionScript 2.0","Member") -> (popContext) >> pEndLine-    ("ActionScript 2.0","StaticImports") -> (popContext) >> pEndLine-    ("ActionScript 2.0","Imports") -> (popContext) >> pEndLine-    ("ActionScript 2.0","Commentar 1") -> (popContext) >> pEndLine-    ("ActionScript 2.0","Commentar 2") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("ActionScript 2.0","Normal") -> return ()+      ("ActionScript 2.0","String") -> (popContext) >> pEndLine+      ("ActionScript 2.0","Member") -> (popContext) >> pEndLine+      ("ActionScript 2.0","StaticImports") -> (popContext) >> pEndLine+      ("ActionScript 2.0","Imports") -> (popContext) >> pEndLine+      ("ActionScript 2.0","Commentar 1") -> (popContext) >> pEndLine+      ("ActionScript 2.0","Commentar 2") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -76,8 +78,6 @@ regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 = compileRegex "\\b[_a-zA-Z]\\w*(?=[\\s]*)" regex_'5cs'2a'2e'2a'24 = compileRegex "\\s*.*$" -defaultAttributes = [(("ActionScript 2.0","Normal"),NormalTok),(("ActionScript 2.0","String"),StringTok),(("ActionScript 2.0","Member"),NormalTok),(("ActionScript 2.0","StaticImports"),NormalTok),(("ActionScript 2.0","Imports"),NormalTok),(("ActionScript 2.0","Commentar 1"),CommentTok),(("ActionScript 2.0","Commentar 2"),CommentTok)]- parseRules ("ActionScript 2.0","Normal") =   (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))    <|>@@ -143,7 +143,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ActionScript 2.0","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -152,7 +152,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("ActionScript 2.0","Member") =   (((pRegExpr regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 >>= withAttribute FunctionTok) >>~ (popContext))@@ -162,20 +162,20 @@ parseRules ("ActionScript 2.0","StaticImports") =   (((pRegExpr regex_'5cs'2a'2e'2a'24 >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","StaticImports")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","StaticImports") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","StaticImports")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ActionScript 2.0","Imports") =   (((pRegExpr regex_'5cs'2a'2e'2a'24 >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Imports")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","Imports") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Imports")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ActionScript 2.0","Commentar 1") =-  (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","Commentar 1") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Commentar 1")) >> pDefault >>= withAttribute CommentTok)  parseRules ("ActionScript 2.0","Commentar 2") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ActionScript 2.0","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression 
Text/Highlighting/Kate/Syntax/Ada.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,12 +41,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Ada","Default") -> return ()-    ("Ada","Region Marker") -> (popContext) >> pEndLine-    ("Ada","String") -> (popContext) >> pEndLine-    ("Ada","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Ada","Default") -> return ()+      ("Ada","Region Marker") -> (popContext) >> pEndLine+      ("Ada","String") -> (popContext) >> pEndLine+      ("Ada","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -73,8 +75,6 @@ regex_'5cbend'5cb = compileRegex "\\bend\\b" regex_'27'2e'27 = compileRegex "'.'" -defaultAttributes = [(("Ada","Default"),NormalTok),(("Ada","Region Marker"),RegionMarkerTok),(("Ada","String"),StringTok),(("Ada","Comment"),CommentTok)]- parseRules ("Ada","Default") =   (((pRegExpr regex_'5cbrecord'5cb >>= withAttribute KeywordTok))    <|>@@ -122,18 +122,18 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>|" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ada","Default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ada","Default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ada","Default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ada","Region Marker") =-  (currentContext >>= \x -> guard (x == ("Ada","Region Marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ada","Region Marker") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ada","Region Marker")) >> pDefault >>= withAttribute RegionMarkerTok)  parseRules ("Ada","String") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ada","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ada","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ada","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ada","Comment") =-  (currentContext >>= \x -> guard (x == ("Ada","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ada","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ada","Comment")) >> pDefault >>= withAttribute CommentTok)   parseRules x = parseRules ("Ada","Default") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Alert.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,9 +41,12 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Alerts","Normal Text") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Alerts","Normal Text") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -55,12 +57,10 @@ list_alerts = Set.fromList $ words $ "### ALERT BUG DANGER DEPRECATED FIXME HACK NOTE NOTICE SECURITY TASK TEST TESTING TODO WARNING"  -defaultAttributes = [(("Alerts","Normal Text"),NormalTok)]- parseRules ("Alerts","Normal Text") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_alerts >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Alerts","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Alerts","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Alerts","Normal Text")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Alerts","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Alert_indent.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,9 +41,12 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Alerts_indent","Normal Text") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Alerts_indent","Normal Text") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -55,12 +57,10 @@ list_alerts = Set.fromList $ words $ "### ALERT BUG DANGER DEPRECATED FIXME HACK NOTE NOTICE SECURITY TASK TEST TESTING TODO WARNING"  -defaultAttributes = [(("Alerts_indent","Normal Text"),NormalTok)]- parseRules ("Alerts_indent","Normal Text") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_alerts >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Alerts_indent","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Alerts_indent","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Alerts_indent","Normal Text")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Alerts_indent","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Apache.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,17 +42,20 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Apache Configuration","apache") -> return ()-    ("Apache Configuration","String Directives") -> (popContext) >> pEndLine-    ("Apache Configuration","Integer Directives") -> (popContext) >> pEndLine-    ("Apache Configuration","Alternative Directives") -> (popContext) >> pEndLine-    ("Apache Configuration","Comment") -> (popContext) >> pEndLine-    ("Apache Configuration","Container Open") -> (popContext) >> pEndLine-    ("Apache Configuration","Container Close") -> (popContext) >> pEndLine-    ("Apache Configuration","Comment Alert") -> (popContext) >> pEndLine-    ("Apache Configuration","Alert") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Apache Configuration","apache") -> return ()+      ("Apache Configuration","String Directives") -> (popContext) >> pEndLine+      ("Apache Configuration","Integer Directives") -> (popContext) >> pEndLine+      ("Apache Configuration","Alternative Directives") -> (popContext) >> pEndLine+      ("Apache Configuration","Comment") -> (popContext) >> pEndLine+      ("Apache Configuration","Container Open") -> (popContext) >> pEndLine+      ("Apache Configuration","Container Close") -> (popContext) >> pEndLine+      ("Apache Configuration","Comment Alert") -> (popContext) >> pEndLine+      ("Apache Configuration","Alert") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -71,8 +73,6 @@ regex_'5b'5e'23'5d'2a = compileRegex "[^#]*" regex_'5b'5e'23'3e'5d'2a = compileRegex "[^#>]*" -defaultAttributes = [(("Apache Configuration","apache"),NormalTok),(("Apache Configuration","String Directives"),OtherTok),(("Apache Configuration","Integer Directives"),CharTok),(("Apache Configuration","Alternative Directives"),CharTok),(("Apache Configuration","Comment"),CommentTok),(("Apache Configuration","Container Open"),FunctionTok),(("Apache Configuration","Container Close"),FunctionTok),(("Apache Configuration","Comment Alert"),NormalTok),(("Apache Configuration","Alert"),ErrorTok)]- parseRules ("Apache Configuration","apache") =   (((pKeyword " \n\t.():!+-<=>%&*/;?[]^{|}~\\" list_String_Directives >>= withAttribute NormalTok) >>~ pushContext ("Apache Configuration","String Directives"))    <|>@@ -86,14 +86,14 @@    <|>    ((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("Apache Configuration","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","apache")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","apache") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","apache")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Apache Configuration","String Directives") =   (((pRegExpr regex_'5b'5e'23'5d'2a >>= withAttribute StringTok))    <|>    ((parseRules ("Apache Configuration","Comment Alert")))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","String Directives")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","String Directives") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","String Directives")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Apache Configuration","Integer Directives") =   (((pFloat >>= withAttribute FloatTok) >>~ pushContext ("Apache Configuration","Integer Directives"))@@ -102,7 +102,7 @@    <|>    ((parseRules ("Apache Configuration","Comment Alert")))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Integer Directives")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Integer Directives") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Integer Directives")) >> pDefault >>= withAttribute CharTok))  parseRules ("Apache Configuration","Alternative Directives") =   (((pKeyword " \n\t.():!+-<=>%&*/;?[]^{|}~\\" list_Alternates >>= withAttribute KeywordTok))@@ -113,7 +113,7 @@    <|>    ((parseRules ("Apache Configuration","Comment Alert")))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Alternative Directives")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Alternative Directives") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Alternative Directives")) >> pDefault >>= withAttribute CharTok))  parseRules ("Apache Configuration","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -122,7 +122,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Apache Configuration","Container Open") =   (((pDetectChar False '>' >>= withAttribute FunctionTok) >>~ pushContext ("Apache Configuration","Alert"))@@ -131,20 +131,20 @@    <|>    ((parseRules ("Apache Configuration","Comment Alert")))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Container Open")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Container Open") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Container Open")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Apache Configuration","Container Close") =   (((pDetectChar False '>' >>= withAttribute FunctionTok) >>~ pushContext ("Apache Configuration","Alert"))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Container Close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Container Close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Container Close")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Apache Configuration","Comment Alert") =   (((pDetectChar False '#' >>= withAttribute ErrorTok) >>~ pushContext ("Apache Configuration","Alert"))    <|>-   (currentContext >>= \x -> guard (x == ("Apache Configuration","Comment Alert")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Comment Alert") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Apache Configuration","Comment Alert")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Apache Configuration","Alert") =-  (currentContext >>= \x -> guard (x == ("Apache Configuration","Alert")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Apache Configuration","Alert") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Apache Configuration","Alert")) >> pDefault >>= withAttribute ErrorTok)  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Asn1.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,10 +41,13 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("ASN.1","Normal Text") -> return ()-    ("ASN.1","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("ASN.1","Normal Text") -> return ()+      ("ASN.1","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -57,8 +59,6 @@ list_types = Set.fromList $ words $ "BOOLEAN INTEGER OCTET STRING NULL REAL ENUMERATED SEQUENCE SET CHOICE OF VisibleString StringStore"  -defaultAttributes = [(("ASN.1","Normal Text"),NormalTok),(("ASN.1","Comment"),CommentTok)]- parseRules ("ASN.1","Normal Text") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -66,10 +66,10 @@    <|>    ((pDetect2Chars False '-' '-' >>= withAttribute CommentTok) >>~ pushContext ("ASN.1","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("ASN.1","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASN.1","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASN.1","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ASN.1","Comment") =-  (currentContext >>= \x -> guard (x == ("ASN.1","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASN.1","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("ASN.1","Comment")) >> pDefault >>= withAttribute CommentTok)   parseRules x = parseRules ("ASN.1","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Asp.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,21 +41,24 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("ASP","nosource") -> return ()-    ("ASP","aspsource") -> return ()-    ("ASP","asp_onelinecomment") -> (popContext) >> pEndLine-    ("ASP","doublequotestring") -> return ()-    ("ASP","singlequotestring") -> return ()-    ("ASP","htmltag") -> return ()-    ("ASP","htmlcomment") -> return ()-    ("ASP","identifiers") -> return ()-    ("ASP","types1") -> return ()-    ("ASP","types2") -> return ()-    ("ASP","scripts") -> return ()-    ("ASP","scripts_onelinecomment") -> (popContext) >> pEndLine-    ("ASP","twolinecomment") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("ASP","nosource") -> return ()+      ("ASP","aspsource") -> return ()+      ("ASP","asp_onelinecomment") -> (popContext) >> pEndLine+      ("ASP","doublequotestring") -> return ()+      ("ASP","singlequotestring") -> return ()+      ("ASP","htmltag") -> return ()+      ("ASP","htmlcomment") -> return ()+      ("ASP","identifiers") -> return ()+      ("ASP","types1") -> return ()+      ("ASP","types2") -> return ()+      ("ASP","scripts") -> return ()+      ("ASP","scripts_onelinecomment") -> (popContext) >> pEndLine+      ("ASP","twolinecomment") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -102,8 +104,6 @@ regex_'5cs'2a'3d'5cs'2a = compileRegex "\\s*=\\s*" regex_'5cs'2a'23'3f'5ba'2dzA'2dZ0'2d9'5d'2a = compileRegex "\\s*#?[a-zA-Z0-9]*" -defaultAttributes = [(("ASP","nosource"),NormalTok),(("ASP","aspsource"),NormalTok),(("ASP","asp_onelinecomment"),CommentTok),(("ASP","doublequotestring"),StringTok),(("ASP","singlequotestring"),StringTok),(("ASP","htmltag"),OtherTok),(("ASP","htmlcomment"),CommentTok),(("ASP","identifiers"),OtherTok),(("ASP","types1"),DataTypeTok),(("ASP","types2"),DataTypeTok),(("ASP","scripts"),NormalTok),(("ASP","scripts_onelinecomment"),CommentTok),(("ASP","twolinecomment"),CommentTok)]- parseRules ("ASP","nosource") =   (((pString False "<%" >>= withAttribute KeywordTok) >>~ pushContext ("ASP","aspsource"))    <|>@@ -115,7 +115,7 @@    <|>    ((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("ASP","htmlcomment"))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","nosource")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","nosource") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","nosource")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ASP","aspsource") =   (((pString False "%>" >>= withAttribute KeywordTok) >>~ (popContext))@@ -198,12 +198,12 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_functions >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","aspsource")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","aspsource") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","aspsource")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ASP","asp_onelinecomment") =   (((pString False "%>" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","asp_onelinecomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","asp_onelinecomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","asp_onelinecomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ASP","doublequotestring") =   (((pDetect2Chars False '"' '"' >>= withAttribute KeywordTok))@@ -214,14 +214,14 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","doublequotestring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","doublequotestring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","doublequotestring")) >> pDefault >>= withAttribute StringTok))  parseRules ("ASP","singlequotestring") =   (((pDetect2Chars False '\'' '\'' >>= withAttribute KeywordTok))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","singlequotestring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","singlequotestring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","singlequotestring")) >> pDefault >>= withAttribute StringTok))  parseRules ("ASP","htmltag") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -234,7 +234,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("ASP","identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","htmltag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","htmltag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","htmltag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("ASP","htmlcomment") =   (((pString False "<%" >>= withAttribute KeywordTok) >>~ pushContext ("ASP","aspsource"))@@ -245,7 +245,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("ASP","identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","htmlcomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","htmlcomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","htmlcomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ASP","identifiers") =   (((pRegExpr regex_'5cs'2a'23'3f'5ba'2dzA'2dZ0'2d9'5d'2a >>= withAttribute StringTok) >>~ (popContext))@@ -254,7 +254,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("ASP","types2"))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","identifiers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","identifiers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","identifiers")) >> pDefault >>= withAttribute OtherTok))  parseRules ("ASP","types1") =   (((pString False "<%" >>= withAttribute KeywordTok) >>~ pushContext ("ASP","aspsource"))@@ -263,7 +263,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","types1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","types1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","types1")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("ASP","types2") =   (((pString False "<%" >>= withAttribute KeywordTok) >>~ pushContext ("ASP","aspsource"))@@ -272,7 +272,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","types2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","types2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","types2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("ASP","scripts") =   (((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("ASP","scripts_onelinecomment"))@@ -309,17 +309,17 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" Set.empty >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","scripts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","scripts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","scripts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ASP","scripts_onelinecomment") =   (((pRegExpr regex_'3c'5cs'2a'5c'2f'5cs'2ascript'5cs'2a'3e >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","scripts_onelinecomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","scripts_onelinecomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","scripts_onelinecomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ASP","twolinecomment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ASP","twolinecomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ASP","twolinecomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ASP","twolinecomment")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("ASP","nosource") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Awk.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,11 +42,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("AWK","Base") -> return ()-    ("AWK","String") -> return ()-    ("AWK","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("AWK","Base") -> return ()+      ("AWK","String") -> return ()+      ("AWK","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -62,8 +64,6 @@ regex_'5cb'28BEGIN'7cEND'29'5cb = compileRegex "\\b(BEGIN|END)\\b" regex_'5c'24'5bA'2dZa'2dz0'2d9'5f'5d'2b = compileRegex "\\$[A-Za-z0-9_]+" -defaultAttributes = [(("AWK","Base"),NormalTok),(("AWK","String"),StringTok),(("AWK","Comment"),CommentTok)]- parseRules ("AWK","Base") =   (((pRegExpr regex_'5cb'28BEGIN'7cEND'29'5cb >>= withAttribute StringTok))    <|>@@ -87,19 +87,19 @@    <|>    ((pRegExpr regex_'5c'24'5bA'2dZa'2dz0'2d9'5f'5d'2b >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("AWK","Base")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("AWK","Base") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("AWK","Base")) >> pDefault >>= withAttribute NormalTok))  parseRules ("AWK","String") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pHlCStringChar >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("AWK","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("AWK","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("AWK","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("AWK","Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("AWK","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("AWK","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("AWK","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Bash.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,57 +42,60 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Bash","Start") -> return ()-    ("Bash","FindAll") -> return ()-    ("Bash","FindMost") -> return ()-    ("Bash","FindComments") -> (popContext) >> pEndLine-    ("Bash","Comment") -> (popContext) >> pEndLine-    ("Bash","FindCommentsParen") -> (popContext) >> pEndLine-    ("Bash","CommentParen") -> (popContext) >> pEndLine-    ("Bash","FindCommentsBackq") -> (popContext) >> pEndLine-    ("Bash","CommentBackq") -> (popContext) >> pEndLine-    ("Bash","FindCommands") -> return ()-    ("Bash","FindOthers") -> return ()-    ("Bash","FindStrings") -> return ()-    ("Bash","FindSubstitutions") -> return ()-    ("Bash","FindTests") -> return ()-    ("Bash","ExprDblParen") -> return ()-    ("Bash","ExprDblParenSubst") -> return ()-    ("Bash","ExprSubParen") -> return ()-    ("Bash","ExprBracket") -> return ()-    ("Bash","ExprDblBracket") -> return ()-    ("Bash","Group") -> return ()-    ("Bash","SubShell") -> return ()-    ("Bash","Assign") -> (popContext) >> pEndLine-    ("Bash","AssignArray") -> (popContext) >> pEndLine-    ("Bash","AssignSubscr") -> (popContext) >> pEndLine-    ("Bash","Subscript") -> return ()-    ("Bash","FunctionDef") -> (popContext) >> pEndLine-    ("Bash","VarName") -> (popContext) >> pEndLine-    ("Bash","ProcessSubst") -> return ()-    ("Bash","StringSQ") -> return ()-    ("Bash","StringDQ") -> return ()-    ("Bash","StringEsc") -> return ()-    ("Bash","VarBrace") -> return ()-    ("Bash","VarAlt") -> return ()-    ("Bash","VarSubst") -> return ()-    ("Bash","VarSubst2") -> return ()-    ("Bash","VarSub") -> return ()-    ("Bash","VarSub2") -> return ()-    ("Bash","SubstFile") -> return ()-    ("Bash","SubstCommand") -> return ()-    ("Bash","SubstBackq") -> return ()-    ("Bash","Case") -> return ()-    ("Bash","CaseIn") -> return ()-    ("Bash","CaseExpr") -> return ()-    ("Bash","HereDoc") -> return ()-    ("Bash","HereDocRemainder") -> (popContext) >> pEndLine-    ("Bash","HereDocQ") -> return ()-    ("Bash","HereDocNQ") -> return ()-    ("Bash","HereDocIQ") -> return ()-    ("Bash","HereDocINQ") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Bash","Start") -> return ()+      ("Bash","FindAll") -> return ()+      ("Bash","FindMost") -> return ()+      ("Bash","FindComments") -> (popContext) >> pEndLine+      ("Bash","Comment") -> (popContext) >> pEndLine+      ("Bash","FindCommentsParen") -> (popContext) >> pEndLine+      ("Bash","CommentParen") -> (popContext) >> pEndLine+      ("Bash","FindCommentsBackq") -> (popContext) >> pEndLine+      ("Bash","CommentBackq") -> (popContext) >> pEndLine+      ("Bash","FindCommands") -> return ()+      ("Bash","FindOthers") -> return ()+      ("Bash","FindStrings") -> return ()+      ("Bash","FindSubstitutions") -> return ()+      ("Bash","FindTests") -> return ()+      ("Bash","ExprDblParen") -> return ()+      ("Bash","ExprDblParenSubst") -> return ()+      ("Bash","ExprSubParen") -> return ()+      ("Bash","ExprBracket") -> return ()+      ("Bash","ExprDblBracket") -> return ()+      ("Bash","Group") -> return ()+      ("Bash","SubShell") -> return ()+      ("Bash","Assign") -> (popContext) >> pEndLine+      ("Bash","AssignArray") -> (popContext) >> pEndLine+      ("Bash","AssignSubscr") -> (popContext) >> pEndLine+      ("Bash","Subscript") -> return ()+      ("Bash","FunctionDef") -> (popContext) >> pEndLine+      ("Bash","VarName") -> (popContext) >> pEndLine+      ("Bash","ProcessSubst") -> return ()+      ("Bash","StringSQ") -> return ()+      ("Bash","StringDQ") -> return ()+      ("Bash","StringEsc") -> return ()+      ("Bash","VarBrace") -> return ()+      ("Bash","VarAlt") -> return ()+      ("Bash","VarSubst") -> return ()+      ("Bash","VarSubst2") -> return ()+      ("Bash","VarSub") -> return ()+      ("Bash","VarSub2") -> return ()+      ("Bash","SubstFile") -> return ()+      ("Bash","SubstCommand") -> return ()+      ("Bash","SubstBackq") -> return ()+      ("Bash","Case") -> return ()+      ("Bash","CaseIn") -> return ()+      ("Bash","CaseExpr") -> return ()+      ("Bash","HereDoc") -> return ()+      ("Bash","HereDocRemainder") -> (popContext) >> pEndLine+      ("Bash","HereDocQ") -> return ()+      ("Bash","HereDocNQ") -> return ()+      ("Bash","HereDocIQ") -> return ()+      ("Bash","HereDocINQ") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -178,12 +180,10 @@ regex_'28'3c'3c'5cs'2a'5c'5c'28'5b'5e'7c'26'3b'28'29'3c'3e'5cs'5d'2b'29'29 = compileRegex "(<<\\s*\\\\([^|&;()<>\\s]+))" regex_'28'3c'3c'5cs'2a'28'5b'5e'7c'26'3b'28'29'3c'3e'5cs'5d'2b'29'29 = compileRegex "(<<\\s*([^|&;()<>\\s]+))" -defaultAttributes = [(("Bash","Start"),NormalTok),(("Bash","FindAll"),NormalTok),(("Bash","FindMost"),NormalTok),(("Bash","FindComments"),NormalTok),(("Bash","Comment"),CommentTok),(("Bash","FindCommentsParen"),NormalTok),(("Bash","CommentParen"),CommentTok),(("Bash","FindCommentsBackq"),NormalTok),(("Bash","CommentBackq"),CommentTok),(("Bash","FindCommands"),NormalTok),(("Bash","FindOthers"),NormalTok),(("Bash","FindStrings"),NormalTok),(("Bash","FindSubstitutions"),NormalTok),(("Bash","FindTests"),NormalTok),(("Bash","ExprDblParen"),NormalTok),(("Bash","ExprDblParenSubst"),NormalTok),(("Bash","ExprSubParen"),NormalTok),(("Bash","ExprBracket"),NormalTok),(("Bash","ExprDblBracket"),NormalTok),(("Bash","Group"),NormalTok),(("Bash","SubShell"),NormalTok),(("Bash","Assign"),NormalTok),(("Bash","AssignArray"),NormalTok),(("Bash","AssignSubscr"),NormalTok),(("Bash","Subscript"),OtherTok),(("Bash","FunctionDef"),FunctionTok),(("Bash","VarName"),NormalTok),(("Bash","ProcessSubst"),NormalTok),(("Bash","StringSQ"),StringTok),(("Bash","StringDQ"),StringTok),(("Bash","StringEsc"),StringTok),(("Bash","VarBrace"),ErrorTok),(("Bash","VarAlt"),NormalTok),(("Bash","VarSubst"),NormalTok),(("Bash","VarSubst2"),NormalTok),(("Bash","VarSub"),ErrorTok),(("Bash","VarSub2"),ErrorTok),(("Bash","SubstFile"),NormalTok),(("Bash","SubstCommand"),NormalTok),(("Bash","SubstBackq"),NormalTok),(("Bash","Case"),NormalTok),(("Bash","CaseIn"),NormalTok),(("Bash","CaseExpr"),NormalTok),(("Bash","HereDoc"),NormalTok),(("Bash","HereDocRemainder"),NormalTok),(("Bash","HereDocQ"),NormalTok),(("Bash","HereDocNQ"),NormalTok),(("Bash","HereDocIQ"),NormalTok),(("Bash","HereDocINQ"),NormalTok)]- parseRules ("Bash","Start") =   (((parseRules ("Bash","FindAll")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindAll") =   (((parseRules ("Bash","FindComments")))@@ -196,7 +196,7 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindAll")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindAll") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindAll")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindMost") =   (((parseRules ("Bash","FindComments")))@@ -207,47 +207,47 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindMost")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindMost") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindMost")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindComments") =   (((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("Bash","Comment"))    <|>    ((pRegExpr regex_'5b'5cs'3b'5d'28'3f'3d'23'29 >>= withAttribute NormalTok) >>~ pushContext ("Bash","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindComments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindComments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindComments")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Bash","FindCommentsParen") =   (((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("Bash","CommentParen"))    <|>    ((pRegExpr regex_'5b'5cs'3b'5d'28'3f'3d'23'29 >>= withAttribute NormalTok) >>~ pushContext ("Bash","CommentParen"))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindCommentsParen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindCommentsParen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindCommentsParen")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","CommentParen") =   (((pRegExpr regex_'5b'5e'29'5d'28'3f'3d'5c'29'29 >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","CommentParen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","CommentParen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","CommentParen")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Bash","FindCommentsBackq") =   (((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("Bash","CommentBackq"))    <|>    ((pRegExpr regex_'5b'5cs'3b'5d'28'3f'3d'23'29 >>= withAttribute NormalTok) >>~ pushContext ("Bash","CommentBackq"))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindCommentsBackq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindCommentsBackq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindCommentsBackq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","CommentBackq") =   (((pRegExpr regex_'5b'5e'60'5d'28'3f'3d'60'29 >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","CommentBackq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","CommentBackq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","CommentBackq")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Bash","FindCommands") =   (((pDetect2Chars False '(' '(' >>= withAttribute KeywordTok) >>~ pushContext ("Bash","ExprDblParen"))@@ -308,7 +308,7 @@    <|>    ((pRegExpr regex_'5bA'2dZa'2dz'5f'3a'5d'5bA'2dZa'2dz0'2d9'5f'3a'23'25'40'2d'5d'2a'5cs'2a'5c'28'5c'29 >>= withAttribute FunctionTok))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindCommands")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindCommands") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindCommands")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindOthers") =   (((pRegExpr regex_'5c'5c'5b'5d'5b'3b'5c'5c'24'60'7b'7d'28'29'7c'26'3c'3e'2a_'5d >>= withAttribute DataTypeTok))@@ -323,7 +323,7 @@    <|>    ((pRegExpr regex_'2f'28'5b'5cw'5f'40'2e'25'2a'3f'2b'2d'5d'7c'5c'5c_'29'2a'28'3f'3d'28'5b'5cs'2f'29'3a'3b'24'60'27'22'5d'7c'24'29'29 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindOthers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindOthers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindOthers")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindStrings") =   (((pDetect2Chars False '\\' '\'' >>= withAttribute DataTypeTok))@@ -338,7 +338,7 @@    <|>    ((pDetect2Chars False '$' '"' >>= withAttribute StringTok) >>~ pushContext ("Bash","StringDQ"))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindStrings")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindStrings") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindStrings")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindSubstitutions") =   (((pRegExpr regex_'5c'24'5bA'2dZa'2dz'5f'5d'5bA'2dZa'2dz0'2d9'5f'5d'2a'5c'5b >>= withAttribute OtherTok) >>~ pushContext ("Bash","Subscript"))@@ -367,7 +367,7 @@    <|>    ((pRegExpr regex_'5c'5c'5b'60'24'5c'5c'5d >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindSubstitutions")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindSubstitutions") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindSubstitutions")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","FindTests") =   (((pRegExpr regex_'2d'5babcdefghkprstuwxOGLSNozn'5d'28'3f'3d'5cs'29 >>= withAttribute OtherTok))@@ -378,7 +378,7 @@    <|>    ((pRegExpr regex_'2d'28eq'7cne'7c'5bgl'5d'5bte'5d'29'28'3f'3d'5cs'29 >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","FindTests")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","FindTests") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","FindTests")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","ExprDblParen") =   (((pDetect2Chars False ')' ')' >>= withAttribute KeywordTok) >>~ (popContext))@@ -387,7 +387,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ExprDblParen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ExprDblParen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ExprDblParen")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","ExprDblParenSubst") =   (((pDetect2Chars False ')' ')' >>= withAttribute OtherTok) >>~ (popContext))@@ -396,7 +396,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ExprDblParenSubst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ExprDblParenSubst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ExprDblParenSubst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","ExprSubParen") =   (((pDetectChar False ')' >>= withAttribute NormalTok) >>~ (popContext))@@ -405,7 +405,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ExprSubParen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ExprSubParen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ExprSubParen")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","ExprBracket") =   (((pRegExpr regex_'5cs'5c'5d'28'3f'3d'28'24'7c'5b'5cs'3b'7c'26'5d'29'29 >>= withAttribute KeywordTok) >>~ (popContext))@@ -418,7 +418,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ExprBracket")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ExprBracket") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ExprBracket")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","ExprDblBracket") =   (((pRegExpr regex_'5cs'5c'5d'5c'5d'28'3f'3d'28'24'7c'5b'5cs'3b'7c'26'5d'29'29 >>= withAttribute KeywordTok) >>~ (popContext))@@ -431,21 +431,21 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ExprDblBracket")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ExprDblBracket") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ExprDblBracket")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","Group") =   (((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Bash","FindAll")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","Group")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","Group") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","Group")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","SubShell") =   (((pDetectChar False ')' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Bash","FindAll")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","SubShell")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","SubShell") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","SubShell")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","Assign") =   (((pDetectChar False '(' >>= withAttribute OtherTok) >>~ pushContext ("Bash","AssignArray"))@@ -469,7 +469,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","AssignArray")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","AssignArray") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","AssignArray")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","AssignSubscr") =   (((pDetectChar False '[' >>= withAttribute OtherTok) >>~ pushContext ("Bash","Subscript"))@@ -495,7 +495,7 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","Subscript")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","Subscript") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","Subscript")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Bash","FunctionDef") =   (((pRegExpr regex_'5cs'2b'5bA'2dZa'2dz'5f'3a'5d'5bA'2dZa'2dz0'2d9'5f'3a'23'25'40'2d'5d'2a'28'5cs'2a'5c'28'5c'29'29'3f >>= withAttribute FunctionTok) >>~ (popContext))@@ -532,12 +532,12 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","ProcessSubst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","ProcessSubst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","ProcessSubst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","StringSQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","StringSQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","StringSQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","StringSQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Bash","StringDQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))@@ -546,7 +546,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","StringDQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","StringDQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","StringDQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Bash","StringEsc") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))@@ -555,7 +555,7 @@    <|>    ((pRegExpr regex_'5c'5c'28'5b0'2d7'5d'7b1'2c3'7d'7cx'5bA'2dFa'2df0'2d9'5d'7b1'2c2'7d'7cc'2e'29 >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","StringEsc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","StringEsc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","StringEsc")) >> pDefault >>= withAttribute StringTok))  parseRules ("Bash","VarBrace") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))@@ -568,7 +568,7 @@    <|>    ((pDetectChar False ':' >>= withAttribute OtherTok) >>~ pushContext ("Bash","VarSub"))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarBrace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarBrace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarBrace")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("Bash","VarAlt") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext >> popContext))@@ -577,7 +577,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarAlt")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarAlt") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarAlt")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","VarSubst") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext >> popContext))@@ -588,7 +588,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarSubst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarSubst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarSubst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","VarSubst2") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext >> popContext >> popContext))@@ -597,7 +597,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarSubst2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarSubst2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarSubst2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","VarSub") =   (((pDetectChar False ':' >>= withAttribute OtherTok) >>~ pushContext ("Bash","VarSub2"))@@ -610,7 +610,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarSub")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarSub") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarSub")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("Bash","VarSub2") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext >> popContext >> popContext))@@ -621,7 +621,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","VarSub2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","VarSub2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","VarSub2")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("Bash","SubstFile") =   (((pDetectChar False ')' >>= withAttribute KeywordTok) >>~ (popContext))@@ -634,7 +634,7 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","SubstFile")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","SubstFile") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","SubstFile")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","SubstCommand") =   (((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext))@@ -649,7 +649,7 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","SubstCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","SubstCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","SubstCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","SubstBackq") =   (((pDetectChar False '`' >>= withAttribute KeywordTok) >>~ (popContext))@@ -664,14 +664,14 @@    <|>    ((parseRules ("Bash","FindOthers")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","SubstBackq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","SubstBackq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","SubstBackq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","Case") =   (((pRegExpr regex_'5csin'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Bash","CaseIn"))    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","Case")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","Case") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","Case")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","CaseIn") =   (((pRegExpr regex_'5cbesac'28'3f'3d'24'7c'5b'5cs'3b'29'5d'29 >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -682,7 +682,7 @@    <|>    ((parseRules ("Bash","FindMost")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","CaseIn")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","CaseIn") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","CaseIn")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","CaseExpr") =   (((pDetect2Chars False ';' ';' >>= withAttribute KeywordTok) >>~ (popContext))@@ -691,7 +691,7 @@    <|>    ((parseRules ("Bash","FindAll")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","CaseExpr")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","CaseExpr") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","CaseExpr")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDoc") =   (((lookAhead (pRegExpr regex_'28'3c'3c'2d'5cs'2a'22'28'5b'5e'7c'26'3b'28'29'3c'3e'5cs'5d'2b'29'22'29) >> pushContext ("Bash","HereDocIQ") >> currentContext >>= parseRules))@@ -712,19 +712,19 @@    <|>    ((pString False "<<" >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDocRemainder") =   (((parseRules ("Bash","FindAll")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDocRemainder")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDocRemainder") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDocRemainder")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDocQ") =   (((pRegExprDynamic "%1" >>= withAttribute KeywordTok) >>~ pushContext ("Bash","HereDocRemainder"))    <|>    ((pColumn 0 >> pRegExprDynamic "%2\\b" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDocQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDocQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDocQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDocNQ") =   (((pRegExprDynamic "%1" >>= withAttribute KeywordTok) >>~ pushContext ("Bash","HereDocRemainder"))@@ -733,14 +733,14 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDocNQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDocNQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDocNQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDocIQ") =   (((pRegExprDynamic "%1" >>= withAttribute KeywordTok) >>~ pushContext ("Bash","HereDocRemainder"))    <|>    ((pColumn 0 >> pRegExprDynamic "\\t*%2\\b" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDocIQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDocIQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDocIQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Bash","HereDocINQ") =   (((pRegExprDynamic "%1" >>= withAttribute KeywordTok) >>~ pushContext ("Bash","HereDocRemainder"))@@ -749,7 +749,7 @@    <|>    ((parseRules ("Bash","FindSubstitutions")))    <|>-   (currentContext >>= \x -> guard (x == ("Bash","HereDocINQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Bash","HereDocINQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Bash","HereDocINQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Bibtex.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,15 +41,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("BibTeX","Normal") -> return ()-    ("BibTeX","PreambleCommand") -> return ()-    ("BibTeX","StringCommand") -> return ()-    ("BibTeX","Entry") -> return ()-    ("BibTeX","Field") -> return ()-    ("BibTeX","CurlyBracket") -> return ()-    ("BibTeX","QuotedText") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("BibTeX","Normal") -> return ()+      ("BibTeX","PreambleCommand") -> return ()+      ("BibTeX","StringCommand") -> return ()+      ("BibTeX","Entry") -> return ()+      ("BibTeX","Field") -> return ()+      ("BibTeX","CurlyBracket") -> return ()+      ("BibTeX","QuotedText") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -68,8 +70,6 @@ regex_'5c'5c'28'5ba'2dzA'2dZ'40'5d'2b'7c'5b'5e_'5d'29 = compileRegex "\\\\([a-zA-Z@]+|[^ ])" regex_'7d'24 = compileRegex "}$" -defaultAttributes = [(("BibTeX","Normal"),CommentTok),(("BibTeX","PreambleCommand"),NormalTok),(("BibTeX","StringCommand"),NormalTok),(("BibTeX","Entry"),NormalTok),(("BibTeX","Field"),NormalTok),(("BibTeX","CurlyBracket"),NormalTok),(("BibTeX","QuotedText"),StringTok)]- parseRules ("BibTeX","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~" list_kw'5fentry >>= withAttribute KeywordTok) >>~ pushContext ("BibTeX","Entry"))    <|>@@ -79,7 +79,7 @@    <|>    ((pString False "@comment" >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("BibTeX","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("BibTeX","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("BibTeX","Normal")) >> pDefault >>= withAttribute CommentTok))  parseRules ("BibTeX","PreambleCommand") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("BibTeX","CurlyBracket"))@@ -102,7 +102,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("BibTeX","Entry")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("BibTeX","Entry") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("BibTeX","Entry")) >> pDefault >>= withAttribute NormalTok))  parseRules ("BibTeX","Field") =   (((pFirstNonSpace >> pRegExpr regex_'5ba'2dzA'2dZ0'2d9'5c'2d'5f'5c'2e'5d'2b >>= withAttribute DataTypeTok))@@ -131,7 +131,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("BibTeX","Field")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("BibTeX","Field") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("BibTeX","Field")) >> pDefault >>= withAttribute NormalTok))  parseRules ("BibTeX","CurlyBracket") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("BibTeX","CurlyBracket"))@@ -142,14 +142,14 @@    <|>    ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("BibTeX","CurlyBracket")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("BibTeX","CurlyBracket") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("BibTeX","CurlyBracket")) >> pDefault >>= withAttribute NormalTok))  parseRules ("BibTeX","QuotedText") =   (((pDetectChar False '"' >>= withAttribute NormalTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5c'5c'28'5ba'2dzA'2dZ'40'5d'2b'7c'5b'5e_'5d'29 >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("BibTeX","QuotedText")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("BibTeX","QuotedText") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("BibTeX","QuotedText")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("BibTeX","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Boo.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,24 +41,27 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Boo","Normal") -> return ()-    ("Boo","parenthesised") -> return ()-    ("Boo","Quasi-Quotation") -> return ()-    ("Boo","Tripple A-comment") -> return ()-    ("Boo","Tripple Q-comment") -> return ()-    ("Boo","Tripple A-string") -> return ()-    ("Boo","Raw Tripple A-string") -> return ()-    ("Boo","Tripple Q-string") -> return ()-    ("Boo","Raw Tripple Q-string") -> return ()-    ("Boo","Comment SlashSlash") -> (popContext) >> pEndLine-    ("Boo","Single A-comment") -> return ()-    ("Boo","Single Q-comment") -> return ()-    ("Boo","Single A-string") -> return ()-    ("Boo","Single Q-string") -> return ()-    ("Boo","Raw A-string") -> return ()-    ("Boo","Raw Q-string") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Boo","Normal") -> return ()+      ("Boo","parenthesised") -> return ()+      ("Boo","Quasi-Quotation") -> return ()+      ("Boo","Tripple A-comment") -> return ()+      ("Boo","Tripple Q-comment") -> return ()+      ("Boo","Tripple A-string") -> return ()+      ("Boo","Raw Tripple A-string") -> return ()+      ("Boo","Tripple Q-string") -> return ()+      ("Boo","Raw Tripple Q-string") -> return ()+      ("Boo","Comment SlashSlash") -> (popContext) >> pEndLine+      ("Boo","Single A-comment") -> return ()+      ("Boo","Single Q-comment") -> return ()+      ("Boo","Single A-string") -> return ()+      ("Boo","Single Q-string") -> return ()+      ("Boo","Raw A-string") -> return ()+      ("Boo","Raw Q-string") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -96,8 +98,6 @@ regex_'25'5c'28'5ba'2dzA'2dZ0'2d9'5f'5d'2b'5c'29'5ba'2dzA'2dZ'5d = compileRegex "%\\([a-zA-Z0-9_]+\\)[a-zA-Z]" regex_'27'27'27 = compileRegex "'''" -defaultAttributes = [(("Boo","Normal"),NormalTok),(("Boo","parenthesised"),NormalTok),(("Boo","Quasi-Quotation"),NormalTok),(("Boo","Tripple A-comment"),CommentTok),(("Boo","Tripple Q-comment"),CommentTok),(("Boo","Tripple A-string"),StringTok),(("Boo","Raw Tripple A-string"),StringTok),(("Boo","Tripple Q-string"),StringTok),(("Boo","Raw Tripple Q-string"),StringTok),(("Boo","Comment SlashSlash"),CommentTok),(("Boo","Single A-comment"),CommentTok),(("Boo","Single Q-comment"),CommentTok),(("Boo","Single A-string"),StringTok),(("Boo","Single Q-string"),StringTok),(("Boo","Raw A-string"),StringTok),(("Boo","Raw Q-string"),StringTok)]- parseRules ("Boo","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_namespace >>= withAttribute CharTok))    <|>@@ -165,29 +165,29 @@    <|>    ((pRegExpr regex_'25'5ba'2dzA'2dZ'5d >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Boo","parenthesised") =   (((parseRules ("Boo","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","parenthesised")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","parenthesised") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","parenthesised")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Boo","Quasi-Quotation") =   (((parseRules ("Boo","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Quasi-Quotation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Quasi-Quotation") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Quasi-Quotation")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Boo","Tripple A-comment") =   (((pString False "'''" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Tripple A-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Tripple A-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Tripple A-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Boo","Tripple Q-comment") =   (((pHlCChar >>= withAttribute CommentTok))    <|>    ((pRegExpr regex_'22'22'22 >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Tripple Q-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Tripple Q-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Tripple Q-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Boo","Tripple A-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -198,7 +198,7 @@    <|>    ((pRegExpr regex_'27'27'27 >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Tripple A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Tripple A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Tripple A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Raw Tripple A-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -209,7 +209,7 @@    <|>    ((pRegExpr regex_'27'27'27 >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Raw Tripple A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Raw Tripple A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Raw Tripple A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Tripple Q-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -220,7 +220,7 @@    <|>    ((pRegExpr regex_'22'22'22 >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Tripple Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Tripple Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Tripple Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Raw Tripple Q-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -231,26 +231,26 @@    <|>    ((pRegExpr regex_'22'22'22 >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Raw Tripple Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Raw Tripple Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Raw Tripple Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Comment SlashSlash") =   (((pLineContinue >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Comment SlashSlash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Comment SlashSlash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Comment SlashSlash")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Boo","Single A-comment") =   (((pHlCStringChar >>= withAttribute CommentTok))    <|>    ((pDetectChar False '\'' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Single A-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Single A-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Single A-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Boo","Single Q-comment") =   (((pHlCStringChar >>= withAttribute CommentTok))    <|>    ((pDetectChar False '"' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Single Q-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Single Q-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Single Q-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Boo","Single A-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -261,7 +261,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Single A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Single A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Single A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Single Q-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -272,7 +272,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Single Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Single Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Single Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Raw A-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -283,7 +283,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Raw A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Raw A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Raw A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Boo","Raw Q-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -294,7 +294,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Boo","Raw Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Boo","Raw Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Boo","Raw Q-string")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("Boo","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/C.hs view
@@ -11,7 +11,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -44,19 +43,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("C","Normal") -> return ()-    ("C","String") -> (popContext) >> pEndLine-    ("C","Region Marker") -> (popContext) >> pEndLine-    ("C","Commentar 1") -> (popContext) >> pEndLine-    ("C","Commentar 2") -> return ()-    ("C","AfterHash") -> (popContext) >> pEndLine-    ("C","Preprocessor") -> (popContext) >> pEndLine-    ("C","Define") -> (popContext) >> pEndLine-    ("C","Commentar/Preprocessor") -> return ()-    ("C","Outscoped") -> return ()-    ("C","Outscoped intern") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("C","Normal") -> return ()+      ("C","String") -> (popContext) >> pEndLine+      ("C","Region Marker") -> (popContext) >> pEndLine+      ("C","Commentar 1") -> (popContext) >> pEndLine+      ("C","Commentar 2") -> return ()+      ("C","AfterHash") -> (popContext) >> pEndLine+      ("C","Preprocessor") -> (popContext) >> pEndLine+      ("C","Define") -> (popContext) >> pEndLine+      ("C","Commentar/Preprocessor") -> return ()+      ("C","Outscoped") -> return ()+      ("C","Outscoped intern") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -76,8 +78,6 @@ regex_'23'5cs'2aif = compileRegex "#\\s*if" regex_'23'5cs'2ael'28'3f'3ase'7cif'29 = compileRegex "#\\s*el(?:se|if)" -defaultAttributes = [(("C","Normal"),NormalTok),(("C","String"),StringTok),(("C","Region Marker"),RegionMarkerTok),(("C","Commentar 1"),CommentTok),(("C","Commentar 2"),CommentTok),(("C","AfterHash"),ErrorTok),(("C","Preprocessor"),OtherTok),(("C","Define"),OtherTok),(("C","Commentar/Preprocessor"),CommentTok),(("C","Outscoped"),CommentTok),(("C","Outscoped intern"),CommentTok)]- parseRules ("C","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -133,7 +133,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("C","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("C","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -142,24 +142,24 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("C","Region Marker") =-  (currentContext >>= \x -> guard (x == ("C","Region Marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Region Marker") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("C","Region Marker")) >> pDefault >>= withAttribute RegionMarkerTok)  parseRules ("C","Commentar 1") =   (((pLineContinue >>= withAttribute CommentTok))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("C","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C","Commentar 2") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("C","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C","AfterHash") =   (((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aif'28'3f'3adef'7cndef'29'3f'28'3f'3d'5cs'2b'5cS'29 >>= withAttribute OtherTok) >>~ pushContext ("C","Preprocessor"))@@ -172,7 +172,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2b'5b0'2d9'5d'2b >>= withAttribute OtherTok) >>~ pushContext ("C","Preprocessor"))    <|>-   (currentContext >>= \x -> guard (x == ("C","AfterHash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","AfterHash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","AfterHash")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("C","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok))@@ -187,17 +187,17 @@    <|>    ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C","Commentar 1"))    <|>-   (currentContext >>= \x -> guard (x == ("C","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("C","Define") =   (((pLineContinue >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("C","Define")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Define") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Define")) >> pDefault >>= withAttribute OtherTok))  parseRules ("C","Commentar/Preprocessor") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C","Commentar/Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Commentar/Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Commentar/Preprocessor")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C","Outscoped") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -220,7 +220,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C","Outscoped")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Outscoped") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Outscoped")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C","Outscoped intern") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -241,7 +241,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C","Outscoped intern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C","Outscoped intern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C","Outscoped intern")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression
Text/Highlighting/Kate/Syntax/Changelog.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,11 +40,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("ChangeLog","Normal") -> return ()-    ("ChangeLog","line") -> (popContext) >> pEndLine-    ("ChangeLog","entry") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("ChangeLog","Normal") -> return ()+      ("ChangeLog","line") -> (popContext) >> pEndLine+      ("ChangeLog","entry") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -59,26 +61,24 @@ regex_'3c'2e'2a'3e'5cs'2a'24 = compileRegex "<.*>\\s*$" regex_'2e'2a'3a = compileRegex ".*:" -defaultAttributes = [(("ChangeLog","Normal"),NormalTok),(("ChangeLog","line"),NormalTok),(("ChangeLog","entry"),NormalTok)]- parseRules ("ChangeLog","Normal") =   (((pFirstNonSpace >> pDetectChar False '*' >>= withAttribute DecValTok) >>~ pushContext ("ChangeLog","entry"))    <|>    ((pColumn 0 >> pRegExpr regex_'5cd'5cd'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a >>= withAttribute DataTypeTok) >>~ pushContext ("ChangeLog","line"))    <|>-   (currentContext >>= \x -> guard (x == ("ChangeLog","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ChangeLog","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ChangeLog","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ChangeLog","line") =   (((pRegExpr regex_'28'5cw'5cs'2a'29'2b >>= withAttribute KeywordTok))    <|>    ((pRegExpr regex_'3c'2e'2a'3e'5cs'2a'24 >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ChangeLog","line")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ChangeLog","line") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ChangeLog","line")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ChangeLog","entry") =   (((pRegExpr regex_'2e'2a'3a >>= withAttribute DecValTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ChangeLog","entry")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ChangeLog","entry") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ChangeLog","entry")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("ChangeLog","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Clojure.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,19 +41,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Clojure","Level0") -> return ()-    ("Clojure","Default") -> return ()-    ("Clojure","function_decl") -> return ()-    ("Clojure","SpecialNumber") -> (popContext) >> pEndLine-    ("Clojure","String") -> return ()-    ("Clojure","Level1") -> return ()-    ("Clojure","Level2") -> return ()-    ("Clojure","Level3") -> return ()-    ("Clojure","Level4") -> return ()-    ("Clojure","Level5") -> return ()-    ("Clojure","Level6") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Clojure","Level0") -> return ()+      ("Clojure","Default") -> return ()+      ("Clojure","function_decl") -> return ()+      ("Clojure","SpecialNumber") -> (popContext) >> pEndLine+      ("Clojure","String") -> return ()+      ("Clojure","Level1") -> return ()+      ("Clojure","Level2") -> return ()+      ("Clojure","Level3") -> return ()+      ("Clojure","Level4") -> return ()+      ("Clojure","Level5") -> return ()+      ("Clojure","Level6") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -73,8 +75,6 @@ regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a = compileRegex "\\s*[A-Za-z0-9-+\\<\\>//\\*]*\\s*" regex_'23'5c'5c'2e = compileRegex "#\\\\." -defaultAttributes = [(("Clojure","Level0"),NormalTok),(("Clojure","Default"),NormalTok),(("Clojure","function_decl"),FunctionTok),(("Clojure","SpecialNumber"),NormalTok),(("Clojure","String"),StringTok),(("Clojure","Level1"),NormalTok),(("Clojure","Level2"),NormalTok),(("Clojure","Level3"),NormalTok),(("Clojure","Level4"),NormalTok),(("Clojure","Level5"),NormalTok),(("Clojure","Level6"),NormalTok)]- parseRules ("Clojure","Level0") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level1"))    <|>@@ -82,7 +82,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level0")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level0") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level0")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Default") =   (((pRegExpr regex_'3b'2e'2a'24 >>= withAttribute CommentTok))@@ -125,12 +125,12 @@    <|>    ((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level1"))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","function_decl") =   (((pRegExpr regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a >>= withAttribute FunctionTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","function_decl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","function_decl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","function_decl")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Clojure","SpecialNumber") =   (((pFloat >>= withAttribute FloatTok) >>~ (popContext))@@ -141,7 +141,7 @@    <|>    ((pHlCHex >>= withAttribute FloatTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","SpecialNumber")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","SpecialNumber") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","SpecialNumber")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","String") =   (((pRegExpr regex_'23'5c'5c'2e >>= withAttribute CharTok))@@ -150,7 +150,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Clojure","Level1") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level2"))@@ -161,7 +161,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Level2") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level3"))@@ -172,7 +172,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Level3") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level4"))@@ -183,7 +183,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Level4") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level5"))@@ -194,7 +194,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level4")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Level5") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level6"))@@ -205,7 +205,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level5")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Clojure","Level6") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Clojure","Level1"))@@ -216,7 +216,7 @@    <|>    ((parseRules ("Clojure","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Clojure","Level6")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Clojure","Level6") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Clojure","Level6")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Clojure","Level0") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Cmake.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,14 +42,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("CMake","Normal Text") -> return ()-    ("CMake","Detect Variables") -> return ()-    ("CMake","Command Args") -> return ()-    ("CMake","Macro Args") -> return ()-    ("CMake","Comment") -> (popContext) >> pEndLine-    ("CMake","String") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("CMake","Normal Text") -> return ()+      ("CMake","Detect Variables") -> return ()+      ("CMake","Command Args") -> return ()+      ("CMake","Macro Args") -> return ()+      ("CMake","Comment") -> (popContext) >> pEndLine+      ("CMake","String") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -74,8 +76,6 @@ regex_'22'28'3f'3d'5b_'29'3b'5d'7c'24'29 = compileRegex "\"(?=[ );]|$)" regex_'5c'5c'5b'22'24n'5c'5c'5d = compileRegex "\\\\[\"$n\\\\]" -defaultAttributes = [(("CMake","Normal Text"),NormalTok),(("CMake","Detect Variables"),NormalTok),(("CMake","Command Args"),NormalTok),(("CMake","Macro Args"),NormalTok),(("CMake","Comment"),CommentTok),(("CMake","String"),StringTok)]- parseRules ("CMake","Normal Text") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -93,14 +93,14 @@    <|>    ((pRegExpr regex_'5cw'2b'5cs'2a'28'3f'3d'5c'28'29 >>= withAttribute FunctionTok) >>~ pushContext ("CMake","Macro Args"))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CMake","Detect Variables") =   (((pRegExpr regex_'5c'24ENV'5c'7b'5cs'2a'5cw'2b'5cs'2a'5c'7d >>= withAttribute FloatTok))    <|>    ((pRegExpr regex_'5c'24'5c'7b'5cs'2a'5cw'2b'5cs'2a'5c'7d >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","Detect Variables")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","Detect Variables") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","Detect Variables")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CMake","Command Args") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_special'5fargs >>= withAttribute OtherTok))@@ -113,7 +113,7 @@    <|>    ((parseRules ("CMake","Macro Args")))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","Command Args")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","Command Args") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","Command Args")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CMake","Macro Args") =   (((pDetectChar False ')' >>= withAttribute NormalTok) >>~ (popContext))@@ -126,12 +126,12 @@    <|>    ((parseRules ("CMake","Detect Variables")))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","Macro Args")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","Macro Args") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","Macro Args")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CMake","Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("CMake","String") =   (((pRegExpr regex_'22'28'3f'3d'5b_'29'3b'5d'7c'24'29 >>= withAttribute StringTok) >>~ (popContext))@@ -140,7 +140,7 @@    <|>    ((parseRules ("CMake","Detect Variables")))    <|>-   (currentContext >>= \x -> guard (x == ("CMake","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CMake","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CMake","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Coffee.hs view
@@ -11,7 +11,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -44,19 +43,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("CoffeeScript","Normal") -> return ()-    ("CoffeeScript","Multiline Regex") -> return ()-    ("CoffeeScript","Class") -> return ()-    ("CoffeeScript","Comment") -> (popContext) >> pEndLine-    ("CoffeeScript","Multiline Comment") -> return ()-    ("CoffeeScript","String") -> return ()-    ("CoffeeScript","Rich String") -> return ()-    ("CoffeeScript","Heredoc") -> return ()-    ("CoffeeScript","Rich Heredoc") -> return ()-    ("CoffeeScript","Embedding") -> return ()-    ("CoffeeScript","Javascript") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("CoffeeScript","Normal") -> return ()+      ("CoffeeScript","Multiline Regex") -> return ()+      ("CoffeeScript","Class") -> return ()+      ("CoffeeScript","Comment") -> (popContext) >> pEndLine+      ("CoffeeScript","Multiline Comment") -> return ()+      ("CoffeeScript","String") -> return ()+      ("CoffeeScript","Rich String") -> return ()+      ("CoffeeScript","Heredoc") -> return ()+      ("CoffeeScript","Rich Heredoc") -> return ()+      ("CoffeeScript","Embedding") -> return ()+      ("CoffeeScript","Javascript") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -80,8 +82,6 @@ regex_'2f'2f'2f'5bmig'5d'7b0'2c3'7d = compileRegex "///[mig]{0,3}" regex_'5b'40'24'3a'2e'5cw'5c'5b'5c'5d'5d'2b = compileRegex "[@$:.\\w\\[\\]]+" -defaultAttributes = [(("CoffeeScript","Normal"),NormalTok),(("CoffeeScript","Multiline Regex"),StringTok),(("CoffeeScript","Class"),NormalTok),(("CoffeeScript","Comment"),CommentTok),(("CoffeeScript","Multiline Comment"),CommentTok),(("CoffeeScript","String"),StringTok),(("CoffeeScript","Rich String"),StringTok),(("CoffeeScript","Heredoc"),StringTok),(("CoffeeScript","Rich Heredoc"),StringTok),(("CoffeeScript","Embedding"),NormalTok),(("CoffeeScript","Javascript"),AlertTok)]- parseRules ("CoffeeScript","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -133,7 +133,7 @@    <|>    ((pAnyChar "():!%&+,-/.*<=>?[]|~^;{}" >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CoffeeScript","Multiline Regex") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -142,33 +142,33 @@    <|>    ((pRegExpr regex_'2f'2f'2f'5bmig'5d'7b0'2c3'7d >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Multiline Regex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Multiline Regex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Multiline Regex")) >> pDefault >>= withAttribute StringTok))  parseRules ("CoffeeScript","Class") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'5b'40'24'3a'2e'5cw'5c'5b'5c'5d'5d'2b >>= withAttribute DataTypeTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Class")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Class") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Class")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CoffeeScript","Comment") =   (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("CoffeeScript","Multiline Comment") =   (((pString False "###" >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Multiline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Multiline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Multiline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("CoffeeScript","String") =   (((pHlCStringChar >>= withAttribute StringTok))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("CoffeeScript","Rich String") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -177,14 +177,14 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Rich String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Rich String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Rich String")) >> pDefault >>= withAttribute StringTok))  parseRules ("CoffeeScript","Heredoc") =   (((pHlCStringChar >>= withAttribute StringTok))    <|>    ((pString False "'''" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Heredoc")) >> pDefault >>= withAttribute StringTok))  parseRules ("CoffeeScript","Rich Heredoc") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -193,19 +193,19 @@    <|>    ((pString False "\"\"\"" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Rich Heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Rich Heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Rich Heredoc")) >> pDefault >>= withAttribute StringTok))  parseRules ("CoffeeScript","Embedding") =   (((pDetectChar False '}' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Embedding")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Embedding") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Embedding")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CoffeeScript","Javascript") =   (((pDetectChar False '`' >>= withAttribute AlertTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("CoffeeScript","Javascript")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CoffeeScript","Javascript") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CoffeeScript","Javascript")) >> pDefault >>= withAttribute AlertTok))  parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression
Text/Highlighting/Kate/Syntax/Coldfusion.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,29 +41,32 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("ColdFusion","Normal Text") -> return ()-    ("ColdFusion","ctxCFSCRIPT Tag") -> return ()-    ("ColdFusion","ctxSCRIPT Tag") -> return ()-    ("ColdFusion","ctxSTYLE Tag") -> return ()-    ("ColdFusion","ctxTag") -> return ()-    ("ColdFusion","ctxTable Tag") -> return ()-    ("ColdFusion","ctxAnchor Tag") -> return ()-    ("ColdFusion","ctxImage Tag") -> return ()-    ("ColdFusion","ctxCF Tag") -> return ()-    ("ColdFusion","ctxCustom Tag") -> return ()-    ("ColdFusion","ctxCFX Tag") -> return ()-    ("ColdFusion","ctxHTML Comment") -> return ()-    ("ColdFusion","ctxCF Comment") -> return ()-    ("ColdFusion","ctxC Style Comment") -> return ()-    ("ColdFusion","ctxOne Line Comment") -> (popContext) >> pEndLine-    ("ColdFusion","ctxHTML Entities") -> (popContext) >> pEndLine-    ("ColdFusion","ctxCFSCRIPT Block") -> return ()-    ("ColdFusion","ctxSCRIPT Block") -> return ()-    ("ColdFusion","ctxSTYLE Block") -> return ()-    ("ColdFusion","ctxStyle Properties") -> return ()-    ("ColdFusion","ctxStyle Values") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("ColdFusion","Normal Text") -> return ()+      ("ColdFusion","ctxCFSCRIPT Tag") -> return ()+      ("ColdFusion","ctxSCRIPT Tag") -> return ()+      ("ColdFusion","ctxSTYLE Tag") -> return ()+      ("ColdFusion","ctxTag") -> return ()+      ("ColdFusion","ctxTable Tag") -> return ()+      ("ColdFusion","ctxAnchor Tag") -> return ()+      ("ColdFusion","ctxImage Tag") -> return ()+      ("ColdFusion","ctxCF Tag") -> return ()+      ("ColdFusion","ctxCustom Tag") -> return ()+      ("ColdFusion","ctxCFX Tag") -> return ()+      ("ColdFusion","ctxHTML Comment") -> return ()+      ("ColdFusion","ctxCF Comment") -> return ()+      ("ColdFusion","ctxC Style Comment") -> return ()+      ("ColdFusion","ctxOne Line Comment") -> (popContext) >> pEndLine+      ("ColdFusion","ctxHTML Entities") -> (popContext) >> pEndLine+      ("ColdFusion","ctxCFSCRIPT Block") -> return ()+      ("ColdFusion","ctxSCRIPT Block") -> return ()+      ("ColdFusion","ctxSTYLE Block") -> return ()+      ("ColdFusion","ctxStyle Properties") -> return ()+      ("ColdFusion","ctxStyle Values") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -95,8 +97,6 @@ regex_'3c'2f'5bsS'5d'5btT'5d'5byY'5d'5blL'5d'5beE'5d'3e = compileRegex "</[sS][tT][yY][lL][eE]>" regex_'23'28'5b0'2d9a'2dfA'2dF'5d'7b3'7d'29'7c'28'5b0'2d9a'2dfA'2dF'5d'7b6'7d'29 = compileRegex "#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})" -defaultAttributes = [(("ColdFusion","Normal Text"),NormalTok),(("ColdFusion","ctxCFSCRIPT Tag"),NormalTok),(("ColdFusion","ctxSCRIPT Tag"),NormalTok),(("ColdFusion","ctxSTYLE Tag"),NormalTok),(("ColdFusion","ctxTag"),NormalTok),(("ColdFusion","ctxTable Tag"),NormalTok),(("ColdFusion","ctxAnchor Tag"),NormalTok),(("ColdFusion","ctxImage Tag"),NormalTok),(("ColdFusion","ctxCF Tag"),NormalTok),(("ColdFusion","ctxCustom Tag"),NormalTok),(("ColdFusion","ctxCFX Tag"),NormalTok),(("ColdFusion","ctxHTML Comment"),CommentTok),(("ColdFusion","ctxCF Comment"),CommentTok),(("ColdFusion","ctxC Style Comment"),CommentTok),(("ColdFusion","ctxOne Line Comment"),CommentTok),(("ColdFusion","ctxHTML Entities"),NormalTok),(("ColdFusion","ctxCFSCRIPT Block"),NormalTok),(("ColdFusion","ctxSCRIPT Block"),NormalTok),(("ColdFusion","ctxSTYLE Block"),NormalTok),(("ColdFusion","ctxStyle Properties"),NormalTok),(("ColdFusion","ctxStyle Values"),NormalTok)]- parseRules ("ColdFusion","Normal Text") =   (((pString False "<!---" >>= withAttribute CommentTok) >>~ pushContext ("ColdFusion","ctxCF Comment"))    <|>@@ -124,7 +124,7 @@    <|>    ((pRegExpr regex_'3c'21'3f'5c'2f'3f'5ba'2dzA'2dZ0'2d9'5f'5d'2b >>= withAttribute NormalTok) >>~ pushContext ("ColdFusion","ctxTag"))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxCFSCRIPT Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ pushContext ("ColdFusion","ctxCFSCRIPT Block"))@@ -135,7 +135,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFSCRIPT Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCFSCRIPT Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFSCRIPT Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxSCRIPT Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ pushContext ("ColdFusion","ctxSCRIPT Block"))@@ -146,7 +146,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSCRIPT Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxSCRIPT Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSCRIPT Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxSTYLE Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ pushContext ("ColdFusion","ctxSTYLE Block"))@@ -157,7 +157,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSTYLE Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxSTYLE Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSTYLE Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxTag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -168,7 +168,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxTag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxTag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxTag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxTable Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -179,7 +179,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxTable Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxTable Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxTable Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxAnchor Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -190,7 +190,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxAnchor Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxAnchor Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxAnchor Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxImage Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -201,7 +201,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxImage Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxImage Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxImage Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxCF Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -212,7 +212,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCF Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCF Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCF Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxCustom Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -223,7 +223,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCustom Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCustom Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCustom Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxCFX Tag") =   (((pDetectChar False '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -234,32 +234,32 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFX Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCFX Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFX Tag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxHTML Comment") =   (((pString False "<!---" >>= withAttribute CommentTok) >>~ pushContext ("ColdFusion","ctxCF Comment"))    <|>    ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxHTML Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxHTML Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxHTML Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ColdFusion","ctxCF Comment") =   (((pString False "--->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCF Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCF Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCF Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ColdFusion","ctxC Style Comment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxC Style Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxC Style Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxC Style Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("ColdFusion","ctxOne Line Comment") =-  (currentContext >>= \x -> guard (x == ("ColdFusion","ctxOne Line Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxOne Line Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("ColdFusion","ctxOne Line Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("ColdFusion","ctxHTML Entities") =   (((pDetectChar False ';' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxHTML Entities")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxHTML Entities") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxHTML Entities")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxCFSCRIPT Block") =   (((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("ColdFusion","ctxC Style Comment"))@@ -284,7 +284,7 @@    <|>    ((pRegExpr regex_'3c'2f'5bcC'5d'5bfF'5d'5bsS'5d'5bcC'5d'5brR'5d'5biI'5d'5bpP'5d'5btT'5d'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFSCRIPT Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxCFSCRIPT Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxCFSCRIPT Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxSCRIPT Block") =   (((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("ColdFusion","ctxC Style Comment"))@@ -311,7 +311,7 @@    <|>    ((pRegExpr regex_'3c'2f'5bsS'5d'5bcC'5d'5brR'5d'5biI'5d'5bpP'5d'5btT'5d'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSCRIPT Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxSCRIPT Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSCRIPT Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxSTYLE Block") =   (((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("ColdFusion","ctxC Style Comment"))@@ -320,7 +320,7 @@    <|>    ((pRegExpr regex_'3c'2f'5bsS'5d'5btT'5d'5byY'5d'5blL'5d'5beE'5d'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSTYLE Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxSTYLE Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxSTYLE Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxStyle Properties") =   (((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext))@@ -329,7 +329,7 @@    <|>    ((pDetectChar False ':' >>= withAttribute NormalTok) >>~ pushContext ("ColdFusion","ctxStyle Values"))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxStyle Properties")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxStyle Properties") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxStyle Properties")) >> pDefault >>= withAttribute NormalTok))  parseRules ("ColdFusion","ctxStyle Values") =   (((pDetectChar False ';' >>= withAttribute NormalTok) >>~ (popContext))@@ -346,7 +346,7 @@    <|>    ((pRegExpr regex_'27'5b'5e'27'5d'2a'27 >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxStyle Values")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("ColdFusion","ctxStyle Values") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("ColdFusion","ctxStyle Values")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("ColdFusion","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Commonlisp.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,13 +41,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Common Lisp","Normal") -> return ()-    ("Common Lisp","MultiLineComment") -> return ()-    ("Common Lisp","function_decl") -> return ()-    ("Common Lisp","SpecialNumber") -> (popContext) >> pEndLine-    ("Common Lisp","String") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Common Lisp","Normal") -> return ()+      ("Common Lisp","MultiLineComment") -> return ()+      ("Common Lisp","function_decl") -> return ()+      ("Common Lisp","SpecialNumber") -> (popContext) >> pEndLine+      ("Common Lisp","String") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -70,8 +72,6 @@ regex_'23'5btf'5d = compileRegex "#[tf]" regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a = compileRegex "\\s*[A-Za-z0-9-+\\<\\>//\\*]*\\s*" -defaultAttributes = [(("Common Lisp","Normal"),NormalTok),(("Common Lisp","MultiLineComment"),CommentTok),(("Common Lisp","function_decl"),FunctionTok),(("Common Lisp","SpecialNumber"),NormalTok),(("Common Lisp","String"),StringTok)]- parseRules ("Common Lisp","Normal") =   (((pRegExpr regex_'3b'2b'5cs'2aBEGIN'2e'2a'24 >>= withAttribute RegionMarkerTok))    <|>@@ -107,17 +107,17 @@    <|>    ((pInt >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Common Lisp","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Common Lisp","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Common Lisp","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Common Lisp","MultiLineComment") =   (((pDetect2Chars False '|' '#' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Common Lisp","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Common Lisp","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Common Lisp","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Common Lisp","function_decl") =   (((pRegExpr regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a >>= withAttribute FunctionTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Common Lisp","function_decl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Common Lisp","function_decl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Common Lisp","function_decl")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Common Lisp","SpecialNumber") =   (((pFloat >>= withAttribute FloatTok) >>~ (popContext))@@ -128,7 +128,7 @@    <|>    ((pHlCHex >>= withAttribute FloatTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Common Lisp","SpecialNumber")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Common Lisp","SpecialNumber") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Common Lisp","SpecialNumber")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Common Lisp","String") =   (((pRegExpr regex_'23'5c'5c'2e >>= withAttribute CharTok))@@ -137,7 +137,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Common Lisp","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Common Lisp","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Common Lisp","String")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("Common Lisp","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Cpp.hs view
@@ -11,7 +11,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -44,19 +43,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("C++","Normal") -> return ()-    ("C++","String") -> (popContext) >> pEndLine-    ("C++","Region Marker") -> (popContext) >> pEndLine-    ("C++","Commentar 1") -> (popContext) >> pEndLine-    ("C++","Commentar 2") -> return ()-    ("C++","AfterHash") -> (popContext) >> pEndLine-    ("C++","Preprocessor") -> (popContext) >> pEndLine-    ("C++","Define") -> (popContext) >> pEndLine-    ("C++","Commentar/Preprocessor") -> return ()-    ("C++","Outscoped") -> return ()-    ("C++","Outscoped intern") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("C++","Normal") -> return ()+      ("C++","String") -> (popContext) >> pEndLine+      ("C++","Region Marker") -> (popContext) >> pEndLine+      ("C++","Commentar 1") -> (popContext) >> pEndLine+      ("C++","Commentar 2") -> return ()+      ("C++","AfterHash") -> (popContext) >> pEndLine+      ("C++","Preprocessor") -> (popContext) >> pEndLine+      ("C++","Define") -> (popContext) >> pEndLine+      ("C++","Commentar/Preprocessor") -> return ()+      ("C++","Outscoped") -> return ()+      ("C++","Outscoped intern") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -77,8 +79,6 @@ regex_'23'5cs'2aif = compileRegex "#\\s*if" regex_'23'5cs'2ael'28'3f'3ase'7cif'29 = compileRegex "#\\s*el(?:se|if)" -defaultAttributes = [(("C++","Normal"),NormalTok),(("C++","String"),StringTok),(("C++","Region Marker"),RegionMarkerTok),(("C++","Commentar 1"),CommentTok),(("C++","Commentar 2"),CommentTok),(("C++","AfterHash"),ErrorTok),(("C++","Preprocessor"),OtherTok),(("C++","Define"),OtherTok),(("C++","Commentar/Preprocessor"),CommentTok),(("C++","Outscoped"),CommentTok),(("C++","Outscoped intern"),CommentTok)]- parseRules ("C++","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -136,7 +136,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]{|}~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("C++","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -145,10 +145,10 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C++","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("C++","Region Marker") =-  (currentContext >>= \x -> guard (x == ("C++","Region Marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Region Marker") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("C++","Region Marker")) >> pDefault >>= withAttribute RegionMarkerTok)  parseRules ("C++","Commentar 1") =   (((pLineContinue >>= withAttribute CommentTok))@@ -159,7 +159,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C++","Commentar 2") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -170,7 +170,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C++","AfterHash") =   (((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aif'28'3f'3adef'7cndef'29'3f'28'3f'3d'5cs'2b'5cS'29 >>= withAttribute OtherTok) >>~ pushContext ("C++","Preprocessor"))@@ -183,7 +183,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2b'5b0'2d9'5d'2b >>= withAttribute OtherTok) >>~ pushContext ("C++","Preprocessor"))    <|>-   (currentContext >>= \x -> guard (x == ("C++","AfterHash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","AfterHash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","AfterHash")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("C++","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok))@@ -198,12 +198,12 @@    <|>    ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C++","Commentar 1"))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("C++","Define") =   (((pLineContinue >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Define")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Define") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Define")) >> pDefault >>= withAttribute OtherTok))  parseRules ("C++","Commentar/Preprocessor") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -212,7 +212,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Commentar/Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Commentar/Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Commentar/Preprocessor")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C++","Outscoped") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -233,7 +233,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Outscoped")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Outscoped") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Outscoped")) >> pDefault >>= withAttribute CommentTok))  parseRules ("C++","Outscoped intern") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -254,7 +254,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C++","Outscoped intern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C++","Outscoped intern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C++","Outscoped intern")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression
Text/Highlighting/Kate/Syntax/Cs.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,13 +42,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("C#","Normal") -> return ()-    ("C#","String") -> (popContext) >> pEndLine-    ("C#","Member") -> (popContext) >> pEndLine-    ("C#","Commentar 1") -> (popContext) >> pEndLine-    ("C#","Commentar 2") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("C#","Normal") -> return ()+      ("C#","String") -> (popContext) >> pEndLine+      ("C#","Member") -> (popContext) >> pEndLine+      ("C#","Commentar 1") -> (popContext) >> pEndLine+      ("C#","Commentar 2") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -71,8 +73,6 @@ regex_'5b'2e'5d'7b1'2c1'7d = compileRegex "[.]{1,1}" regex_'5cb'5b'5f'5cw'5d'5b'5f'5cw'5cd'5d'2a'28'3f'3d'5b'5cs'5d'2a'29 = compileRegex "\\b[_\\w][_\\w\\d]*(?=[\\s]*)" -defaultAttributes = [(("C#","Normal"),NormalTok),(("C#","String"),StringTok),(("C#","Member"),NormalTok),(("C#","Commentar 1"),CommentTok),(("C#","Commentar 2"),CommentTok)]- parseRules ("C#","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -134,7 +134,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("C#","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C#","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C#","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("C#","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -143,7 +143,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C#","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C#","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C#","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("C#","Member") =   (((pRegExpr regex_'5cb'5b'5f'5cw'5d'5b'5f'5cw'5cd'5d'2a'28'3f'3d'5b'5cs'5d'2a'29 >>= withAttribute FunctionTok) >>~ (popContext))@@ -151,12 +151,12 @@    ((popContext) >> currentContext >>= parseRules))  parseRules ("C#","Commentar 1") =-  (currentContext >>= \x -> guard (x == ("C#","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C#","Commentar 1") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("C#","Commentar 1")) >> pDefault >>= withAttribute CommentTok)  parseRules ("C#","Commentar 2") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("C#","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("C#","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("C#","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression 
Text/Highlighting/Kate/Syntax/Css.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,27 +42,30 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("CSS","Base") -> return ()-    ("CSS","FindRuleSets") -> return ()-    ("CSS","FindValues") -> return ()-    ("CSS","FindStrings") -> return ()-    ("CSS","FindComments") -> return ()-    ("CSS","Media") -> return ()-    ("CSS","Media2") -> return ()-    ("CSS","SelAttr") -> return ()-    ("CSS","SelPseudo") -> (popContext) >> pEndLine-    ("CSS","Import") -> return ()-    ("CSS","Comment") -> return ()-    ("CSS","RuleSet") -> return ()-    ("CSS","Rule") -> return ()-    ("CSS","Rule2") -> return ()-    ("CSS","PropParen") -> return ()-    ("CSS","PropParen2") -> return ()-    ("CSS","StringDQ") -> return ()-    ("CSS","StringSQ") -> return ()-    ("CSS","InsideString") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("CSS","Base") -> return ()+      ("CSS","FindRuleSets") -> return ()+      ("CSS","FindValues") -> return ()+      ("CSS","FindStrings") -> return ()+      ("CSS","FindComments") -> return ()+      ("CSS","Media") -> return ()+      ("CSS","Media2") -> return ()+      ("CSS","SelAttr") -> return ()+      ("CSS","SelPseudo") -> (popContext) >> pEndLine+      ("CSS","Import") -> return ()+      ("CSS","Comment") -> return ()+      ("CSS","RuleSet") -> return ()+      ("CSS","Rule") -> return ()+      ("CSS","Rule2") -> return ()+      ("CSS","PropParen") -> return ()+      ("CSS","PropParen2") -> return ()+      ("CSS","StringDQ") -> return ()+      ("CSS","StringSQ") -> return ()+      ("CSS","InsideString") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -96,8 +98,6 @@ regex_'21important'5cb = compileRegex "!important\\b" regex_'5c'5c'5b'22'27'5d = compileRegex "\\\\[\"']" -defaultAttributes = [(("CSS","Base"),NormalTok),(("CSS","FindRuleSets"),NormalTok),(("CSS","FindValues"),NormalTok),(("CSS","FindStrings"),NormalTok),(("CSS","FindComments"),NormalTok),(("CSS","Media"),NormalTok),(("CSS","Media2"),NormalTok),(("CSS","SelAttr"),CharTok),(("CSS","SelPseudo"),DecValTok),(("CSS","Import"),NormalTok),(("CSS","Comment"),CommentTok),(("CSS","RuleSet"),NormalTok),(("CSS","Rule"),NormalTok),(("CSS","Rule2"),NormalTok),(("CSS","PropParen"),NormalTok),(("CSS","PropParen2"),NormalTok),(("CSS","StringDQ"),StringTok),(("CSS","StringSQ"),StringTok),(("CSS","InsideString"),StringTok)]- parseRules ("CSS","Base") =   (((pLineContinue >>= withAttribute NormalTok))    <|>@@ -105,7 +105,7 @@    <|>    ((parseRules ("CSS","FindRuleSets")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Base")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Base") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Base")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","FindRuleSets") =   (((pRegExpr regex_'40media'5cb >>= withAttribute DecValTok) >>~ pushContext ("CSS","Media"))@@ -130,7 +130,7 @@    <|>    ((parseRules ("CSS","FindComments")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","FindRuleSets")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","FindRuleSets") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","FindRuleSets")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","FindValues") =   (((pRegExpr regex_'5b'2d'2b'5d'3f'5b0'2d9'2e'5d'2b'28em'7cex'7cch'7crem'7cvw'7cvh'7cvm'7cpx'7cin'7ccm'7cmm'7cpt'7cpc'7cdeg'7crad'7cgrad'7cturn'7cms'7cs'7cHz'7ckHz'29'5cb >>= withAttribute DataTypeTok))@@ -139,14 +139,14 @@    <|>    ((pRegExpr regex_'5b'5cw'5c'2d'5d'2b >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","FindValues")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","FindValues") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","FindValues")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","FindStrings") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("CSS","StringDQ"))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("CSS","StringSQ"))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","FindStrings")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","FindStrings") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","FindStrings")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","FindComments") =   (((pRegExpr regex_'2f'5c'2aBEGIN'2e'2a'5c'2a'2f >>= withAttribute RegionMarkerTok))@@ -155,7 +155,7 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("CSS","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","FindComments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","FindComments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","FindComments")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","Media") =   (((pDetectChar False '{' >>= withAttribute DecValTok) >>~ pushContext ("CSS","Media2"))@@ -168,21 +168,21 @@    <|>    ((pRegExpr regex_'5cS'2b >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Media")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Media") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Media")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","Media2") =   (((pDetectChar False '}' >>= withAttribute DecValTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("CSS","FindRuleSets")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Media2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Media2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Media2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","SelAttr") =   (((pDetectChar False ']' >>= withAttribute CharTok) >>~ (popContext))    <|>    ((parseRules ("CSS","FindStrings")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","SelAttr")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","SelAttr") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","SelAttr")) >> pDefault >>= withAttribute CharTok))  parseRules ("CSS","SelPseudo") =   (((pKeyword " \n\t.():!+,<=>&*/;?[]^{|}~\\" list_pseudoclasses >>= withAttribute DecValTok) >>~ (popContext))@@ -200,7 +200,7 @@    <|>    ((parseRules ("CSS","FindComments")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Import")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Import") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Import")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -211,7 +211,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("CSS","RuleSet") =   (((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext))@@ -224,14 +224,14 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","RuleSet")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","RuleSet") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","RuleSet")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","Rule") =   (((pDetectChar False ':' >>= withAttribute KeywordTok) >>~ pushContext ("CSS","Rule2"))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Rule")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Rule") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Rule")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","Rule2") =   (((pDetectChar False ';' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -254,7 +254,7 @@    <|>    ((parseRules ("CSS","FindComments")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","Rule2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","Rule2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","Rule2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","PropParen") =   (((pDetectChar False '(' >>= withAttribute DataTypeTok) >>~ pushContext ("CSS","PropParen2"))@@ -263,7 +263,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","PropParen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","PropParen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","PropParen")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","PropParen2") =   (((pDetectChar False ')' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))@@ -274,28 +274,28 @@    <|>    ((parseRules ("CSS","FindComments")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","PropParen2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","PropParen2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","PropParen2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("CSS","StringDQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("CSS","InsideString")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","StringDQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","StringDQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","StringDQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("CSS","StringSQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("CSS","InsideString")))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","StringSQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","StringSQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","StringSQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("CSS","InsideString") =   (((pRegExpr regex_'5c'5c'5b'22'27'5d >>= withAttribute StringTok))    <|>    ((pDetectIdentifier >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("CSS","InsideString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("CSS","InsideString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("CSS","InsideString")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/D.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,47 +42,50 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("D","normal") -> return ()-    ("D","StartingLetter") -> (popContext) >> pEndLine-    ("D","Properties") -> return ()-    ("D","NumberLiteral") -> return ()-    ("D","LinePragma") -> (popContext) >> pEndLine-    ("D","UnicodeShort") -> (popContext) >> pEndLine-    ("D","UnicodeLong") -> (popContext) >> pEndLine-    ("D","HTMLEntity") -> (popContext) >> pEndLine-    ("D","ModuleName") -> return ()-    ("D","Linkage") -> return ()-    ("D","Linkage2") -> return ()-    ("D","Version") -> return ()-    ("D","Version2") -> return ()-    ("D","Scope") -> return ()-    ("D","Scope2") -> return ()-    ("D","Pragma") -> return ()-    ("D","Pragma2") -> return ()-    ("D","RawString") -> return ()-    ("D","BQString") -> return ()-    ("D","HexString") -> return ()-    ("D","CharLiteral") -> pushContext ("D","CharLiteralClosing") >> return ()-    ("D","CharLiteralClosing") -> (popContext >> popContext) >> pEndLine-    ("D","String") -> return ()-    ("D","CommentRules") -> (popContext) >> pEndLine-    ("D","Region Marker") -> (popContext) >> pEndLine-    ("D","CommentLine") -> (popContext) >> pEndLine-    ("D","CommentBlock") -> return ()-    ("D","CommentNested") -> return ()-    ("D","DdocNormal") -> return ()-    ("D","DdocLine") -> (popContext) >> pEndLine-    ("D","DdocBlock") -> return ()-    ("D","DdocNested") -> return ()-    ("D","DdocNested2") -> return ()-    ("D","DdocMacro") -> return ()-    ("D","DdocMacro2") -> return ()-    ("D","DdocMacro3") -> return ()-    ("D","MacroRules") -> return ()-    ("D","DdocBlockCode") -> return ()-    ("D","DdocNestedCode") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("D","normal") -> return ()+      ("D","StartingLetter") -> (popContext) >> pEndLine+      ("D","Properties") -> return ()+      ("D","NumberLiteral") -> return ()+      ("D","LinePragma") -> (popContext) >> pEndLine+      ("D","UnicodeShort") -> (popContext) >> pEndLine+      ("D","UnicodeLong") -> (popContext) >> pEndLine+      ("D","HTMLEntity") -> (popContext) >> pEndLine+      ("D","ModuleName") -> return ()+      ("D","Linkage") -> return ()+      ("D","Linkage2") -> return ()+      ("D","Version") -> return ()+      ("D","Version2") -> return ()+      ("D","Scope") -> return ()+      ("D","Scope2") -> return ()+      ("D","Pragma") -> return ()+      ("D","Pragma2") -> return ()+      ("D","RawString") -> return ()+      ("D","BQString") -> return ()+      ("D","HexString") -> return ()+      ("D","CharLiteral") -> pushContext ("D","CharLiteralClosing") >> return ()+      ("D","CharLiteralClosing") -> (popContext >> popContext) >> pEndLine+      ("D","String") -> return ()+      ("D","CommentRules") -> (popContext) >> pEndLine+      ("D","Region Marker") -> (popContext) >> pEndLine+      ("D","CommentLine") -> (popContext) >> pEndLine+      ("D","CommentBlock") -> return ()+      ("D","CommentNested") -> return ()+      ("D","DdocNormal") -> return ()+      ("D","DdocLine") -> (popContext) >> pEndLine+      ("D","DdocBlock") -> return ()+      ("D","DdocNested") -> return ()+      ("D","DdocNested2") -> return ()+      ("D","DdocMacro") -> return ()+      ("D","DdocMacro2") -> return ()+      ("D","DdocMacro3") -> return ()+      ("D","MacroRules") -> return ()+      ("D","DdocBlockCode") -> return ()+      ("D","DdocNestedCode") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -150,8 +152,6 @@ regex_'2d'7b3'2c'7d'28'24'7c'5cs'29 = compileRegex "-{3,}($|\\s)" regex_'5c'2b'2b'2f = compileRegex "\\++/" -defaultAttributes = [(("D","normal"),NormalTok),(("D","StartingLetter"),NormalTok),(("D","Properties"),NormalTok),(("D","NumberLiteral"),NormalTok),(("D","LinePragma"),KeywordTok),(("D","UnicodeShort"),StringTok),(("D","UnicodeLong"),StringTok),(("D","HTMLEntity"),StringTok),(("D","ModuleName"),NormalTok),(("D","Linkage"),NormalTok),(("D","Linkage2"),NormalTok),(("D","Version"),NormalTok),(("D","Version2"),NormalTok),(("D","Scope"),NormalTok),(("D","Scope2"),NormalTok),(("D","Pragma"),KeywordTok),(("D","Pragma2"),KeywordTok),(("D","RawString"),StringTok),(("D","BQString"),StringTok),(("D","HexString"),StringTok),(("D","CharLiteral"),CharTok),(("D","CharLiteralClosing"),ErrorTok),(("D","String"),StringTok),(("D","CommentRules"),NormalTok),(("D","Region Marker"),RegionMarkerTok),(("D","CommentLine"),CommentTok),(("D","CommentBlock"),CommentTok),(("D","CommentNested"),CommentTok),(("D","DdocNormal"),NormalTok),(("D","DdocLine"),CommentTok),(("D","DdocBlock"),CommentTok),(("D","DdocNested"),CommentTok),(("D","DdocNested2"),CommentTok),(("D","DdocMacro"),ErrorTok),(("D","DdocMacro2"),NormalTok),(("D","DdocMacro3"),NormalTok),(("D","MacroRules"),NormalTok),(("D","DdocBlockCode"),NormalTok),(("D","DdocNestedCode"),NormalTok)]- parseRules ("D","normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -195,7 +195,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("D","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","StartingLetter") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -250,7 +250,7 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("D","StartingLetter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","StartingLetter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","StartingLetter")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Properties") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_properties >>= withAttribute DataTypeTok) >>~ (popContext))@@ -285,17 +285,17 @@    <|>    ((pRegExpr regex_'2e'2b >>= withAttribute ErrorTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","LinePragma")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","LinePragma") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","LinePragma")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("D","UnicodeShort") =   (((pRegExpr regex_'5b'5cda'2dfA'2dF'5d'7b4'7d >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","UnicodeShort")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","UnicodeShort") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","UnicodeShort")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","UnicodeLong") =   (((pRegExpr regex_'5b'5cda'2dfA'2dF'5d'7b8'7d >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","UnicodeLong")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","UnicodeLong") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","UnicodeLong")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","HTMLEntity") =   (((pRegExpr regex_'5ba'2dzA'2dZ'5d'5cw'2b'3b >>= withAttribute StringTok) >>~ (popContext))@@ -309,7 +309,7 @@    <|>    ((lookAhead (pRegExpr regex_'5b'5e'5cs'5cw'2e'3a'2c'3d'5d) >> (popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("D","ModuleName")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","ModuleName") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","ModuleName")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Linkage") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -333,7 +333,7 @@    <|>    ((pRegExpr regex_'5b'5e'29'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Linkage2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Linkage2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Linkage2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Version") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -346,7 +346,7 @@    <|>    ((pRegExpr regex_'5b'5e'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Version")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Version") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Version")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Version2") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -363,7 +363,7 @@    <|>    ((pRegExpr regex_'5b'5e'29'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Version2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Version2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Version2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Scope") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -385,7 +385,7 @@    <|>    ((pRegExpr regex_'5b'5e'29'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Scope2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Scope2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Scope2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Pragma") =   (((pDetectSpaces >>= withAttribute KeywordTok))@@ -396,7 +396,7 @@    <|>    ((pRegExpr regex_'5b'5e'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Pragma")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Pragma") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Pragma")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("D","Pragma2") =   (((pDetectSpaces >>= withAttribute KeywordTok))@@ -411,24 +411,24 @@    <|>    ((pRegExpr regex_'5b'5e'29'5cs'5cn'5d'2b >>= withAttribute ErrorTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","Pragma2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Pragma2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","Pragma2")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("D","RawString") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","RawString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","RawString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","RawString")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","BQString") =   (((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("D","BQString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","BQString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","BQString")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","HexString") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5b'5e'5csa'2dfA'2dF'5cd'22'5d'2b >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("D","HexString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","HexString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","HexString")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","CharLiteral") =   (((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))@@ -465,7 +465,7 @@    <|>    ((pDetect2Chars False '\\' '&' >>= withAttribute StringTok) >>~ pushContext ("D","HTMLEntity"))    <|>-   (currentContext >>= \x -> guard (x == ("D","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("D","CommentRules") =   (((parseRules ("D","DdocNormal")))@@ -476,17 +476,17 @@    <|>    ((pDetect2Chars False '/' '+' >>= withAttribute CommentTok) >>~ pushContext ("D","CommentNested"))    <|>-   (currentContext >>= \x -> guard (x == ("D","CommentRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","CommentRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","CommentRules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","Region Marker") =-  (currentContext >>= \x -> guard (x == ("D","Region Marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","Region Marker") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("D","Region Marker")) >> pDefault >>= withAttribute RegionMarkerTok)  parseRules ("D","CommentLine") =   (((pDetectSpaces >>= withAttribute CommentTok))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("D","CommentLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","CommentLine") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","CommentLine")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","CommentBlock") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -495,7 +495,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("D","CommentBlock")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","CommentBlock") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","CommentBlock")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","CommentNested") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -506,7 +506,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("D","CommentNested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","CommentNested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","CommentNested")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","DdocNormal") =   (((pRegExpr regex_'2f'7b3'2c'7d >>= withAttribute CommentTok) >>~ pushContext ("D","DdocLine"))@@ -515,7 +515,7 @@    <|>    ((pRegExpr regex_'2f'5c'2b'7b2'2c'7d'28'3f'21'2f'29 >>= withAttribute CommentTok) >>~ pushContext ("D","DdocNested"))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocNormal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocNormal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocNormal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","DdocLine") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -528,7 +528,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocLine") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocLine")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","DdocBlock") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -549,7 +549,7 @@    <|>    ((pRegExpr regex_'2d'7b3'2c'7d'28'24'7c'5cs'29 >>= withAttribute CommentTok) >>~ pushContext ("D","DdocBlockCode"))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocBlock")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocBlock") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocBlock")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","DdocNested") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -572,7 +572,7 @@    <|>    ((pRegExpr regex_'2d'7b3'2c'7d'28'24'7c'5cs'29 >>= withAttribute CommentTok) >>~ pushContext ("D","DdocNestedCode"))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocNested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocNested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocNested")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","DdocNested2") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -583,7 +583,7 @@    <|>    ((parseRules ("D","DdocNested")))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocNested2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocNested2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocNested2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("D","DdocMacro") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -594,21 +594,21 @@    <|>    ((pDetectIdentifier >>= withAttribute OtherTok) >>~ pushContext ("D","DdocMacro2"))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocMacro")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocMacro") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocMacro")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("D","DdocMacro2") =   (((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("D","MacroRules")))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocMacro2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocMacro2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocMacro2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","DdocMacro3") =   (((pDetectChar False ')' >>= withAttribute NormalTok) >>~ (popContext))    <|>    ((parseRules ("D","MacroRules")))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocMacro3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocMacro3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocMacro3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","MacroRules") =   (((pDetect2Chars False '$' '(' >>= withAttribute OtherTok) >>~ pushContext ("D","DdocMacro"))@@ -617,7 +617,7 @@    <|>    ((pFirstNonSpace >> pDetectChar False '*' >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("D","MacroRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","MacroRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","MacroRules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","DdocBlockCode") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -632,7 +632,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.D.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocBlockCode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocBlockCode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocBlockCode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("D","DdocNestedCode") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -647,7 +647,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.D.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("D","DdocNestedCode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("D","DdocNestedCode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("D","DdocNestedCode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression parseRules ("D", _) = Text.Highlighting.Kate.Syntax.D.parseExpression
Text/Highlighting/Kate/Syntax/Diff.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,23 +40,26 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Diff","Normal") -> return ()-    ("Diff","FindDiff") -> return ()-    ("Diff","File") -> return ()-    ("Diff","Chunk") -> return ()-    ("Diff","ChunkInFile") -> return ()-    ("Diff","RFile") -> return ()-    ("Diff","RChunk") -> return ()-    ("Diff","RChunkInFile") -> return ()-    ("Diff","RChunkNew") -> return ()-    ("Diff","RChunkInFileNew") -> return ()-    ("Diff","File") -> (popContext) >> pEndLine-    ("Diff","Removed") -> (popContext) >> pEndLine-    ("Diff","Added") -> (popContext) >> pEndLine-    ("Diff","ChangedOld") -> (popContext) >> pEndLine-    ("Diff","ChangedNew") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Diff","Normal") -> return ()+      ("Diff","FindDiff") -> return ()+      ("Diff","File") -> return ()+      ("Diff","Chunk") -> return ()+      ("Diff","ChunkInFile") -> return ()+      ("Diff","RFile") -> return ()+      ("Diff","RChunk") -> return ()+      ("Diff","RChunkInFile") -> return ()+      ("Diff","RChunkNew") -> return ()+      ("Diff","RChunkInFileNew") -> return ()+      ("Diff","File") -> (popContext) >> pEndLine+      ("Diff","Removed") -> (popContext) >> pEndLine+      ("Diff","Added") -> (popContext) >> pEndLine+      ("Diff","ChangedOld") -> (popContext) >> pEndLine+      ("Diff","ChangedNew") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -80,8 +82,6 @@ regex_'5c'2a'5c'2a'5c'2a_'2e'2a_'5c'2a'5c'2a'5c'2a'5c'2a'24 = compileRegex "\\*\\*\\* .* \\*\\*\\*\\*$" regex_'5c'2d'5c'2d'5c'2d_'2e'2a_'5c'2d'5c'2d'5c'2d'5c'2d'24 = compileRegex "\\-\\-\\- .* \\-\\-\\-\\-$" -defaultAttributes = [(("Diff","Normal"),NormalTok),(("Diff","FindDiff"),NormalTok),(("Diff","File"),NormalTok),(("Diff","Chunk"),NormalTok),(("Diff","ChunkInFile"),NormalTok),(("Diff","RFile"),NormalTok),(("Diff","RChunk"),NormalTok),(("Diff","RChunkInFile"),NormalTok),(("Diff","RChunkNew"),NormalTok),(("Diff","RChunkInFileNew"),NormalTok),(("Diff","File"),KeywordTok),(("Diff","Removed"),StringTok),(("Diff","Added"),OtherTok),(("Diff","ChangedOld"),StringTok),(("Diff","ChangedNew"),OtherTok)]- parseRules ("Diff","Normal") =   (((pColumn 0 >> pRegExpr regex_'28'5c'40'5c'40'7c'5cd'29'2e'2a'24 >>= withAttribute DataTypeTok) >>~ pushContext ("Diff","Chunk"))    <|>@@ -99,7 +99,7 @@    <|>    ((pColumn 0 >> pDetectChar False '!' >>= withAttribute NormalTok) >>~ pushContext ("Diff","ChangedOld"))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","FindDiff") =   (((pColumn 0 >> pRegExpr regex_'5c'2d'5c'2d'5c'2d'2e'2a'24 >>= withAttribute KeywordTok))@@ -110,7 +110,7 @@    <|>    ((pColumn 0 >> pAnyChar "-<" >>= withAttribute StringTok) >>~ pushContext ("Diff","Removed"))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","FindDiff")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","FindDiff") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","FindDiff")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","File") =   (((parseRules ("Diff","FindDiff")))@@ -123,7 +123,7 @@    <|>    ((pColumn 0 >> pDetectChar False '!' >>= withAttribute StringTok) >>~ pushContext ("Diff","ChangedOld"))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","File")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","File") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","File")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","Chunk") =   (((parseRules ("Diff","FindDiff")))@@ -132,7 +132,7 @@    <|>    ((pColumn 0 >> pDetectChar False '!' >>= withAttribute StringTok) >>~ pushContext ("Diff","ChangedOld"))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","Chunk")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","Chunk") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","Chunk")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","ChunkInFile") =   (((parseRules ("Diff","FindDiff")))@@ -145,7 +145,7 @@    <|>    ((pColumn 0 >> pDetectChar False '!' >>= withAttribute StringTok) >>~ pushContext ("Diff","ChangedOld"))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","ChunkInFile")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","ChunkInFile") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","ChunkInFile")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","RFile") =   (((pColumn 0 >> lookAhead (pRegExpr regex_'28diff'7cOnly_in_'2e'2a'3a'29'2e'2a'24) >> (popContext) >> currentContext >>= parseRules))@@ -156,7 +156,7 @@    <|>    ((parseRules ("Diff","File")))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","RFile")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","RFile") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","RFile")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","RChunk") =   (((pColumn 0 >> pRegExpr regex_'5c'2a'5c'2a'5c'2a_'2e'2a_'5c'2a'5c'2a'5c'2a'5c'2a'24 >>= withAttribute DataTypeTok))@@ -165,7 +165,7 @@    <|>    ((parseRules ("Diff","Chunk")))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","RChunk")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","RChunk") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","RChunk")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","RChunkInFile") =   (((pColumn 0 >> pRegExpr regex_'5c'2a'5c'2a'5c'2a_'2e'2a_'5c'2a'5c'2a'5c'2a'5c'2a'24 >>= withAttribute DataTypeTok))@@ -174,7 +174,7 @@    <|>    ((parseRules ("Diff","ChunkInFile")))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","RChunkInFile")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","RChunkInFile") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","RChunkInFile")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","RChunkNew") =   (((pColumn 0 >> lookAhead (pRegExpr regex_'28'5c'40'5c'40'7c'5cd'29'2e'2a'24) >> (popContext >> popContext) >> currentContext >>= parseRules))@@ -183,7 +183,7 @@    <|>    ((parseRules ("Diff","FindDiff")))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","RChunkNew")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","RChunkNew") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","RChunkNew")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","RChunkInFileNew") =   (((pColumn 0 >> lookAhead (pRegExpr regex_'28'5c'40'5c'40'7c'5cd'29'2e'2a'24) >> (popContext >> popContext) >> currentContext >>= parseRules))@@ -194,22 +194,22 @@    <|>    ((parseRules ("Diff","FindDiff")))    <|>-   (currentContext >>= \x -> guard (x == ("Diff","RChunkInFileNew")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","RChunkInFileNew") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Diff","RChunkInFileNew")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Diff","File") =-  (currentContext >>= \x -> guard (x == ("Diff","File")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","File") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Diff","File")) >> pDefault >>= withAttribute KeywordTok)  parseRules ("Diff","Removed") =-  (currentContext >>= \x -> guard (x == ("Diff","Removed")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","Removed") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Diff","Removed")) >> pDefault >>= withAttribute StringTok)  parseRules ("Diff","Added") =-  (currentContext >>= \x -> guard (x == ("Diff","Added")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","Added") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Diff","Added")) >> pDefault >>= withAttribute OtherTok)  parseRules ("Diff","ChangedOld") =-  (currentContext >>= \x -> guard (x == ("Diff","ChangedOld")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","ChangedOld") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Diff","ChangedOld")) >> pDefault >>= withAttribute StringTok)  parseRules ("Diff","ChangedNew") =-  (currentContext >>= \x -> guard (x == ("Diff","ChangedNew")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Diff","ChangedNew") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Diff","ChangedNew")) >> pDefault >>= withAttribute OtherTok)   parseRules x = parseRules ("Diff","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Djangotemplate.hs view
@@ -12,7 +12,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -45,47 +44,50 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Django HTML Template","Start") -> return ()-    ("Django HTML Template","In Block") -> return ()-    ("Django HTML Template","FindTemplate") -> return ()-    ("Django HTML Template","Template Comment") -> return ()-    ("Django HTML Template","Template Var") -> return ()-    ("Django HTML Template","Template Filter") -> return ()-    ("Django HTML Template","Template Tag") -> return ()-    ("Django HTML Template","Found Block Tag") -> return ()-    ("Django HTML Template","In Block Tag") -> return ()-    ("Django HTML Template","Non Matching Tag") -> return ()-    ("Django HTML Template","In Template Tag") -> return ()-    ("Django HTML Template","Single A-string") -> return ()-    ("Django HTML Template","Single Q-string") -> return ()-    ("Django HTML Template","FindHTML") -> return ()-    ("Django HTML Template","FindEntityRefs") -> return ()-    ("Django HTML Template","FindPEntityRefs") -> return ()-    ("Django HTML Template","FindAttributes") -> return ()-    ("Django HTML Template","FindDTDRules") -> return ()-    ("Django HTML Template","Comment") -> return ()-    ("Django HTML Template","CDATA") -> return ()-    ("Django HTML Template","PI") -> return ()-    ("Django HTML Template","Doctype") -> return ()-    ("Django HTML Template","Doctype Internal Subset") -> return ()-    ("Django HTML Template","Doctype Markupdecl") -> return ()-    ("Django HTML Template","Doctype Markupdecl DQ") -> return ()-    ("Django HTML Template","Doctype Markupdecl SQ") -> return ()-    ("Django HTML Template","El Open") -> return ()-    ("Django HTML Template","El Close") -> return ()-    ("Django HTML Template","El Close 2") -> return ()-    ("Django HTML Template","El Close 3") -> return ()-    ("Django HTML Template","CSS") -> return ()-    ("Django HTML Template","CSS content") -> return ()-    ("Django HTML Template","JS") -> return ()-    ("Django HTML Template","JS content") -> return ()-    ("Django HTML Template","JS comment close") -> (popContext) >> pEndLine-    ("Django HTML Template","Value") -> return ()-    ("Django HTML Template","Value NQ") -> (popContext >> popContext) >> pEndLine-    ("Django HTML Template","Value DQ") -> return ()-    ("Django HTML Template","Value SQ") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Django HTML Template","Start") -> return ()+      ("Django HTML Template","In Block") -> return ()+      ("Django HTML Template","FindTemplate") -> return ()+      ("Django HTML Template","Template Comment") -> return ()+      ("Django HTML Template","Template Var") -> return ()+      ("Django HTML Template","Template Filter") -> return ()+      ("Django HTML Template","Template Tag") -> return ()+      ("Django HTML Template","Found Block Tag") -> return ()+      ("Django HTML Template","In Block Tag") -> return ()+      ("Django HTML Template","Non Matching Tag") -> return ()+      ("Django HTML Template","In Template Tag") -> return ()+      ("Django HTML Template","Single A-string") -> return ()+      ("Django HTML Template","Single Q-string") -> return ()+      ("Django HTML Template","FindHTML") -> return ()+      ("Django HTML Template","FindEntityRefs") -> return ()+      ("Django HTML Template","FindPEntityRefs") -> return ()+      ("Django HTML Template","FindAttributes") -> return ()+      ("Django HTML Template","FindDTDRules") -> return ()+      ("Django HTML Template","Comment") -> return ()+      ("Django HTML Template","CDATA") -> return ()+      ("Django HTML Template","PI") -> return ()+      ("Django HTML Template","Doctype") -> return ()+      ("Django HTML Template","Doctype Internal Subset") -> return ()+      ("Django HTML Template","Doctype Markupdecl") -> return ()+      ("Django HTML Template","Doctype Markupdecl DQ") -> return ()+      ("Django HTML Template","Doctype Markupdecl SQ") -> return ()+      ("Django HTML Template","El Open") -> return ()+      ("Django HTML Template","El Close") -> return ()+      ("Django HTML Template","El Close 2") -> return ()+      ("Django HTML Template","El Close 3") -> return ()+      ("Django HTML Template","CSS") -> return ()+      ("Django HTML Template","CSS content") -> return ()+      ("Django HTML Template","JS") -> return ()+      ("Django HTML Template","JS content") -> return ()+      ("Django HTML Template","JS comment close") -> (popContext) >> pEndLine+      ("Django HTML Template","Value") -> return ()+      ("Django HTML Template","Value NQ") -> (popContext >> popContext) >> pEndLine+      ("Django HTML Template","Value DQ") -> return ()+      ("Django HTML Template","Value SQ") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -125,8 +127,6 @@ regex_'2f'28'3f'21'3e'29 = compileRegex "/(?!>)" regex_'5b'5e'2f'3e'3c'22'27'5cs'5d = compileRegex "[^/><\"'\\s]" -defaultAttributes = [(("Django HTML Template","Start"),NormalTok),(("Django HTML Template","In Block"),NormalTok),(("Django HTML Template","FindTemplate"),NormalTok),(("Django HTML Template","Template Comment"),CommentTok),(("Django HTML Template","Template Var"),FunctionTok),(("Django HTML Template","Template Filter"),OtherTok),(("Django HTML Template","Template Tag"),FunctionTok),(("Django HTML Template","Found Block Tag"),FunctionTok),(("Django HTML Template","In Block Tag"),FunctionTok),(("Django HTML Template","Non Matching Tag"),FunctionTok),(("Django HTML Template","In Template Tag"),FunctionTok),(("Django HTML Template","Single A-string"),StringTok),(("Django HTML Template","Single Q-string"),StringTok),(("Django HTML Template","FindHTML"),NormalTok),(("Django HTML Template","FindEntityRefs"),NormalTok),(("Django HTML Template","FindPEntityRefs"),NormalTok),(("Django HTML Template","FindAttributes"),NormalTok),(("Django HTML Template","FindDTDRules"),NormalTok),(("Django HTML Template","Comment"),CommentTok),(("Django HTML Template","CDATA"),NormalTok),(("Django HTML Template","PI"),NormalTok),(("Django HTML Template","Doctype"),NormalTok),(("Django HTML Template","Doctype Internal Subset"),NormalTok),(("Django HTML Template","Doctype Markupdecl"),NormalTok),(("Django HTML Template","Doctype Markupdecl DQ"),StringTok),(("Django HTML Template","Doctype Markupdecl SQ"),StringTok),(("Django HTML Template","El Open"),NormalTok),(("Django HTML Template","El Close"),NormalTok),(("Django HTML Template","El Close 2"),NormalTok),(("Django HTML Template","El Close 3"),NormalTok),(("Django HTML Template","CSS"),NormalTok),(("Django HTML Template","CSS content"),NormalTok),(("Django HTML Template","JS"),NormalTok),(("Django HTML Template","JS content"),NormalTok),(("Django HTML Template","JS comment close"),CommentTok),(("Django HTML Template","Value"),NormalTok),(("Django HTML Template","Value NQ"),NormalTok),(("Django HTML Template","Value DQ"),StringTok),(("Django HTML Template","Value SQ"),StringTok)]- parseRules ("Django HTML Template","Start") =   (((pRegExpr regex_'5c'7b'25'5cs'2aend'5ba'2dz'5d'2b'5cs'2a'25'5c'7d >>= withAttribute ErrorTok))    <|>@@ -134,7 +134,7 @@    <|>    ((parseRules ("Django HTML Template","FindHTML")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","In Block") =   (((lookAhead (pRegExpr regex_'5c'7b'25'5cs'2aend'5ba'2dz'5d'2b'5cs'2a'25'5c'7d) >> (popContext) >> currentContext >>= parseRules))@@ -143,7 +143,7 @@    <|>    ((parseRules ("Django HTML Template","FindHTML")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","In Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","FindTemplate") =   (((pRegExpr regex_'5c'7b'25'5cs'2acomment'5cs'2a'25'5c'7d >>= withAttribute CommentTok) >>~ pushContext ("Django HTML Template","Template Comment"))@@ -152,12 +152,12 @@    <|>    ((pDetect2Chars False '{' '%' >>= withAttribute FunctionTok) >>~ pushContext ("Django HTML Template","Template Tag"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindTemplate")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindTemplate") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindTemplate")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Template Comment") =   (((pRegExpr regex_'5c'7b'25'5cs'2aendcomment'5cs'2a'25'5c'7d >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Template Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Django HTML Template","Template Var") =   (((pDetect2Chars False '}' '}' >>= withAttribute FunctionTok) >>~ (popContext))@@ -170,7 +170,7 @@    <|>    ((pDetect2Chars False '%' '}' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Var")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Template Var") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Var")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","Template Filter") =   (((pDetect2Chars False '}' '}' >>= withAttribute FunctionTok) >>~ (popContext >> popContext))@@ -185,19 +185,19 @@    <|>    ((pDetect2Chars False '%' '}' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Filter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Template Filter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Filter")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Django HTML Template","Template Tag") =   (((lookAhead (pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_blocktags) >> pushContext ("Django HTML Template","Found Block Tag") >> currentContext >>= parseRules))    <|>    ((pDetectIdentifier >>= withAttribute FunctionTok) >>~ pushContext ("Django HTML Template","In Template Tag"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Template Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Template Tag")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","Found Block Tag") =   (((pRegExpr regex_'28'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29 >>= withAttribute FunctionTok) >>~ pushContext ("Django HTML Template","In Block Tag"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Found Block Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Found Block Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Found Block Tag")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","In Block Tag") =   (((pRegExprDynamic "\\{%\\s*end%1\\s*%\\}" >>= withAttribute FunctionTok) >>~ (popContext >> popContext >> popContext))@@ -208,14 +208,14 @@    <|>    ((parseRules ("Django HTML Template","In Template Tag")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Block Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","In Block Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Block Tag")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","Non Matching Tag") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_endblocktags >>= withAttribute ErrorTok) >>~ (popContext))    <|>    ((pDetectIdentifier >>= withAttribute FunctionTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Non Matching Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Non Matching Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Non Matching Tag")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","In Template Tag") =   (((pDetect2Chars False '%' '}' >>= withAttribute FunctionTok) >>~ (popContext >> popContext))@@ -230,21 +230,21 @@    <|>    ((pDetect2Chars False '}' '}' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Template Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","In Template Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","In Template Tag")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Django HTML Template","Single A-string") =   (((pHlCStringChar >>= withAttribute StringTok))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Single A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Single A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Single A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Django HTML Template","Single Q-string") =   (((pHlCStringChar >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Single Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Single Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Single Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Django HTML Template","FindHTML") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -283,14 +283,14 @@    <|>    ((parseRules ("Django HTML Template","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindHTML")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindHTML") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindHTML")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","FindEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>    ((pAnyChar "&<" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -299,7 +299,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","FindAttributes") =   (((pColumn 0 >> pRegExpr regex_'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a >>= withAttribute OtherTok))@@ -308,12 +308,12 @@    <|>    ((pDetectChar False '=' >>= withAttribute OtherTok) >>~ pushContext ("Django HTML Template","Value"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindAttributes")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindAttributes") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindAttributes")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","FindDTDRules") =   (((pRegExpr regex_'3c'21'28ELEMENT'7cENTITY'7cATTLIST'7cNOTATION'29'5cb >>= withAttribute DataTypeTok) >>~ pushContext ("Django HTML Template","Doctype Markupdecl"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindDTDRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","FindDTDRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","FindDTDRules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -328,7 +328,7 @@    <|>    ((pRegExpr regex_'2d'28'2d'28'3f'21'2d'3e'29'29'2b >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Django HTML Template","CDATA") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -339,19 +339,19 @@    <|>    ((pString False "]]&gt;" >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("Django HTML Template","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -364,7 +364,7 @@    <|>    ((parseRules ("Django HTML Template","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -373,21 +373,21 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("Django HTML Template","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","Doctype Markupdecl DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("Django HTML Template","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Django HTML Template","Doctype Markupdecl SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("Django HTML Template","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Django HTML Template","El Open") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -400,28 +400,28 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Open")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","El Open") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Open")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","El Close") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","El Close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","El Close 2") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","El Close 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close 2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","El Close 3") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close 3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","El Close 3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","El Close 3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","CSS") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -434,7 +434,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","CSS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","CSS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","CSS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","CSS content") =   (((pRegExpr regex_'3c'2fstyle'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Django HTML Template","El Close 2"))@@ -443,7 +443,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Css.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","CSS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","CSS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","CSS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","JS") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -456,7 +456,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","JS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","JS content") =   (((pRegExpr regex_'3c'2fscript'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Django HTML Template","El Close 2"))@@ -467,7 +467,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","JS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Django HTML Template","JS comment close") =   (((pRegExpr regex_'3c'2fscript'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Django HTML Template","El Close 3"))@@ -476,7 +476,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS comment close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","JS comment close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","JS comment close")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Django HTML Template","Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Django HTML Template","Value DQ"))@@ -505,7 +505,7 @@    <|>    ((parseRules ("Django HTML Template","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Value DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Value DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Value DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Django HTML Template","Value SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))@@ -514,7 +514,7 @@    <|>    ((parseRules ("Django HTML Template","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Django HTML Template","Value SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Django HTML Template","Value SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Django HTML Template","Value SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression
Text/Highlighting/Kate/Syntax/Doxygen.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,40 +42,43 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Doxygen","Normal") -> return ()-    ("Doxygen","LineComment") -> (popContext) >> pEndLine-    ("Doxygen","BlockComment") -> return ()-    ("Doxygen","ML_TagWord") -> (popContext) >> pEndLine-    ("Doxygen","ML_TagParam") -> (popContext) >> pEndLine-    ("Doxygen","ML_TagWordWord") -> (popContext) >> pEndLine-    ("Doxygen","ML_Tag2ndWord") -> (popContext >> popContext) >> pEndLine-    ("Doxygen","ML_TagString") -> (popContext) >> pEndLine-    ("Doxygen","ML_TagWordString") -> (popContext) >> pEndLine-    ("Doxygen","ML_htmltag") -> return ()-    ("Doxygen","ML_htmlcomment") -> return ()-    ("Doxygen","ML_identifiers") -> return ()-    ("Doxygen","ML_types1") -> return ()-    ("Doxygen","ML_types2") -> return ()-    ("Doxygen","SL_TagWord") -> (popContext) >> pEndLine-    ("Doxygen","SL_TagParam") -> (popContext) >> pEndLine-    ("Doxygen","SL_TagWordWord") -> (popContext) >> pEndLine-    ("Doxygen","SL_Tag2ndWord") -> (popContext >> popContext) >> pEndLine-    ("Doxygen","SL_TagString") -> (popContext) >> pEndLine-    ("Doxygen","SL_TagWordString") -> (popContext) >> pEndLine-    ("Doxygen","SL_htmltag") -> (popContext) >> pEndLine-    ("Doxygen","SL_htmlcomment") -> (popContext) >> pEndLine-    ("Doxygen","SL_identifiers") -> (popContext) >> pEndLine-    ("Doxygen","SL_types1") -> (popContext) >> pEndLine-    ("Doxygen","SL_types2") -> (popContext) >> pEndLine-    ("Doxygen","SL_DetectEnv") -> (popContext) >> pEndLine-    ("Doxygen","SL_DetectComment") -> (popContext) >> pEndLine-    ("Doxygen","Code") -> return ()-    ("Doxygen","Verbatim") -> return ()-    ("Doxygen","Formula") -> return ()-    ("Doxygen","Msc") -> return ()-    ("Doxygen","Dot") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Doxygen","Normal") -> return ()+      ("Doxygen","LineComment") -> (popContext) >> pEndLine+      ("Doxygen","BlockComment") -> return ()+      ("Doxygen","ML_TagWord") -> (popContext) >> pEndLine+      ("Doxygen","ML_TagParam") -> (popContext) >> pEndLine+      ("Doxygen","ML_TagWordWord") -> (popContext) >> pEndLine+      ("Doxygen","ML_Tag2ndWord") -> (popContext >> popContext) >> pEndLine+      ("Doxygen","ML_TagString") -> (popContext) >> pEndLine+      ("Doxygen","ML_TagWordString") -> (popContext) >> pEndLine+      ("Doxygen","ML_htmltag") -> return ()+      ("Doxygen","ML_htmlcomment") -> return ()+      ("Doxygen","ML_identifiers") -> return ()+      ("Doxygen","ML_types1") -> return ()+      ("Doxygen","ML_types2") -> return ()+      ("Doxygen","SL_TagWord") -> (popContext) >> pEndLine+      ("Doxygen","SL_TagParam") -> (popContext) >> pEndLine+      ("Doxygen","SL_TagWordWord") -> (popContext) >> pEndLine+      ("Doxygen","SL_Tag2ndWord") -> (popContext >> popContext) >> pEndLine+      ("Doxygen","SL_TagString") -> (popContext) >> pEndLine+      ("Doxygen","SL_TagWordString") -> (popContext) >> pEndLine+      ("Doxygen","SL_htmltag") -> (popContext) >> pEndLine+      ("Doxygen","SL_htmlcomment") -> (popContext) >> pEndLine+      ("Doxygen","SL_identifiers") -> (popContext) >> pEndLine+      ("Doxygen","SL_types1") -> (popContext) >> pEndLine+      ("Doxygen","SL_types2") -> (popContext) >> pEndLine+      ("Doxygen","SL_DetectEnv") -> (popContext) >> pEndLine+      ("Doxygen","SL_DetectComment") -> (popContext) >> pEndLine+      ("Doxygen","Code") -> return ()+      ("Doxygen","Verbatim") -> return ()+      ("Doxygen","Formula") -> return ()+      ("Doxygen","Msc") -> return ()+      ("Doxygen","Dot") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -121,8 +123,6 @@ regex_'5b'40'5c'5c'5dendmsc'5cb = compileRegex "[@\\\\]endmsc\\b" regex_'5b'40'5c'5c'5denddot'5cb = compileRegex "[@\\\\]enddot\\b" -defaultAttributes = [(("Doxygen","Normal"),NormalTok),(("Doxygen","LineComment"),CommentTok),(("Doxygen","BlockComment"),CommentTok),(("Doxygen","ML_TagWord"),CommentTok),(("Doxygen","ML_TagParam"),CommentTok),(("Doxygen","ML_TagWordWord"),CommentTok),(("Doxygen","ML_Tag2ndWord"),CommentTok),(("Doxygen","ML_TagString"),CommentTok),(("Doxygen","ML_TagWordString"),CommentTok),(("Doxygen","ML_htmltag"),OtherTok),(("Doxygen","ML_htmlcomment"),CommentTok),(("Doxygen","ML_identifiers"),OtherTok),(("Doxygen","ML_types1"),DataTypeTok),(("Doxygen","ML_types2"),DataTypeTok),(("Doxygen","SL_TagWord"),CommentTok),(("Doxygen","SL_TagParam"),CommentTok),(("Doxygen","SL_TagWordWord"),CommentTok),(("Doxygen","SL_Tag2ndWord"),CommentTok),(("Doxygen","SL_TagString"),CommentTok),(("Doxygen","SL_TagWordString"),CommentTok),(("Doxygen","SL_htmltag"),OtherTok),(("Doxygen","SL_htmlcomment"),CommentTok),(("Doxygen","SL_identifiers"),OtherTok),(("Doxygen","SL_types1"),DataTypeTok),(("Doxygen","SL_types2"),DataTypeTok),(("Doxygen","SL_DetectEnv"),CommentTok),(("Doxygen","SL_DetectComment"),CommentTok),(("Doxygen","Code"),CommentTok),(("Doxygen","Verbatim"),CommentTok),(("Doxygen","Formula"),CommentTok),(("Doxygen","Msc"),CommentTok),(("Doxygen","Dot"),CommentTok)]- parseRules ("Doxygen","Normal") =   (((pRegExpr regex_'2f'2f'28'21'7c'28'2f'28'3f'3d'5b'5e'2f'5d'7c'24'29'29'29'3c'3f >>= withAttribute CommentTok) >>~ pushContext ("Doxygen","LineComment"))    <|>@@ -136,7 +136,7 @@    <|>    ((pRegExpr regex_'2f'5c'2a'5cs'2a'40'5c'7d'5cs'2a'5c'2a'2f >>= withAttribute RegionMarkerTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Doxygen","LineComment") =   (((pLineContinue >>= withAttribute CommentTok))@@ -169,7 +169,7 @@    <|>    ((pRegExpr regex_'3c'5c'2f'3f'5ba'2dzA'2dZ'5f'3a'5d'5ba'2dzA'2dZ0'2d9'2e'5f'3a'2d'5d'2a >>= withAttribute KeywordTok) >>~ pushContext ("Doxygen","SL_htmltag"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","LineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","LineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","LineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","BlockComment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -208,14 +208,14 @@    <|>    ((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("Doxygen","ML_htmlcomment"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","BlockComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","BlockComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","BlockComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_TagWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("Doxygen","SL_TagWord")))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_TagWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_TagParam") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -232,7 +232,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_TagParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagParam")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_TagWordWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -243,14 +243,14 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWordWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_TagWordWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWordWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_Tag2ndWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext >> popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("Doxygen","SL_Tag2ndWord")))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_Tag2ndWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_Tag2ndWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_Tag2ndWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_TagString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -265,14 +265,14 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_TagString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_TagWordString") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("Doxygen","SL_TagWordString")))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWordString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_TagWordString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_TagWordString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_htmltag") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -283,7 +283,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("Doxygen","ML_identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_htmltag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_htmltag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_htmltag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Doxygen","ML_htmlcomment") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -292,7 +292,7 @@    <|>    ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_htmlcomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_htmlcomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_htmlcomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","ML_identifiers") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -303,21 +303,21 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("Doxygen","ML_types2"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_identifiers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_identifiers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_identifiers")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Doxygen","ML_types1") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_types1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_types1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_types1")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Doxygen","ML_types2") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","ML_types2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","ML_types2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","ML_types2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Doxygen","SL_TagWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -328,7 +328,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_TagWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_TagParam") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -343,7 +343,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_TagParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagParam")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_TagWordWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -352,7 +352,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWordWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_TagWordWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWordWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_Tag2ndWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -361,7 +361,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_Tag2ndWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_Tag2ndWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_Tag2ndWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_TagString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -374,7 +374,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_TagString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_TagWordString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -383,7 +383,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWordString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_TagWordString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_TagWordString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_htmltag") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -392,14 +392,14 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("Doxygen","SL_identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_htmltag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_htmltag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_htmltag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Doxygen","SL_htmlcomment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_htmlcomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_htmlcomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_htmlcomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_identifiers") =   (((pRegExpr regex_'5cs'2a'23'3f'5ba'2dzA'2dZ0'2d9'5d'2a >>= withAttribute NormalTok) >>~ (popContext))@@ -408,17 +408,17 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("Doxygen","SL_types2"))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_identifiers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_identifiers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_identifiers")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Doxygen","SL_types1") =   (((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_types1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_types1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_types1")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Doxygen","SL_types2") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_types2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_types2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_types2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Doxygen","SL_DetectEnv") =   (((pRegExpr regex_'5b'40'5c'5c'5dcode'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Doxygen","Code"))@@ -441,7 +441,7 @@    <|>    ((pRegExpr regex_'26'5bA'2dZa'2dz'5d'2b'3b >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_DetectEnv")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_DetectEnv") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_DetectEnv")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","SL_DetectComment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext))@@ -450,42 +450,42 @@    <|>    ((pString False "///" >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","SL_DetectComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","SL_DetectComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","SL_DetectComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","Code") =   (((parseRules ("Doxygen","SL_DetectComment")))    <|>    ((pRegExpr regex_'5b'40'5c'5c'5dendcode'5cb >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Code")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Code") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Code")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","Verbatim") =   (((parseRules ("Doxygen","SL_DetectComment")))    <|>    ((pRegExpr regex_'5b'40'5c'5c'5dendverbatim'5cb >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Verbatim")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Verbatim") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Verbatim")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","Formula") =   (((parseRules ("Doxygen","SL_DetectComment")))    <|>    ((pRegExpr regex_'5b'40'5c'5c'5df'5c'5d >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Formula")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Formula") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Formula")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","Msc") =   (((parseRules ("Doxygen","SL_DetectComment")))    <|>    ((pRegExpr regex_'5b'40'5c'5c'5dendmsc'5cb >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Msc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Msc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Msc")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen","Dot") =   (((parseRules ("Doxygen","SL_DetectComment")))    <|>    ((pRegExpr regex_'5b'40'5c'5c'5denddot'5cb >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Doxygen","Dot")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Doxygen","Dot") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Doxygen","Dot")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Doxygenlua.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,33 +42,36 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("DoxygenLua","Normal") -> return ()-    ("DoxygenLua","LineComment") -> (popContext) >> pEndLine-    ("DoxygenLua","BlockComment") -> return ()-    ("DoxygenLua","ML_TagWord") -> (popContext) >> pEndLine-    ("DoxygenLua","ML_TagParam") -> (popContext) >> pEndLine-    ("DoxygenLua","ML_TagWordWord") -> (popContext) >> pEndLine-    ("DoxygenLua","ML_Tag2ndWord") -> (popContext >> popContext) >> pEndLine-    ("DoxygenLua","ML_TagString") -> (popContext) >> pEndLine-    ("DoxygenLua","ML_TagWordString") -> (popContext) >> pEndLine-    ("DoxygenLua","ML_htmltag") -> return ()-    ("DoxygenLua","ML_htmlcomment") -> return ()-    ("DoxygenLua","ML_identifiers") -> return ()-    ("DoxygenLua","ML_types1") -> return ()-    ("DoxygenLua","ML_types2") -> return ()-    ("DoxygenLua","SL_TagWord") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_TagParam") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_TagWordWord") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_Tag2ndWord") -> (popContext >> popContext) >> pEndLine-    ("DoxygenLua","SL_TagString") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_TagWordString") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_htmltag") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_htmlcomment") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_identifiers") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_types1") -> (popContext) >> pEndLine-    ("DoxygenLua","SL_types2") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("DoxygenLua","Normal") -> return ()+      ("DoxygenLua","LineComment") -> (popContext) >> pEndLine+      ("DoxygenLua","BlockComment") -> return ()+      ("DoxygenLua","ML_TagWord") -> (popContext) >> pEndLine+      ("DoxygenLua","ML_TagParam") -> (popContext) >> pEndLine+      ("DoxygenLua","ML_TagWordWord") -> (popContext) >> pEndLine+      ("DoxygenLua","ML_Tag2ndWord") -> (popContext >> popContext) >> pEndLine+      ("DoxygenLua","ML_TagString") -> (popContext) >> pEndLine+      ("DoxygenLua","ML_TagWordString") -> (popContext) >> pEndLine+      ("DoxygenLua","ML_htmltag") -> return ()+      ("DoxygenLua","ML_htmlcomment") -> return ()+      ("DoxygenLua","ML_identifiers") -> return ()+      ("DoxygenLua","ML_types1") -> return ()+      ("DoxygenLua","ML_types2") -> return ()+      ("DoxygenLua","SL_TagWord") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_TagParam") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_TagWordWord") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_Tag2ndWord") -> (popContext >> popContext) >> pEndLine+      ("DoxygenLua","SL_TagString") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_TagWordString") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_htmltag") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_htmlcomment") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_identifiers") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_types1") -> (popContext) >> pEndLine+      ("DoxygenLua","SL_types2") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -92,14 +94,12 @@ regex_'5cs'2a'3d'5cs'2a = compileRegex "\\s*=\\s*" regex_'5cs'2a'23'3f'5ba'2dzA'2dZ0'2d9'5d'2a = compileRegex "\\s*#?[a-zA-Z0-9]*" -defaultAttributes = [(("DoxygenLua","Normal"),NormalTok),(("DoxygenLua","LineComment"),CommentTok),(("DoxygenLua","BlockComment"),CommentTok),(("DoxygenLua","ML_TagWord"),CommentTok),(("DoxygenLua","ML_TagParam"),CommentTok),(("DoxygenLua","ML_TagWordWord"),CommentTok),(("DoxygenLua","ML_Tag2ndWord"),CommentTok),(("DoxygenLua","ML_TagString"),CommentTok),(("DoxygenLua","ML_TagWordString"),CommentTok),(("DoxygenLua","ML_htmltag"),OtherTok),(("DoxygenLua","ML_htmlcomment"),CommentTok),(("DoxygenLua","ML_identifiers"),OtherTok),(("DoxygenLua","ML_types1"),DataTypeTok),(("DoxygenLua","ML_types2"),DataTypeTok),(("DoxygenLua","SL_TagWord"),CommentTok),(("DoxygenLua","SL_TagParam"),CommentTok),(("DoxygenLua","SL_TagWordWord"),CommentTok),(("DoxygenLua","SL_Tag2ndWord"),CommentTok),(("DoxygenLua","SL_TagString"),CommentTok),(("DoxygenLua","SL_TagWordString"),CommentTok),(("DoxygenLua","SL_htmltag"),OtherTok),(("DoxygenLua","SL_htmlcomment"),CommentTok),(("DoxygenLua","SL_identifiers"),OtherTok),(("DoxygenLua","SL_types1"),DataTypeTok),(("DoxygenLua","SL_types2"),DataTypeTok)]- parseRules ("DoxygenLua","Normal") =   (((pRegExprDynamic "--\\[(=*)\\[" >>= withAttribute CommentTok) >>~ pushContext ("DoxygenLua","BlockComment"))    <|>    ((pString False "--" >>= withAttribute CommentTok) >>~ pushContext ("DoxygenLua","LineComment"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("DoxygenLua","LineComment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -126,7 +126,7 @@    <|>    ((pRegExpr regex_'3c'5cs'2a'5c'2f'3f'5cs'2a'5ba'2dzA'2dZ'5f'3a'5d'5ba'2dzA'2dZ0'2d9'2e'5f'3a'2d'5d'2a >>= withAttribute KeywordTok) >>~ pushContext ("DoxygenLua","SL_htmltag"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","LineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","LineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","LineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","BlockComment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -161,14 +161,14 @@    <|>    ((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("DoxygenLua","ML_htmlcomment"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","BlockComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","BlockComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","BlockComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_TagWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("DoxygenLua","SL_TagWord")))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_TagWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_TagParam") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -185,7 +185,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_TagParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagParam")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_TagWordWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -196,14 +196,14 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWordWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_TagWordWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWordWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_Tag2ndWord") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext >> popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("DoxygenLua","SL_Tag2ndWord")))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_Tag2ndWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_Tag2ndWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_Tag2ndWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_TagString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -218,14 +218,14 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_TagString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_TagWordString") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("DoxygenLua","SL_TagWordString")))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWordString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_TagWordString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_TagWordString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_htmltag") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -236,7 +236,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("DoxygenLua","ML_identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_htmltag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_htmltag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_htmltag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("DoxygenLua","ML_htmlcomment") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -245,7 +245,7 @@    <|>    ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_htmlcomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_htmlcomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_htmlcomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","ML_identifiers") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))@@ -256,21 +256,21 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("DoxygenLua","ML_types2"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_identifiers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_identifiers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_identifiers")) >> pDefault >>= withAttribute OtherTok))  parseRules ("DoxygenLua","ML_types1") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_types1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_types1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_types1")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("DoxygenLua","ML_types2") =   (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules))    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_types2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","ML_types2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","ML_types2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("DoxygenLua","SL_TagWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -281,7 +281,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_TagWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_TagParam") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -296,7 +296,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_TagParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagParam")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_TagWordWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -305,7 +305,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWordWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_TagWordWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWordWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_Tag2ndWord") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -314,7 +314,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_Tag2ndWord")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_Tag2ndWord") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_Tag2ndWord")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_TagString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -327,7 +327,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_TagString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_TagWordString") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -336,7 +336,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWordString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_TagWordString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_TagWordString")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_htmltag") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -345,14 +345,14 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("DoxygenLua","SL_identifiers"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_htmltag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_htmltag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_htmltag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("DoxygenLua","SL_htmlcomment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_htmlcomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_htmlcomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_htmlcomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DoxygenLua","SL_identifiers") =   (((pRegExpr regex_'5cs'2a'23'3f'5ba'2dzA'2dZ0'2d9'5d'2a >>= withAttribute NormalTok) >>~ (popContext))@@ -361,17 +361,17 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("DoxygenLua","SL_types2"))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_identifiers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_identifiers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_identifiers")) >> pDefault >>= withAttribute OtherTok))  parseRules ("DoxygenLua","SL_types1") =   (((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_types1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_types1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_types1")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("DoxygenLua","SL_types2") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_types2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DoxygenLua","SL_types2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_types2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Dtd.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,14 +42,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("DTD","Normal") -> return ()-    ("DTD","Comment") -> return ()-    ("DTD","PI") -> return ()-    ("DTD","Declaration") -> return ()-    ("DTD","String") -> return ()-    ("DTD","InlineComment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("DTD","Normal") -> return ()+      ("DTD","Comment") -> return ()+      ("DTD","PI") -> return ()+      ("DTD","Declaration") -> return ()+      ("DTD","String") -> return ()+      ("DTD","InlineComment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -67,8 +69,6 @@ regex_'5cb'5b'5c'2d'5cw'5cd'5c'2e'3a'5f'5d'2b'5cb = compileRegex "\\b[\\-\\w\\d\\.:_]+\\b" regex_'25'5b'5c'2d'5cw'5cd'5c'2e'3a'5f'5d'2b'3b = compileRegex "%[\\-\\w\\d\\.:_]+;" -defaultAttributes = [(("DTD","Normal"),NormalTok),(("DTD","Comment"),CommentTok),(("DTD","PI"),NormalTok),(("DTD","Declaration"),NormalTok),(("DTD","String"),StringTok),(("DTD","InlineComment"),CommentTok)]- parseRules ("DTD","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -86,7 +86,7 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("DTD","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -97,12 +97,12 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("DTD","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("DTD","Declaration") =   (((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("DTD","Comment"))@@ -129,7 +129,7 @@    <|>    ((pRegExpr regex_'5cb'5b'5c'2d'5cw'5cd'5c'2e'3a'5f'5d'2b'5cb >>= withAttribute FunctionTok))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","Declaration")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","Declaration") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","Declaration")) >> pDefault >>= withAttribute NormalTok))  parseRules ("DTD","String") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -138,7 +138,7 @@    <|>    ((pRegExpr regex_'25'5b'5c'2d'5cw'5cd'5c'2e'3a'5f'5d'2b'3b >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("DTD","InlineComment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -149,7 +149,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("DTD","InlineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("DTD","InlineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("DTD","InlineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Eiffel.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,11 +41,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Eiffel","Normal") -> return ()-    ("Eiffel","Quoted String") -> (popContext) >> pEndLine-    ("Eiffel","Documentation") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Eiffel","Normal") -> return ()+      ("Eiffel","Quoted String") -> (popContext) >> pEndLine+      ("Eiffel","Documentation") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -59,8 +61,6 @@ list_assertions = Set.fromList $ words $ "check ensure require variant invariant"  -defaultAttributes = [(("Eiffel","Normal"),NormalTok),(("Eiffel","Quoted String"),StringTok),(("Eiffel","Documentation"),CommentTok)]- parseRules ("Eiffel","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -78,15 +78,15 @@    <|>    ((pDetect2Chars False '-' '-' >>= withAttribute CommentTok) >>~ pushContext ("Eiffel","Documentation"))    <|>-   (currentContext >>= \x -> guard (x == ("Eiffel","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Eiffel","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Eiffel","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Eiffel","Quoted String") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Eiffel","Quoted String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Eiffel","Quoted String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Eiffel","Quoted String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Eiffel","Documentation") =-  (currentContext >>= \x -> guard (x == ("Eiffel","Documentation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Eiffel","Documentation") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Eiffel","Documentation")) >> pDefault >>= withAttribute CommentTok)   parseRules x = parseRules ("Eiffel","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Email.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,9 +40,12 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Email","headder") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Email","headder") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -109,8 +111,6 @@ regex_'5bA'2dZa'2dz0'2d9'2b'3d'2f'5d'2b'3d'24 = compileRegex "[A-Za-z0-9+=/]+=$" regex_'28'2d_'29'3f'2d'2d'28'2d'2d'2e'2a'29'3f = compileRegex "(- )?--(--.*)?" -defaultAttributes = [(("Email","headder"),NormalTok)]- parseRules ("Email","headder") =   (((pColumn 0 >> pRegExpr regex_'5bTt'5do'3a'2e'2a'24 >>= withAttribute AlertTok))    <|>@@ -228,7 +228,7 @@    <|>    ((pColumn 0 >> pRegExpr regex_'28'2d_'29'3f'2d'2d'28'2d'2d'2e'2a'29'3f >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Email","headder")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Email","headder") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Email","headder")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Email","headder") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Erlang.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,13 +42,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Erlang","Normal Text") -> (popContext) >> pEndLine-    ("Erlang","isfunction") -> (popContext) >> pEndLine-    ("Erlang","atomquote") -> (popContext) >> pEndLine-    ("Erlang","stringquote") -> (popContext) >> pEndLine-    ("Erlang","comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Erlang","Normal Text") -> (popContext) >> pEndLine+      ("Erlang","isfunction") -> (popContext) >> pEndLine+      ("Erlang","atomquote") -> (popContext) >> pEndLine+      ("Erlang","stringquote") -> (popContext) >> pEndLine+      ("Erlang","comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -75,8 +77,6 @@ regex_'28'3f'3a'28'3f'3a'5c'5c'27'29'3f'5b'5e'27'5d'2a'29'2a'27 = compileRegex "(?:(?:\\\\')?[^']*)*'" regex_'28'3f'3a'28'3f'3a'5c'5c'22'29'3f'5b'5e'22'5d'2a'29'2a'22 = compileRegex "(?:(?:\\\\\")?[^\"]*)*\"" -defaultAttributes = [(("Erlang","Normal Text"),NormalTok),(("Erlang","isfunction"),FunctionTok),(("Erlang","atomquote"),CharTok),(("Erlang","stringquote"),StringTok),(("Erlang","comment"),CommentTok)]- parseRules ("Erlang","Normal Text") =   (((pColumn 0 >> pRegExpr regex_'28'3f'3a'2dmodule'7c'2dexport'7c'2ddefine'7c'2dundef'7c'2difdef'7c'2difndef'7c'2delse'7c'2dendif'7c'2dinclude'7c'2dinclude'5flib'29 >>= withAttribute KeywordTok))    <|>@@ -114,22 +114,22 @@    <|>    ((pRegExpr regex_'5b0'2d9'5d'2b >>= withAttribute DecValTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Erlang","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Erlang","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Erlang","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Erlang","isfunction") =   (((pRegExpr regex_'5cb'5ba'2dz'5d'5b'5fa'2dz'40'2dZ0'2d9'5d'2a'28'3f'3a'28'3f'3d'5b'5e'5fa'2dz'40'2dZ0'2d9'5d'29'7c'24'29 >>= withAttribute FunctionTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Erlang","isfunction")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Erlang","isfunction") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Erlang","isfunction")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Erlang","atomquote") =   (((pRegExpr regex_'28'3f'3a'28'3f'3a'5c'5c'27'29'3f'5b'5e'27'5d'2a'29'2a'27 >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Erlang","atomquote")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Erlang","atomquote") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Erlang","atomquote")) >> pDefault >>= withAttribute CharTok))  parseRules ("Erlang","stringquote") =   (((pRegExpr regex_'28'3f'3a'28'3f'3a'5c'5c'22'29'3f'5b'5e'22'5d'2a'29'2a'22 >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Erlang","stringquote")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Erlang","stringquote") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Erlang","stringquote")) >> pDefault >>= withAttribute StringTok))  parseRules ("Erlang","comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -138,7 +138,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Erlang","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Erlang","comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Erlang","comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Fortran.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,28 +41,31 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Fortran","default") -> return ()-    ("Fortran","find_preprocessor") -> return ()-    ("Fortran","find_op_and_log") -> return ()-    ("Fortran","find_comments") -> return ()-    ("Fortran","find_symbols") -> return ()-    ("Fortran","inside_func_paren") -> return ()-    ("Fortran","find_io_stmnts") -> return ()-    ("Fortran","find_io_paren") -> return ()-    ("Fortran","format_stmnt") -> return ()-    ("Fortran","find_begin_stmnts") -> return ()-    ("Fortran","find_end_stmnts") -> return ()-    ("Fortran","find_mid_stmnts") -> return ()-    ("Fortran","find_decls") -> return ()-    ("Fortran","find_paren") -> (popContext) >> pEndLine-    ("Fortran","find_intrinsics") -> return ()-    ("Fortran","find_numbers") -> return ()-    ("Fortran","find_strings") -> return ()-    ("Fortran","string_1") -> return ()-    ("Fortran","string_2") -> return ()-    ("Fortran","end_of_string") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Fortran","default") -> return ()+      ("Fortran","find_preprocessor") -> return ()+      ("Fortran","find_op_and_log") -> return ()+      ("Fortran","find_comments") -> return ()+      ("Fortran","find_symbols") -> return ()+      ("Fortran","inside_func_paren") -> return ()+      ("Fortran","find_io_stmnts") -> return ()+      ("Fortran","find_io_paren") -> return ()+      ("Fortran","format_stmnt") -> return ()+      ("Fortran","find_begin_stmnts") -> return ()+      ("Fortran","find_end_stmnts") -> return ()+      ("Fortran","find_mid_stmnts") -> return ()+      ("Fortran","find_decls") -> return ()+      ("Fortran","find_paren") -> (popContext) >> pEndLine+      ("Fortran","find_intrinsics") -> return ()+      ("Fortran","find_numbers") -> return ()+      ("Fortran","find_strings") -> return ()+      ("Fortran","string_1") -> return ()+      ("Fortran","string_2") -> return ()+      ("Fortran","end_of_string") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -127,8 +129,6 @@ regex_'5b'5e'22'5d'2a'22 = compileRegex "[^\"]*\"" regex_'28'21'2e'2a'29'3f'24 = compileRegex "(!.*)?$" -defaultAttributes = [(("Fortran","default"),NormalTok),(("Fortran","find_preprocessor"),NormalTok),(("Fortran","find_op_and_log"),NormalTok),(("Fortran","find_comments"),NormalTok),(("Fortran","find_symbols"),NormalTok),(("Fortran","inside_func_paren"),NormalTok),(("Fortran","find_io_stmnts"),NormalTok),(("Fortran","find_io_paren"),NormalTok),(("Fortran","format_stmnt"),NormalTok),(("Fortran","find_begin_stmnts"),NormalTok),(("Fortran","find_end_stmnts"),NormalTok),(("Fortran","find_mid_stmnts"),NormalTok),(("Fortran","find_decls"),NormalTok),(("Fortran","find_paren"),DataTypeTok),(("Fortran","find_intrinsics"),NormalTok),(("Fortran","find_numbers"),NormalTok),(("Fortran","find_strings"),StringTok),(("Fortran","string_1"),StringTok),(("Fortran","string_2"),StringTok),(("Fortran","end_of_string"),StringTok)]- parseRules ("Fortran","default") =   (((parseRules ("Fortran","find_strings")))    <|>@@ -154,12 +154,12 @@    <|>    ((parseRules ("Fortran","find_mid_stmnts")))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_preprocessor") =   (((pColumn 0 >> pRegExpr regex_'28'23'7ccDEC'5c'24'7cCDEC'5c'24'29'2e'2a'24 >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_preprocessor")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_op_and_log") =   (((pRegExpr regex_'5c'2e'28true'7cfalse'29'5c'2e >>= withAttribute OtherTok))@@ -168,14 +168,14 @@    <|>    ((pRegExpr regex_'28'3d'3d'7c'2f'3d'7c'3c'7c'3c'3d'7c'3e'7c'3e'3d'29 >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_op_and_log")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_op_and_log") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_op_and_log")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_comments") =   (((pColumn 0 >> pRegExpr regex_'5bcC'5c'2a'5d'2e'2a'24 >>= withAttribute CommentTok))    <|>    ((pRegExpr regex_'21'2e'2a'24 >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_comments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_comments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_comments")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_symbols") =   (((pDetect2Chars False '*' '*' >>= withAttribute KeywordTok))@@ -188,7 +188,7 @@    <|>    ((pAnyChar "()," >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_symbols")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_symbols") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_symbols")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","inside_func_paren") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Fortran","inside_func_paren"))@@ -201,7 +201,7 @@    <|>    ((parseRules ("Fortran","find_numbers")))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","inside_func_paren")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","inside_func_paren") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","inside_func_paren")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_io_stmnts") =   (((pRegExpr regex_'5cb'28read'7cwrite'7cbackspace'7crewind'7cend'5cs'2afile'7cclose'29'5cs'2a'5b'28'5d >>= withAttribute FunctionTok) >>~ pushContext ("Fortran","find_io_paren"))@@ -216,7 +216,7 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_io'5ffunctions >>= withAttribute FunctionTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_io_stmnts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_io_stmnts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_io_stmnts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_io_paren") =   (((pDetectChar False '*' >>= withAttribute FunctionTok))@@ -239,7 +239,7 @@    <|>    ((parseRules ("Fortran","find_symbols")))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_io_paren")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_io_paren") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_io_paren")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","format_stmnt") =   (((pDetectChar False '(' >>= withAttribute FunctionTok) >>~ pushContext ("Fortran","format_stmnt"))@@ -254,7 +254,7 @@    <|>    ((parseRules ("Fortran","find_symbols")))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","format_stmnt")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","format_stmnt") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","format_stmnt")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_begin_stmnts") =   (((pRegExpr regex_'5cbmodule'5cs'2bprocedure'5cb >>= withAttribute KeywordTok))@@ -265,7 +265,7 @@    <|>    ((pRegExpr regex_'5cb'28then'7cdo'29'5cb >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_begin_stmnts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_begin_stmnts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_begin_stmnts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_end_stmnts") =   (((pRegExpr regex_'5cbend'5cs'2a'28subroutine'7cfunction'7cblock'5cs'2adata'29'5cb >>= withAttribute KeywordTok))@@ -280,14 +280,14 @@    <|>    ((pRegExpr regex_'5cbend'5cb >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_end_stmnts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_end_stmnts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_end_stmnts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_mid_stmnts") =   (((pRegExpr regex_'5cbelse'5cb >>= withAttribute KeywordTok))    <|>    ((pRegExpr regex_'5cbcontains'5cb >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_mid_stmnts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_mid_stmnts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_mid_stmnts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_decls") =   (((pRegExpr regex_'5cbinteger'5b'5c'2a'5d'5cd'7b1'2c2'7d >>= withAttribute DataTypeTok))@@ -314,14 +314,14 @@    <|>    ((pDetect2Chars False ':' ':' >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_decls")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_decls") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_decls")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_paren") =   (((pDetectChar False '(' >>= withAttribute DataTypeTok) >>~ pushContext ("Fortran","find_paren"))    <|>    ((pDetectChar False ')' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_paren")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_paren") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_paren")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Fortran","find_intrinsics") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))@@ -334,7 +334,7 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_non'5felem'5fsubr >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_intrinsics")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_intrinsics") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_intrinsics")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_numbers") =   (((pRegExpr regex_'5b0'2d9'5d'2a'5c'2e'5b0'2d9'5d'2b'28'5bde'5d'5b'2b'2d'5d'3f'5b0'2d9'5d'2b'29'3f'28'5b'5f'5d'28'5b0'2d9'5d'2b'7c'5ba'2dz'5d'5b'5cw'5f'5d'2a'29'29'3f >>= withAttribute FloatTok))@@ -347,14 +347,14 @@    <|>    ((pRegExpr regex_'5cb'5bbozx'5d'28'5b'27'5d'5b0'2d9a'2df'5d'2b'5b'27'5d'7c'5b'22'5d'5b0'2d9a'2df'5d'2b'5b'22'5d'29 >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_numbers")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_numbers") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_numbers")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Fortran","find_strings") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("Fortran","string_1"))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Fortran","string_2"))    <|>-   (currentContext >>= \x -> guard (x == ("Fortran","find_strings")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Fortran","find_strings") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Fortran","find_strings")) >> pDefault >>= withAttribute StringTok))  parseRules ("Fortran","string_1") =   (((pRegExpr regex_'5b'5e'27'5d'2a'27 >>= withAttribute StringTok) >>~ (popContext))
Text/Highlighting/Kate/Syntax/Fsharp.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,19 +41,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("FSharp","Normal") -> return ()-    ("FSharp","Singleline Comment") -> (popContext) >> pEndLine-    ("FSharp","Multiline Comment") -> return ()-    ("FSharp","String Constant") -> return ()-    ("FSharp","Block") -> return ()-    ("FSharp","Sig") -> return ()-    ("FSharp","Struct") -> return ()-    ("FSharp","Object") -> return ()-    ("FSharp","ModuleEnv") -> return ()-    ("FSharp","ModuleEnv2") -> return ()-    ("FSharp","Camlp4 Quotation Constant") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("FSharp","Normal") -> return ()+      ("FSharp","Singleline Comment") -> (popContext) >> pEndLine+      ("FSharp","Multiline Comment") -> return ()+      ("FSharp","String Constant") -> return ()+      ("FSharp","Block") -> return ()+      ("FSharp","Sig") -> return ()+      ("FSharp","Struct") -> return ()+      ("FSharp","Object") -> return ()+      ("FSharp","ModuleEnv") -> return ()+      ("FSharp","ModuleEnv2") -> return ()+      ("FSharp","Camlp4 Quotation Constant") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -91,8 +93,6 @@ regex_'5c'5c'28'5c'5c'7c'3e'3e'7c'3c'3c'29 = compileRegex "\\\\(\\\\|>>|<<)" regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c = compileRegex "\\\\<:[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*<" -defaultAttributes = [(("FSharp","Normal"),NormalTok),(("FSharp","Singleline Comment"),CommentTok),(("FSharp","Multiline Comment"),CommentTok),(("FSharp","String Constant"),StringTok),(("FSharp","Block"),NormalTok),(("FSharp","Sig"),NormalTok),(("FSharp","Struct"),NormalTok),(("FSharp","Object"),NormalTok),(("FSharp","ModuleEnv"),NormalTok),(("FSharp","ModuleEnv2"),NormalTok),(("FSharp","Camlp4 Quotation Constant"),StringTok)]- parseRules ("FSharp","Normal") =   (((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("FSharp","Multiline Comment"))    <|>@@ -164,17 +164,17 @@    <|>    ((pRegExpr regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","Singleline Comment") =-  (currentContext >>= \x -> guard (x == ("FSharp","Singleline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Singleline Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("FSharp","Singleline Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("FSharp","Multiline Comment") =   (((pDetect2Chars False '*' ')' >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("FSharp","Multiline Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Multiline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Multiline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Multiline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("FSharp","String Constant") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))@@ -183,35 +183,35 @@    <|>    ((pRegExpr regex_'5c'5c'24 >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","String Constant")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","String Constant") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","String Constant")) >> pDefault >>= withAttribute StringTok))  parseRules ("FSharp","Block") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("FSharp","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","Sig") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("FSharp","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Sig")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Sig") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Sig")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","Struct") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("FSharp","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Struct")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Struct") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Struct")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","Object") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("FSharp","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Object")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Object") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Object")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","ModuleEnv") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -229,7 +229,7 @@    <|>    ((pString False "." >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","ModuleEnv2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","ModuleEnv2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","ModuleEnv2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("FSharp","Camlp4 Quotation Constant") =   (((pDetect2Chars False '>' '>' >>= withAttribute StringTok) >>~ (popContext))@@ -242,7 +242,7 @@    <|>    ((pRegExpr regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("FSharp","Camlp4 Quotation Constant")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("FSharp","Camlp4 Quotation Constant") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("FSharp","Camlp4 Quotation Constant")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("FSharp","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Gnuassembler.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,15 +42,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("GNU Assembler","Normal") -> return ()-    ("GNU Assembler","Commentar 1") -> return ()-    ("GNU Assembler","Commentar 2") -> (popContext) >> pEndLine-    ("GNU Assembler","String") -> (popContext) >> pEndLine-    ("GNU Assembler","Preprocessor") -> (popContext) >> pEndLine-    ("GNU Assembler","Define") -> (popContext) >> pEndLine-    ("GNU Assembler","Some Context") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("GNU Assembler","Normal") -> return ()+      ("GNU Assembler","Commentar 1") -> return ()+      ("GNU Assembler","Commentar 2") -> (popContext) >> pEndLine+      ("GNU Assembler","String") -> (popContext) >> pEndLine+      ("GNU Assembler","Preprocessor") -> (popContext) >> pEndLine+      ("GNU Assembler","Define") -> (popContext) >> pEndLine+      ("GNU Assembler","Some Context") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -71,8 +73,6 @@ regex_'23'5cs'2adefine'2e'2a'28'28'3f'3d'5c'5c'29'29 = compileRegex "#\\s*define.*((?=\\\\))" regex_'23'5cs'2a'28'3f'3ael'28'3f'3ase'7cif'29'7cinclude'28'3f'3a'5fnext'29'3f'7cdefine'7cundef'7cline'7cerror'7cwarning'7cpragma'29 = compileRegex "#\\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" -defaultAttributes = [(("GNU Assembler","Normal"),NormalTok),(("GNU Assembler","Commentar 1"),CommentTok),(("GNU Assembler","Commentar 2"),CommentTok),(("GNU Assembler","String"),StringTok),(("GNU Assembler","Preprocessor"),OtherTok),(("GNU Assembler","Define"),OtherTok),(("GNU Assembler","Some Context"),NormalTok)]- parseRules ("GNU Assembler","Normal") =   (((pRegExpr regex_'5b'5f'5cw'5cd'2d'5d'2a'5cs'2a'3a >>= withAttribute KeywordTok))    <|>@@ -110,19 +110,19 @@    <|>    ((pAnyChar "!#%&*()+,-<=>?/:[]^{|}~" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("GNU Assembler","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("GNU Assembler","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("GNU Assembler","Commentar 1") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("GNU Assembler","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("GNU Assembler","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("GNU Assembler","Commentar 2") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("GNU Assembler","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("GNU Assembler","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("GNU Assembler","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ pushContext ("GNU Assembler","Some Context"))@@ -131,18 +131,18 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("GNU Assembler","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("GNU Assembler","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("GNU Assembler","Preprocessor") =-  (currentContext >>= \x -> guard (x == ("GNU Assembler","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Preprocessor") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("GNU Assembler","Preprocessor")) >> pDefault >>= withAttribute OtherTok)  parseRules ("GNU Assembler","Define") =   (((pLineContinue >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("GNU Assembler","Define")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Define") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("GNU Assembler","Define")) >> pDefault >>= withAttribute OtherTok))  parseRules ("GNU Assembler","Some Context") =-  (currentContext >>= \x -> guard (x == ("GNU Assembler","Some Context")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("GNU Assembler","Some Context") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("GNU Assembler","Some Context")) >> pDefault >>= withAttribute NormalTok)  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Go.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,13 +42,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Go","normal") -> return ()-    ("Go","Commentar 1") -> (popContext) >> pEndLine-    ("Go","Commentar 2") -> return ()-    ("Go","String") -> (popContext) >> pEndLine-    ("Go","Multiline String") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Go","normal") -> return ()+      ("Go","Commentar 1") -> (popContext) >> pEndLine+      ("Go","Commentar 2") -> return ()+      ("Go","String") -> (popContext) >> pEndLine+      ("Go","Multiline String") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -63,8 +65,6 @@ list_predeclared = Set.fromList $ words $ "false nil true iota"  -defaultAttributes = [(("Go","normal"),NormalTok),(("Go","Commentar 1"),CommentTok),(("Go","Commentar 2"),CommentTok),(("Go","String"),StringTok),(("Go","Multiline String"),StringTok)]- parseRules ("Go","normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\'\"" list_keywords >>= withAttribute KeywordTok))    <|>@@ -94,7 +94,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Go","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Go","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Go","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Go","Commentar 1") =   (((pLineContinue >>= withAttribute CommentTok))@@ -105,7 +105,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Go","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Go","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Go","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Go","Commentar 2") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -116,7 +116,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Go","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Go","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Go","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Go","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -125,7 +125,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Go","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Go","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Go","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Go","Multiline String") =   (((pLineContinue >>= withAttribute StringTok))@@ -134,7 +134,7 @@    <|>    ((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Go","Multiline String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Go","Multiline String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Go","Multiline String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Haskell.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,14 +41,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Haskell","code") -> return ()-    ("Haskell","comment") -> (popContext) >> pEndLine-    ("Haskell","comments") -> return ()-    ("Haskell","char") -> (popContext) >> pEndLine-    ("Haskell","string") -> return ()-    ("Haskell","infix") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Haskell","code") -> return ()+      ("Haskell","comment") -> (popContext) >> pEndLine+      ("Haskell","comments") -> return ()+      ("Haskell","char") -> (popContext) >> pEndLine+      ("Haskell","string") -> return ()+      ("Haskell","infix") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -76,8 +78,6 @@ regex_'28'5bA'2dZ'5d'5ba'2dzA'2dZ0'2d9'5f'27'5d'2a'5c'2e'29'2a'5bA'2dZ'5d'5ba'2dzA'2dZ0'2d9'5f'27'5d'2a = compileRegex "([A-Z][a-zA-Z0-9_']*\\.)*[A-Z][a-zA-Z0-9_']*" regex_'5c'5c'2e = compileRegex "\\\\." -defaultAttributes = [(("Haskell","code"),NormalTok),(("Haskell","comment"),CommentTok),(("Haskell","comments"),CommentTok),(("Haskell","char"),CharTok),(("Haskell","string"),StringTok),(("Haskell","infix"),OtherTok)]- parseRules ("Haskell","code") =   (((pRegExpr regex_'5c'7b'2d'23'2e'2a'23'2d'5c'7d >>= withAttribute OtherTok))    <|>@@ -125,34 +125,34 @@    <|>    ((pAnyChar "\8229" >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Haskell","code")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","code") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haskell","code")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Haskell","comment") =-  (currentContext >>= \x -> guard (x == ("Haskell","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Haskell","comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Haskell","comments") =   (((pDetect2Chars False '-' '}' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haskell","comments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","comments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haskell","comments")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Haskell","char") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute CharTok))    <|>    ((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haskell","char")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","char") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haskell","char")) >> pDefault >>= withAttribute CharTok))  parseRules ("Haskell","string") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haskell","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haskell","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Haskell","infix") =   (((pDetectChar False '`' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haskell","infix")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haskell","infix") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haskell","infix")) >> pDefault >>= withAttribute OtherTok))   parseRules x = parseRules ("Haskell","code") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Haxe.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,14 +41,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Haxe","normal") -> return ()-    ("Haxe","ModuleName") -> return ()-    ("Haxe","RawString") -> return ()-    ("Haxe","String") -> return ()-    ("Haxe","CommentLine") -> (popContext) >> pEndLine-    ("Haxe","CommentBlock") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Haxe","normal") -> return ()+      ("Haxe","ModuleName") -> return ()+      ("Haxe","RawString") -> return ()+      ("Haxe","String") -> return ()+      ("Haxe","CommentLine") -> (popContext) >> pEndLine+      ("Haxe","CommentBlock") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -70,8 +72,6 @@ regex_'5b'5e'5cs'5cw'2e'3a'2c'5d = compileRegex "[^\\s\\w.:,]" regex_'5c'5c'28u'5b'5cda'2dfA'2dF'5d'7b4'7d'7cU'5b'5cda'2dfA'2dF'5d'7b8'7d'7c'26'5ba'2dzA'2dZ'5d'5cw'2b'3b'29 = compileRegex "\\\\(u[\\da-fA-F]{4}|U[\\da-fA-F]{8}|&[a-zA-Z]\\w+;)" -defaultAttributes = [(("Haxe","normal"),NormalTok),(("Haxe","ModuleName"),NormalTok),(("Haxe","RawString"),StringTok),(("Haxe","String"),StringTok),(("Haxe","CommentLine"),CommentTok),(("Haxe","CommentBlock"),CommentTok)]- parseRules ("Haxe","normal") =   (((pRegExpr regex_'23if'28'5cs'2b'5cw'2b'29'3f >>= withAttribute OtherTok) >>~ (popContext))    <|>@@ -111,7 +111,7 @@    <|>    ((pRegExpr regex_'5cd'2b >>= withAttribute DecValTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haxe","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haxe","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Haxe","ModuleName") =   (((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Haxe","CommentLine"))@@ -120,12 +120,12 @@    <|>    ((pRegExpr regex_'5b'5e'5cs'5cw'2e'3a'2c'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haxe","ModuleName")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","ModuleName") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haxe","ModuleName")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Haxe","RawString") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haxe","RawString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","RawString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haxe","RawString")) >> pDefault >>= withAttribute StringTok))  parseRules ("Haxe","String") =   (((pDetect2Chars False '\\' '"' >>= withAttribute StringTok))@@ -136,15 +136,15 @@    <|>    ((pRegExpr regex_'5c'5c'28u'5b'5cda'2dfA'2dF'5d'7b4'7d'7cU'5b'5cda'2dfA'2dF'5d'7b8'7d'7c'26'5ba'2dzA'2dZ'5d'5cw'2b'3b'29 >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Haxe","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haxe","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Haxe","CommentLine") =-  (currentContext >>= \x -> guard (x == ("Haxe","CommentLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","CommentLine") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Haxe","CommentLine")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Haxe","CommentBlock") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Haxe","CommentBlock")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Haxe","CommentBlock") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Haxe","CommentBlock")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("Haxe","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Html.hs view
@@ -12,7 +12,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -44,35 +43,38 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("HTML","Start") -> return ()-    ("HTML","FindHTML") -> return ()-    ("HTML","FindEntityRefs") -> return ()-    ("HTML","FindPEntityRefs") -> return ()-    ("HTML","FindAttributes") -> return ()-    ("HTML","FindDTDRules") -> return ()-    ("HTML","Comment") -> return ()-    ("HTML","CDATA") -> return ()-    ("HTML","PI") -> return ()-    ("HTML","Doctype") -> return ()-    ("HTML","Doctype Internal Subset") -> return ()-    ("HTML","Doctype Markupdecl") -> return ()-    ("HTML","Doctype Markupdecl DQ") -> return ()-    ("HTML","Doctype Markupdecl SQ") -> return ()-    ("HTML","El Open") -> return ()-    ("HTML","El Close") -> return ()-    ("HTML","El Close 2") -> return ()-    ("HTML","El Close 3") -> return ()-    ("HTML","CSS") -> return ()-    ("HTML","CSS content") -> return ()-    ("HTML","JS") -> return ()-    ("HTML","JS content") -> return ()-    ("HTML","JS comment close") -> (popContext) >> pEndLine-    ("HTML","Value") -> return ()-    ("HTML","Value NQ") -> (popContext >> popContext) >> pEndLine-    ("HTML","Value DQ") -> return ()-    ("HTML","Value SQ") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("HTML","Start") -> return ()+      ("HTML","FindHTML") -> return ()+      ("HTML","FindEntityRefs") -> return ()+      ("HTML","FindPEntityRefs") -> return ()+      ("HTML","FindAttributes") -> return ()+      ("HTML","FindDTDRules") -> return ()+      ("HTML","Comment") -> return ()+      ("HTML","CDATA") -> return ()+      ("HTML","PI") -> return ()+      ("HTML","Doctype") -> return ()+      ("HTML","Doctype Internal Subset") -> return ()+      ("HTML","Doctype Markupdecl") -> return ()+      ("HTML","Doctype Markupdecl DQ") -> return ()+      ("HTML","Doctype Markupdecl SQ") -> return ()+      ("HTML","El Open") -> return ()+      ("HTML","El Close") -> return ()+      ("HTML","El Close 2") -> return ()+      ("HTML","El Close 3") -> return ()+      ("HTML","CSS") -> return ()+      ("HTML","CSS content") -> return ()+      ("HTML","JS") -> return ()+      ("HTML","JS content") -> return ()+      ("HTML","JS comment close") -> (popContext) >> pEndLine+      ("HTML","Value") -> return ()+      ("HTML","Value NQ") -> (popContext >> popContext) >> pEndLine+      ("HTML","Value DQ") -> return ()+      ("HTML","Value SQ") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -112,12 +114,10 @@ regex_'2f'28'3f'21'3e'29 = compileRegex "/(?!>)" regex_'5b'5e'2f'3e'3c'22'27'5cs'5d = compileRegex "[^/><\"'\\s]" -defaultAttributes = [(("HTML","Start"),NormalTok),(("HTML","FindHTML"),NormalTok),(("HTML","FindEntityRefs"),NormalTok),(("HTML","FindPEntityRefs"),NormalTok),(("HTML","FindAttributes"),NormalTok),(("HTML","FindDTDRules"),NormalTok),(("HTML","Comment"),CommentTok),(("HTML","CDATA"),NormalTok),(("HTML","PI"),NormalTok),(("HTML","Doctype"),NormalTok),(("HTML","Doctype Internal Subset"),NormalTok),(("HTML","Doctype Markupdecl"),NormalTok),(("HTML","Doctype Markupdecl DQ"),StringTok),(("HTML","Doctype Markupdecl SQ"),StringTok),(("HTML","El Open"),NormalTok),(("HTML","El Close"),NormalTok),(("HTML","El Close 2"),NormalTok),(("HTML","El Close 3"),NormalTok),(("HTML","CSS"),NormalTok),(("HTML","CSS content"),NormalTok),(("HTML","JS"),NormalTok),(("HTML","JS content"),NormalTok),(("HTML","JS comment close"),CommentTok),(("HTML","Value"),NormalTok),(("HTML","Value NQ"),NormalTok),(("HTML","Value DQ"),StringTok),(("HTML","Value SQ"),StringTok)]- parseRules ("HTML","Start") =   (((parseRules ("HTML","FindHTML")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","FindHTML") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -168,14 +168,14 @@    <|>    ((parseRules ("HTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","FindHTML")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","FindHTML") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","FindHTML")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","FindEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>    ((pAnyChar "&<" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","FindEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","FindEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","FindEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -184,7 +184,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","FindAttributes") =   (((pColumn 0 >> pRegExpr regex_'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a >>= withAttribute OtherTok))@@ -193,12 +193,12 @@    <|>    ((pDetectChar False '=' >>= withAttribute OtherTok) >>~ pushContext ("HTML","Value"))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","FindAttributes")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","FindAttributes") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","FindAttributes")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","FindDTDRules") =   (((pRegExpr regex_'3c'21'28ELEMENT'7cENTITY'7cATTLIST'7cNOTATION'29'5cb >>= withAttribute DataTypeTok) >>~ pushContext ("HTML","Doctype Markupdecl"))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","FindDTDRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","FindDTDRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","FindDTDRules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -211,7 +211,7 @@    <|>    ((pRegExpr regex_'2d'28'2d'28'3f'21'2d'3e'29'29'2b >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("HTML","CDATA") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -222,19 +222,19 @@    <|>    ((pString False "]]&gt;" >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("HTML","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -247,7 +247,7 @@    <|>    ((parseRules ("HTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -256,21 +256,21 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("HTML","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","Doctype Markupdecl DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("HTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("HTML","Doctype Markupdecl SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("HTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("HTML","El Open") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -281,28 +281,28 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","El Open")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","El Open") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","El Open")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","El Close") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","El Close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","El Close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","El Close")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","El Close 2") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","El Close 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","El Close 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","El Close 2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","El Close 3") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","El Close 3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","El Close 3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","El Close 3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","CSS") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -313,14 +313,14 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","CSS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","CSS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","CSS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","CSS content") =   (((pRegExpr regex_'3c'2fstyle'5cb >>= withAttribute KeywordTok) >>~ pushContext ("HTML","El Close 2"))    <|>    ((Text.Highlighting.Kate.Syntax.Css.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","CSS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","CSS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","CSS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","JS") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -331,7 +331,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","JS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","JS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","JS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","JS content") =   (((pRegExpr regex_'3c'2fscript'5cb >>= withAttribute KeywordTok) >>~ pushContext ("HTML","El Close 2"))@@ -340,14 +340,14 @@    <|>    ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","JS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","JS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","JS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML","JS comment close") =   (((pRegExpr regex_'3c'2fscript'5cb >>= withAttribute KeywordTok) >>~ pushContext ("HTML","El Close 3"))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","JS comment close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","JS comment close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","JS comment close")) >> pDefault >>= withAttribute CommentTok))  parseRules ("HTML","Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("HTML","Value DQ"))@@ -372,14 +372,14 @@    <|>    ((parseRules ("HTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Value DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Value DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Value DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("HTML","Value SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("HTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("HTML","Value SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("HTML","Value SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("HTML","Value SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression
Text/Highlighting/Kate/Syntax/Ini.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,11 +42,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("INI Files","ini") -> return ()-    ("INI Files","Value") -> (popContext) >> pEndLine-    ("INI Files","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("INI Files","ini") -> return ()+      ("INI Files","Value") -> (popContext) >> pEndLine+      ("INI Files","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -60,8 +62,6 @@ regex_'3b'2e'2a'24 = compileRegex ";.*$" regex_'23'2e'2a'24 = compileRegex "#.*$" -defaultAttributes = [(("INI Files","ini"),DataTypeTok),(("INI Files","Value"),StringTok),(("INI Files","Comment"),CommentTok)]- parseRules ("INI Files","ini") =   (((pRangeDetect '[' ']' >>= withAttribute KeywordTok) >>~ (popContext))    <|>@@ -71,7 +71,7 @@    <|>    ((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("INI Files","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("INI Files","ini")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("INI Files","ini") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("INI Files","ini")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("INI Files","Value") =   (((pFloat >>= withAttribute FloatTok))@@ -84,7 +84,7 @@    <|>    ((pRegExpr regex_'23'2e'2a'24 >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("INI Files","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("INI Files","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("INI Files","Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("INI Files","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -93,7 +93,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("INI Files","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("INI Files","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("INI Files","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Java.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,19 +42,22 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Java","Normal") -> return ()-    ("Java","InFunctionCall") -> return ()-    ("Java","String") -> (popContext) >> pEndLine-    ("Java","EnterPrintf") -> return ()-    ("Java","Printf") -> return ()-    ("Java","PrintfString") -> (popContext) >> pEndLine-    ("Java","Member") -> (popContext) >> pEndLine-    ("Java","StaticImports") -> (popContext) >> pEndLine-    ("Java","Imports") -> (popContext) >> pEndLine-    ("Java","Commentar 1") -> (popContext) >> pEndLine-    ("Java","Commentar 2") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Java","Normal") -> return ()+      ("Java","InFunctionCall") -> return ()+      ("Java","String") -> (popContext) >> pEndLine+      ("Java","EnterPrintf") -> return ()+      ("Java","Printf") -> return ()+      ("Java","PrintfString") -> (popContext) >> pEndLine+      ("Java","Member") -> (popContext) >> pEndLine+      ("Java","StaticImports") -> (popContext) >> pEndLine+      ("Java","Imports") -> (popContext) >> pEndLine+      ("Java","Commentar 1") -> (popContext) >> pEndLine+      ("Java","Commentar 2") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -83,8 +85,6 @@ regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 = compileRegex "\\b[_a-zA-Z]\\w*(?=[\\s]*)" regex_'5cs'2a'2e'2a'3b = compileRegex "\\s*.*;" -defaultAttributes = [(("Java","Normal"),NormalTok),(("Java","InFunctionCall"),NormalTok),(("Java","String"),StringTok),(("Java","EnterPrintf"),NormalTok),(("Java","Printf"),NormalTok),(("Java","PrintfString"),StringTok),(("Java","Member"),NormalTok),(("Java","StaticImports"),NormalTok),(("Java","Imports"),NormalTok),(("Java","Commentar 1"),CommentTok),(("Java","Commentar 2"),CommentTok)]- parseRules ("Java","Normal") =   (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))    <|>@@ -136,14 +136,14 @@    <|>    ((pAnyChar ":!%&+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Java","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Java","InFunctionCall") =   (((parseRules ("Java","Normal")))    <|>    ((pDetectChar False ')' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Java","InFunctionCall")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","InFunctionCall") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","InFunctionCall")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Java","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -154,7 +154,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Java","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Java","EnterPrintf") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Java","Printf"))@@ -168,7 +168,7 @@    <|>    ((parseRules ("Java","InFunctionCall")))    <|>-   (currentContext >>= \x -> guard (x == ("Java","Printf")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","Printf") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","Printf")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Java","PrintfString") =   (((pLineContinue >>= withAttribute StringTok))@@ -183,7 +183,7 @@    <|>    ((pRegExpr regex_'25'28'25'7cn'29 >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Java","PrintfString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","PrintfString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","PrintfString")) >> pDefault >>= withAttribute StringTok))  parseRules ("Java","Member") =   (((pRegExpr regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 >>= withAttribute FunctionTok) >>~ (popContext))@@ -193,20 +193,20 @@ parseRules ("Java","StaticImports") =   (((pRegExpr regex_'5cs'2a'2e'2a'3b >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Java","StaticImports")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","StaticImports") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","StaticImports")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Java","Imports") =   (((pRegExpr regex_'5cs'2a'2e'2a'3b >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Java","Imports")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","Imports") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","Imports")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Java","Commentar 1") =-  (currentContext >>= \x -> guard (x == ("Java","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","Commentar 1") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Java","Commentar 1")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Java","Commentar 2") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Java","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Java","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Java","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression 
Text/Highlighting/Kate/Syntax/Javadoc.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,16 +41,19 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Javadoc","Start") -> return ()-    ("Javadoc","FindJavadoc") -> return ()-    ("Javadoc","JavadocFSar") -> return ()-    ("Javadoc","Javadocar") -> return ()-    ("Javadoc","JavadocParam") -> (popContext) >> pEndLine-    ("Javadoc","InlineTagar") -> return ()-    ("Javadoc","LiteralTagar") -> return ()-    ("Javadoc","SeeTag") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Javadoc","Start") -> return ()+      ("Javadoc","FindJavadoc") -> return ()+      ("Javadoc","JavadocFSar") -> return ()+      ("Javadoc","Javadocar") -> return ()+      ("Javadoc","JavadocParam") -> (popContext) >> pEndLine+      ("Javadoc","InlineTagar") -> return ()+      ("Javadoc","LiteralTagar") -> return ()+      ("Javadoc","SeeTag") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -68,19 +70,17 @@ regex_'5cS'2a'28'3f'3d'5c'2a'2f'29 = compileRegex "\\S*(?=\\*/)" regex_'5cS'2a'28'5cs'7c'24'29 = compileRegex "\\S*(\\s|$)" -defaultAttributes = [(("Javadoc","Start"),NormalTok),(("Javadoc","FindJavadoc"),NormalTok),(("Javadoc","JavadocFSar"),CommentTok),(("Javadoc","Javadocar"),CommentTok),(("Javadoc","JavadocParam"),CommentTok),(("Javadoc","InlineTagar"),KeywordTok),(("Javadoc","LiteralTagar"),KeywordTok),(("Javadoc","SeeTag"),KeywordTok)]- parseRules ("Javadoc","Start") =   (((parseRules ("Javadoc","FindJavadoc")))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Javadoc","FindJavadoc") =   (((pString False "/**/" >>= withAttribute CommentTok))    <|>    ((pString False "/**" >>= withAttribute CommentTok) >>~ pushContext ("Javadoc","JavadocFSar"))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","FindJavadoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","FindJavadoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","FindJavadoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Javadoc","JavadocFSar") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))@@ -121,7 +121,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","JavadocFSar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","JavadocFSar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","JavadocFSar")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc","Javadocar") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext))@@ -204,7 +204,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","Javadocar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","Javadocar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","Javadocar")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc","JavadocParam") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -213,7 +213,7 @@    <|>    ((pRegExpr regex_'5cS'2a'28'5cs'7c'24'29 >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","JavadocParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","JavadocParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","JavadocParam")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc","InlineTagar") =   (((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext))@@ -222,21 +222,21 @@    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute KeywordTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","InlineTagar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","InlineTagar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","InlineTagar")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("Javadoc","LiteralTagar") =   (((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","LiteralTagar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","LiteralTagar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","LiteralTagar")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("Javadoc","SeeTag") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext >> popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute KeywordTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Javadoc","SeeTag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Javadoc","SeeTag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Javadoc","SeeTag")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression 
Text/Highlighting/Kate/Syntax/Javascript.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,20 +42,23 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("JavaScript","Normal") -> return ()-    ("JavaScript","String") -> (popContext) >> pEndLine-    ("JavaScript","String 1") -> (popContext) >> pEndLine-    ("JavaScript","Comment") -> (popContext) >> pEndLine-    ("JavaScript","Multi/inline Comment") -> return ()-    ("JavaScript","Regular Expression") -> return ()-    ("JavaScript","(Internal regex catch)") -> return ()-    ("JavaScript","Regular Expression Character Class") -> return ()-    ("JavaScript","(regex caret first check)") -> (popContext) >> pEndLine-    ("JavaScript","(charclass caret first check)") -> (popContext) >> pEndLine-    ("JavaScript","region_marker") -> (popContext) >> pEndLine-    ("JavaScript","ObjectMember") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("JavaScript","Normal") -> return ()+      ("JavaScript","String") -> (popContext) >> pEndLine+      ("JavaScript","String 1") -> (popContext) >> pEndLine+      ("JavaScript","Comment") -> (popContext) >> pEndLine+      ("JavaScript","Multi/inline Comment") -> return ()+      ("JavaScript","Regular Expression") -> return ()+      ("JavaScript","(Internal regex catch)") -> return ()+      ("JavaScript","Regular Expression Character Class") -> return ()+      ("JavaScript","(regex caret first check)") -> (popContext) >> pEndLine+      ("JavaScript","(charclass caret first check)") -> (popContext) >> pEndLine+      ("JavaScript","region_marker") -> (popContext) >> pEndLine+      ("JavaScript","ObjectMember") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -83,8 +85,6 @@ regex_'2f'2f'28'3f'3d'3b'29 = compileRegex "//(?=;)" regex_'5c'5c'5b'5c'5b'5c'5d'5d = compileRegex "\\\\[\\[\\]]" -defaultAttributes = [(("JavaScript","Normal"),NormalTok),(("JavaScript","String"),StringTok),(("JavaScript","String 1"),CharTok),(("JavaScript","Comment"),CommentTok),(("JavaScript","Multi/inline Comment"),CommentTok),(("JavaScript","Regular Expression"),OtherTok),(("JavaScript","(Internal regex catch)"),NormalTok),(("JavaScript","Regular Expression Character Class"),BaseNTok),(("JavaScript","(regex caret first check)"),FloatTok),(("JavaScript","(charclass caret first check)"),FloatTok),(("JavaScript","region_marker"),RegionMarkerTok),(("JavaScript","ObjectMember"),NormalTok)]- parseRules ("JavaScript","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -132,7 +132,7 @@    <|>    ((pAnyChar ":!%&+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("JavaScript","String") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -143,7 +143,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("JavaScript","String 1") =   (((pDetectIdentifier >>= withAttribute CharTok))@@ -154,7 +154,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","String 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","String 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","String 1")) >> pDefault >>= withAttribute CharTok))  parseRules ("JavaScript","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -163,14 +163,14 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("JavaScript","Multi/inline Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","Multi/inline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","Multi/inline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","Multi/inline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("JavaScript","Regular Expression") =   (((pRegExpr regex_'2f'5big'5d'7b0'2c2'7d >>= withAttribute OtherTok) >>~ (popContext >> popContext >> popContext))@@ -189,7 +189,7 @@    <|>    ((pAnyChar "?+*()|" >>= withAttribute FloatTok))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","Regular Expression")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","Regular Expression") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","Regular Expression")) >> pDefault >>= withAttribute OtherTok))  parseRules ("JavaScript","(Internal regex catch)") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -211,7 +211,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute BaseNTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","Regular Expression Character Class")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","Regular Expression Character Class") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","Regular Expression Character Class")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("JavaScript","(regex caret first check)") =   (((pDetectChar False '^' >>= withAttribute FloatTok) >>~ pushContext ("JavaScript","Regular Expression"))@@ -228,7 +228,7 @@    <|>    ((pDetectSpaces >>= withAttribute RegionMarkerTok))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","region_marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","region_marker") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok))  parseRules ("JavaScript","ObjectMember") =   (((pDetectChar False '.' >>= withAttribute NormalTok))@@ -239,7 +239,7 @@    <|>    ((lookAhead (pAnyChar "(){}:!%&+,-/.*<=>?[]|~^;") >> (popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("JavaScript","ObjectMember")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JavaScript","ObjectMember") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JavaScript","ObjectMember")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Json.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,14 +41,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("JSON","Normal") -> return ()-    ("JSON","Pair") -> return ()-    ("JSON","String_Key") -> return ()-    ("JSON","Value") -> return ()-    ("JSON","String_Value") -> return ()-    ("JSON","Array") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("JSON","Normal") -> return ()+      ("JSON","Pair") -> return ()+      ("JSON","String_Key") -> return ()+      ("JSON","Value") -> return ()+      ("JSON","String_Value") -> return ()+      ("JSON","Array") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -63,8 +65,6 @@ regex_'2d'3f'28'3f'3a'5b0'2d9'5d'7c'5b1'2d9'5d'5b0'2d9'5d'2b'29'5c'2e'5b0'2d9'5d'2b'28'3f'3a'5beE'5d'5b'2b'2d'5d'3f'5b0'2d9'5d'2b'29'3f = compileRegex "-?(?:[0-9]|[1-9][0-9]+)\\.[0-9]+(?:[eE][+-]?[0-9]+)?" regex_'2d'3f'28'3f'3a'5b0'2d9'5d'7c'5b1'2d9'5d'5b0'2d9'5d'2b'29'28'3f'3a'5beE'5d'5b'2b'2d'5d'3f'5b0'2d9'5d'2b'29'3f = compileRegex "-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" -defaultAttributes = [(("JSON","Normal"),ErrorTok),(("JSON","Pair"),ErrorTok),(("JSON","String_Key"),DataTypeTok),(("JSON","Value"),ErrorTok),(("JSON","String_Value"),StringTok),(("JSON","Array"),ErrorTok)]- parseRules ("JSON","Normal") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("JSON","Pair"))    <|>@@ -72,7 +72,7 @@    <|>    ((pDetectSpaces >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","Normal")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("JSON","Pair") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("JSON","String_Key"))@@ -85,14 +85,14 @@    <|>    ((pDetectSpaces >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","Pair")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","Pair") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","Pair")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("JSON","String_Key") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5c'5c'28'3f'3a'5b'22'5c'5c'2fbfnrt'5d'7cu'5b0'2d9a'2dfA'2df'5d'7b4'7d'29 >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","String_Key")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","String_Key") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","String_Key")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSON","Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("JSON","String_Value"))@@ -113,14 +113,14 @@    <|>    ((pRegExpr regex_'2d'3f'28'3f'3a'5b0'2d9'5d'7c'5b1'2d9'5d'5b0'2d9'5d'2b'29'28'3f'3a'5beE'5d'5b'2b'2d'5d'3f'5b0'2d9'5d'2b'29'3f >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","Value")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("JSON","String_Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pRegExpr regex_'5c'5c'28'3f'3a'5b'22'5c'5c'2fbfnrt'5d'7cu'5b0'2d9a'2dfA'2df'5d'7b4'7d'29 >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","String_Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","String_Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","String_Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSON","Array") =   (((pDetectChar False ',' >>= withAttribute NormalTok))@@ -141,7 +141,7 @@    <|>    ((pRegExpr regex_'2d'3f'28'3f'3a'5b0'2d9'5d'7c'5b1'2d9'5d'5b0'2d9'5d'2b'29'28'3f'3a'5beE'5d'5b'2b'2d'5d'3f'5b0'2d9'5d'2b'29'3f >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSON","Array")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSON","Array") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSON","Array")) >> pDefault >>= withAttribute ErrorTok))   parseRules x = parseRules ("JSON","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Jsp.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,31 +41,34 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("JSP","Normal") -> return ()-    ("JSP","Jsp Standard Directive") -> return ()-    ("JSP","Jsp Xml Directive") -> return ()-    ("JSP","Jsp Comment") -> return ()-    ("JSP","Jsp Custom Tag") -> return ()-    ("JSP","Jsp Standard Directive Value") -> return ()-    ("JSP","Jsp Xml Directive Value") -> return ()-    ("JSP","Jsp Custom Tag Value") -> return ()-    ("JSP","Jsp Double Quoted Param Value") -> return ()-    ("JSP","Jsp Single Quoted Param Value") -> return ()-    ("JSP","Jsp Double Quoted Custom Tag Value") -> return ()-    ("JSP","Jsp Single Quoted Custom Tag Value") -> return ()-    ("JSP","Jsp Scriptlet") -> return ()-    ("JSP","Jsp Expression") -> return ()-    ("JSP","Java Single-Line Comment") -> (popContext) >> pEndLine-    ("JSP","Java Multi-Line Comment") -> return ()-    ("JSP","Java String") -> return ()-    ("JSP","Html Attribute") -> return ()-    ("JSP","Html Value") -> return ()-    ("JSP","Html Double Quoted Value") -> return ()-    ("JSP","Html Single Quoted Value") -> return ()-    ("JSP","Html Unquoted Value") -> return ()-    ("JSP","Html Comment") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("JSP","Normal") -> return ()+      ("JSP","Jsp Standard Directive") -> return ()+      ("JSP","Jsp Xml Directive") -> return ()+      ("JSP","Jsp Comment") -> return ()+      ("JSP","Jsp Custom Tag") -> return ()+      ("JSP","Jsp Standard Directive Value") -> return ()+      ("JSP","Jsp Xml Directive Value") -> return ()+      ("JSP","Jsp Custom Tag Value") -> return ()+      ("JSP","Jsp Double Quoted Param Value") -> return ()+      ("JSP","Jsp Single Quoted Param Value") -> return ()+      ("JSP","Jsp Double Quoted Custom Tag Value") -> return ()+      ("JSP","Jsp Single Quoted Custom Tag Value") -> return ()+      ("JSP","Jsp Scriptlet") -> return ()+      ("JSP","Jsp Expression") -> return ()+      ("JSP","Java Single-Line Comment") -> (popContext) >> pEndLine+      ("JSP","Java Multi-Line Comment") -> return ()+      ("JSP","Java String") -> return ()+      ("JSP","Html Attribute") -> return ()+      ("JSP","Html Value") -> return ()+      ("JSP","Html Double Quoted Value") -> return ()+      ("JSP","Html Single Quoted Value") -> return ()+      ("JSP","Html Unquoted Value") -> return ()+      ("JSP","Html Comment") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -97,8 +99,6 @@ regex_'5cs'2b = compileRegex "\\s+" regex_'5c'2f'2a'2d'2d'3e = compileRegex "\\/*-->" -defaultAttributes = [(("JSP","Normal"),NormalTok),(("JSP","Jsp Standard Directive"),OtherTok),(("JSP","Jsp Xml Directive"),OtherTok),(("JSP","Jsp Comment"),CommentTok),(("JSP","Jsp Custom Tag"),OtherTok),(("JSP","Jsp Standard Directive Value"),StringTok),(("JSP","Jsp Xml Directive Value"),StringTok),(("JSP","Jsp Custom Tag Value"),NormalTok),(("JSP","Jsp Double Quoted Param Value"),StringTok),(("JSP","Jsp Single Quoted Param Value"),StringTok),(("JSP","Jsp Double Quoted Custom Tag Value"),DataTypeTok),(("JSP","Jsp Single Quoted Custom Tag Value"),DataTypeTok),(("JSP","Jsp Scriptlet"),NormalTok),(("JSP","Jsp Expression"),NormalTok),(("JSP","Java Single-Line Comment"),CommentTok),(("JSP","Java Multi-Line Comment"),CommentTok),(("JSP","Java String"),StringTok),(("JSP","Html Attribute"),OtherTok),(("JSP","Html Value"),DataTypeTok),(("JSP","Html Double Quoted Value"),DataTypeTok),(("JSP","Html Single Quoted Value"),DataTypeTok),(("JSP","Html Unquoted Value"),DataTypeTok),(("JSP","Html Comment"),CommentTok)]- parseRules ("JSP","Normal") =   (((pRegExpr regex_'3c'25'40'5cs'2a'5ba'2dzA'2dZ0'2d9'5f'5c'2e'5d'2a >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Standard Directive"))    <|>@@ -122,7 +122,7 @@    <|>    ((pRegExpr regex_'3c'5cs'2a'5c'2f'3f'5cs'2a'5ba'2dzA'2dZ0'2d9'5f'5d'2a >>= withAttribute NormalTok) >>~ pushContext ("JSP","Html Attribute"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("JSP","Jsp Standard Directive") =   (((pDetect2Chars False '%' '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -137,7 +137,7 @@    <|>    ((pRegExpr regex_'3c'5cs'2a'5c'2f'3f'5cs'2a'5c'24'3f'5cw'2a'3a'5c'24'3f'5cw'2a >>= withAttribute KeywordTok) >>~ pushContext ("JSP","Jsp Custom Tag"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Standard Directive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Standard Directive") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Standard Directive")) >> pDefault >>= withAttribute OtherTok))  parseRules ("JSP","Jsp Xml Directive") =   (((pRegExpr regex_'5cs'2a'5c'2f'3f'5cs'2a'3e >>= withAttribute NormalTok) >>~ (popContext))@@ -150,12 +150,12 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Xml Directive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Xml Directive") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Xml Directive")) >> pDefault >>= withAttribute OtherTok))  parseRules ("JSP","Jsp Comment") =   (((pString False "--%>" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("JSP","Jsp Custom Tag") =   (((pRegExpr regex_'5c'2f'3f'3e >>= withAttribute KeywordTok) >>~ (popContext))@@ -168,7 +168,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Custom Tag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Custom Tag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Custom Tag")) >> pDefault >>= withAttribute OtherTok))  parseRules ("JSP","Jsp Standard Directive Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -183,7 +183,7 @@    <|>    ((pDetect2Chars False '%' '>' >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Standard Directive Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Standard Directive Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Standard Directive Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSP","Jsp Xml Directive Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -198,7 +198,7 @@    <|>    ((pRegExpr regex_'5cs'2a'5c'2f'3f'5cs'2a'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Xml Directive Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Xml Directive Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Xml Directive Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSP","Jsp Custom Tag Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -213,7 +213,7 @@    <|>    ((pRegExpr regex_'5c'2f'3f'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Custom Tag Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Custom Tag Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Custom Tag Value")) >> pDefault >>= withAttribute NormalTok))  parseRules ("JSP","Jsp Double Quoted Param Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext >> popContext))@@ -224,7 +224,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Double Quoted Param Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Double Quoted Param Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Double Quoted Param Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSP","Jsp Single Quoted Param Value") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))@@ -235,7 +235,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Single Quoted Param Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Single Quoted Param Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Single Quoted Param Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSP","Jsp Double Quoted Custom Tag Value") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))@@ -246,7 +246,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Double Quoted Custom Tag Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Double Quoted Custom Tag Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Double Quoted Custom Tag Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Jsp Single Quoted Custom Tag Value") =   (((pDetectChar False '\'' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))@@ -257,7 +257,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Single Quoted Custom Tag Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Single Quoted Custom Tag Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Single Quoted Custom Tag Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Jsp Scriptlet") =   (((pDetect2Chars False '%' '>' >>= withAttribute NormalTok) >>~ (popContext))@@ -312,7 +312,7 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("JSP","Java Multi-Line Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Scriptlet")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Scriptlet") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Scriptlet")) >> pDefault >>= withAttribute NormalTok))  parseRules ("JSP","Jsp Expression") =   (((pString False "'${'" >>= withAttribute NormalTok))@@ -355,22 +355,22 @@    <|>    ((pAnyChar "!%&()+,-<=>?[]^{|}~" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Jsp Expression")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Jsp Expression") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Jsp Expression")) >> pDefault >>= withAttribute NormalTok))  parseRules ("JSP","Java Single-Line Comment") =-  (currentContext >>= \x -> guard (x == ("JSP","Java Single-Line Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Java Single-Line Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("JSP","Java Single-Line Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("JSP","Java Multi-Line Comment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Java Multi-Line Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Java Multi-Line Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Java Multi-Line Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("JSP","Java String") =   (((pDetect2Chars False '\\' '"' >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Java String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Java String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Java String")) >> pDefault >>= withAttribute StringTok))  parseRules ("JSP","Html Attribute") =   (((pRegExpr regex_'5c'2f'3f'3e >>= withAttribute NormalTok) >>~ (popContext))@@ -383,7 +383,7 @@    <|>    ((pDetect2Chars False '$' '{' >>= withAttribute NormalTok) >>~ pushContext ("JSP","Jsp Expression"))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Attribute")) >> pDefault >>= withAttribute OtherTok))  parseRules ("JSP","Html Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -402,7 +402,7 @@    <|>    ((pRegExpr regex_'5c'2f'3f'3e >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Html Double Quoted Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -415,7 +415,7 @@    <|>    ((pRegExpr regex_'28'22'7c'26quot'3b'7c'26'2334'3b'29 >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Double Quoted Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Double Quoted Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Double Quoted Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Html Single Quoted Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -428,7 +428,7 @@    <|>    ((pRegExpr regex_'28'27'7c'26'2339'3b'29 >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Single Quoted Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Single Quoted Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Single Quoted Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Html Unquoted Value") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -443,7 +443,7 @@    <|>    ((pRegExpr regex_'5cs'2b >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Unquoted Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Unquoted Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Unquoted Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("JSP","Html Comment") =   (((pString False "<%--" >>= withAttribute CommentTok) >>~ pushContext ("JSP","Jsp Comment"))@@ -454,7 +454,7 @@    <|>    ((pRegExpr regex_'5c'2f'2a'2d'2d'3e >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("JSP","Html Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("JSP","Html Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("JSP","Html Comment")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("JSP","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Latex.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,65 +40,68 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("LaTeX","Normal Text") -> return ()-    ("LaTeX","NoWeb") -> return ()-    ("LaTeX","Sectioning") -> return ()-    ("LaTeX","SectioningInside") -> return ()-    ("LaTeX","SectioningContrSeq") -> (popContext) >> pEndLine-    ("LaTeX","SectioningMathMode") -> return ()-    ("LaTeX","SectioningMathContrSeq") -> (popContext) >> pEndLine-    ("LaTeX","Footnoting") -> return ()-    ("LaTeX","FootnotingInside") -> return ()-    ("LaTeX","FootnotingMathMode") -> return ()-    ("LaTeX","NewCommand") -> return ()-    ("LaTeX","DefCommand") -> return ()-    ("LaTeX","CommandParameterStart") -> return ()-    ("LaTeX","CommandParameter") -> return ()-    ("LaTeX","ContrSeq") -> (popContext) >> pEndLine-    ("LaTeX","ToEndOfLine") -> (popContext) >> pEndLine-    ("LaTeX","Verb") -> (popContext >> popContext) >> pEndLine-    ("LaTeX","VerbEnd") -> (popContext >> popContext >> popContext) >> pEndLine-    ("LaTeX","Label") -> return ()-    ("LaTeX","LabelOption") -> return ()-    ("LaTeX","LabelParameter") -> return ()-    ("LaTeX","FancyLabel") -> return ()-    ("LaTeX","FancyLabelParameter") -> return ()-    ("LaTeX","FancyLabelRoundBrackets") -> return ()-    ("LaTeX","FindEndEnvironment") -> return ()-    ("LaTeX","EndEnvironment") -> return ()-    ("LaTeX","EndLatexEnv") -> return ()-    ("LaTeX","FindBeginEnvironment") -> return ()-    ("LaTeX","BeginEnvironment") -> return ()-    ("LaTeX","LatexEnv") -> return ()-    ("LaTeX","VerbatimEnv") -> return ()-    ("LaTeX","VerbatimEnvParam") -> return ()-    ("LaTeX","Verbatim") -> return ()-    ("LaTeX","VerbFindEnd") -> (popContext) >> pEndLine-    ("LaTeX","CommentEnv") -> return ()-    ("LaTeX","BlockComment") -> return ()-    ("LaTeX","CommFindEnd") -> (popContext) >> pEndLine-    ("LaTeX","MathEnv") -> return ()-    ("LaTeX","MathEnvParam") -> return ()-    ("LaTeX","EnvCommon") -> return ()-    ("LaTeX","MathModeEnv") -> return ()-    ("LaTeX","MathFindEnd") -> (popContext) >> pEndLine-    ("LaTeX","TabEnv") -> return ()-    ("LaTeX","Tab") -> return ()-    ("LaTeX","Column Separator") -> return ()-    ("LaTeX","TabFindEnd") -> (popContext) >> pEndLine-    ("LaTeX","MathMode") -> return ()-    ("LaTeX","MathModeDisplay") -> return ()-    ("LaTeX","MathModeEquation") -> return ()-    ("LaTeX","MathModeEnsure") -> return ()-    ("LaTeX","MathModeCommon") -> return ()-    ("LaTeX","MathContrSeq") -> (popContext) >> pEndLine-    ("LaTeX","MathModeText") -> return ()-    ("LaTeX","MathModeTextParameterStart") -> return ()-    ("LaTeX","MathModeTextParameter") -> return ()-    ("LaTeX","Multiline Comment") -> return ()-    ("LaTeX","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("LaTeX","Normal Text") -> return ()+      ("LaTeX","NoWeb") -> return ()+      ("LaTeX","Sectioning") -> return ()+      ("LaTeX","SectioningInside") -> return ()+      ("LaTeX","SectioningContrSeq") -> (popContext) >> pEndLine+      ("LaTeX","SectioningMathMode") -> return ()+      ("LaTeX","SectioningMathContrSeq") -> (popContext) >> pEndLine+      ("LaTeX","Footnoting") -> return ()+      ("LaTeX","FootnotingInside") -> return ()+      ("LaTeX","FootnotingMathMode") -> return ()+      ("LaTeX","NewCommand") -> return ()+      ("LaTeX","DefCommand") -> return ()+      ("LaTeX","CommandParameterStart") -> return ()+      ("LaTeX","CommandParameter") -> return ()+      ("LaTeX","ContrSeq") -> (popContext) >> pEndLine+      ("LaTeX","ToEndOfLine") -> (popContext) >> pEndLine+      ("LaTeX","Verb") -> (popContext >> popContext) >> pEndLine+      ("LaTeX","VerbEnd") -> (popContext >> popContext >> popContext) >> pEndLine+      ("LaTeX","Label") -> return ()+      ("LaTeX","LabelOption") -> return ()+      ("LaTeX","LabelParameter") -> return ()+      ("LaTeX","FancyLabel") -> return ()+      ("LaTeX","FancyLabelParameter") -> return ()+      ("LaTeX","FancyLabelRoundBrackets") -> return ()+      ("LaTeX","FindEndEnvironment") -> return ()+      ("LaTeX","EndEnvironment") -> return ()+      ("LaTeX","EndLatexEnv") -> return ()+      ("LaTeX","FindBeginEnvironment") -> return ()+      ("LaTeX","BeginEnvironment") -> return ()+      ("LaTeX","LatexEnv") -> return ()+      ("LaTeX","VerbatimEnv") -> return ()+      ("LaTeX","VerbatimEnvParam") -> return ()+      ("LaTeX","Verbatim") -> return ()+      ("LaTeX","VerbFindEnd") -> (popContext) >> pEndLine+      ("LaTeX","CommentEnv") -> return ()+      ("LaTeX","BlockComment") -> return ()+      ("LaTeX","CommFindEnd") -> (popContext) >> pEndLine+      ("LaTeX","MathEnv") -> return ()+      ("LaTeX","MathEnvParam") -> return ()+      ("LaTeX","EnvCommon") -> return ()+      ("LaTeX","MathModeEnv") -> return ()+      ("LaTeX","MathFindEnd") -> (popContext) >> pEndLine+      ("LaTeX","TabEnv") -> return ()+      ("LaTeX","Tab") -> return ()+      ("LaTeX","Column Separator") -> return ()+      ("LaTeX","TabFindEnd") -> (popContext) >> pEndLine+      ("LaTeX","MathMode") -> return ()+      ("LaTeX","MathModeDisplay") -> return ()+      ("LaTeX","MathModeEquation") -> return ()+      ("LaTeX","MathModeEnsure") -> return ()+      ("LaTeX","MathModeCommon") -> return ()+      ("LaTeX","MathContrSeq") -> (popContext) >> pEndLine+      ("LaTeX","MathModeText") -> return ()+      ("LaTeX","MathModeTextParameterStart") -> return ()+      ("LaTeX","MathModeTextParameter") -> return ()+      ("LaTeX","Multiline Comment") -> return ()+      ("LaTeX","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -168,8 +170,6 @@ regex_'5c'24'2e'2a'5c'24 = compileRegex "\\$.*\\$" regex_'28FIXME'7cTODO'29'3a'3f = compileRegex "(FIXME|TODO):?" -defaultAttributes = [(("LaTeX","Normal Text"),NormalTok),(("LaTeX","NoWeb"),NormalTok),(("LaTeX","Sectioning"),NormalTok),(("LaTeX","SectioningInside"),NormalTok),(("LaTeX","SectioningContrSeq"),NormalTok),(("LaTeX","SectioningMathMode"),NormalTok),(("LaTeX","SectioningMathContrSeq"),NormalTok),(("LaTeX","Footnoting"),NormalTok),(("LaTeX","FootnotingInside"),NormalTok),(("LaTeX","FootnotingMathMode"),NormalTok),(("LaTeX","NewCommand"),NormalTok),(("LaTeX","DefCommand"),NormalTok),(("LaTeX","CommandParameterStart"),NormalTok),(("LaTeX","CommandParameter"),NormalTok),(("LaTeX","ContrSeq"),NormalTok),(("LaTeX","ToEndOfLine"),NormalTok),(("LaTeX","Verb"),NormalTok),(("LaTeX","VerbEnd"),NormalTok),(("LaTeX","Label"),NormalTok),(("LaTeX","LabelOption"),NormalTok),(("LaTeX","LabelParameter"),NormalTok),(("LaTeX","FancyLabel"),NormalTok),(("LaTeX","FancyLabelParameter"),NormalTok),(("LaTeX","FancyLabelRoundBrackets"),NormalTok),(("LaTeX","FindEndEnvironment"),NormalTok),(("LaTeX","EndEnvironment"),NormalTok),(("LaTeX","EndLatexEnv"),NormalTok),(("LaTeX","FindBeginEnvironment"),NormalTok),(("LaTeX","BeginEnvironment"),NormalTok),(("LaTeX","LatexEnv"),NormalTok),(("LaTeX","VerbatimEnv"),NormalTok),(("LaTeX","VerbatimEnvParam"),NormalTok),(("LaTeX","Verbatim"),NormalTok),(("LaTeX","VerbFindEnd"),NormalTok),(("LaTeX","CommentEnv"),NormalTok),(("LaTeX","BlockComment"),CommentTok),(("LaTeX","CommFindEnd"),NormalTok),(("LaTeX","MathEnv"),NormalTok),(("LaTeX","MathEnvParam"),NormalTok),(("LaTeX","EnvCommon"),NormalTok),(("LaTeX","MathModeEnv"),NormalTok),(("LaTeX","MathFindEnd"),NormalTok),(("LaTeX","TabEnv"),NormalTok),(("LaTeX","Tab"),NormalTok),(("LaTeX","Column Separator"),NormalTok),(("LaTeX","TabFindEnd"),NormalTok),(("LaTeX","MathMode"),NormalTok),(("LaTeX","MathModeDisplay"),NormalTok),(("LaTeX","MathModeEquation"),NormalTok),(("LaTeX","MathModeEnsure"),NormalTok),(("LaTeX","MathModeCommon"),NormalTok),(("LaTeX","MathContrSeq"),NormalTok),(("LaTeX","MathModeText"),NormalTok),(("LaTeX","MathModeTextParameterStart"),NormalTok),(("LaTeX","MathModeTextParameter"),NormalTok),(("LaTeX","Multiline Comment"),CommentTok),(("LaTeX","Comment"),CommentTok)]- parseRules ("LaTeX","Normal Text") =   (((pRegExpr regex_'5c'5cbegin'28'3f'3d'5b'5ea'2dzA'2dZ'5d'29 >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FindBeginEnvironment"))    <|>@@ -215,12 +215,12 @@    <|>    ((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","NoWeb") =   (((pColumn 0 >> pRegExpr regex_'5cs'2a'40'5cs'2a >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","NoWeb")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","NoWeb") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","NoWeb")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Sectioning") =   (((pRegExpr regex_'5c'5b'5b'5e'5c'5d'5d'2a'5c'5d >>= withAttribute NormalTok))@@ -250,7 +250,7 @@    <|>    ((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningInside")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","SectioningInside") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningInside")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","SectioningContrSeq") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))@@ -259,7 +259,7 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","SectioningContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","SectioningMathMode") =   (((pString False "$$" >>= withAttribute AlertTok))@@ -276,7 +276,7 @@    <|>    ((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningMathMode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","SectioningMathMode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningMathMode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","SectioningMathContrSeq") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))@@ -285,7 +285,7 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningMathContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","SectioningMathContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","SectioningMathContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Footnoting") =   (((pRegExpr regex_'5c'5b'5b'5e'5c'5d'5d'2a'5c'5d >>= withAttribute NormalTok))@@ -311,7 +311,7 @@    <|>    ((parseRules ("LaTeX","Normal Text")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FootnotingInside")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FootnotingInside") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FootnotingInside")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","FootnotingMathMode") =   (((pString False "$$" >>= withAttribute AlertTok))@@ -324,7 +324,7 @@    <|>    ((parseRules ("LaTeX","MathMode")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FootnotingMathMode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FootnotingMathMode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FootnotingMathMode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","NewCommand") =   (((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a'5c'5c'5ba'2dzA'2dZ'5d'2b'5cs'2a'5c'7d'28'5c'5b'5cd'5c'5d'28'5c'5b'5b'5e'5c'5d'5d'2a'5c'5d'29'3f'29'3f'5c'7b >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","CommandParameterStart"))@@ -349,7 +349,7 @@    <|>    ((pDetectChar False '%' >>= withAttribute CommentTok) >>~ pushContext ("LaTeX","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","CommandParameterStart")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","CommandParameterStart") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","CommandParameterStart")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","CommandParameter") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","CommandParameter"))@@ -360,7 +360,7 @@    <|>    ((pDetectChar False '%' >>= withAttribute CommentTok) >>~ pushContext ("LaTeX","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","CommandParameter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","CommandParameter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","CommandParameter")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","ContrSeq") =   (((pString False "verb*" >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","Verb"))@@ -373,15 +373,15 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","ContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","ContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","ContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","ToEndOfLine") =-  (currentContext >>= \x -> guard (x == ("LaTeX","ToEndOfLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","ToEndOfLine") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("LaTeX","ToEndOfLine")) >> pDefault >>= withAttribute NormalTok)  parseRules ("LaTeX","Verb") =   (((pRegExprDynamic "(.)" >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","VerbEnd"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Verb")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Verb") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Verb")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","VerbEnd") =   (((pString True "%1" >>= withAttribute NormalTok) >>~ (popContext >> popContext >> popContext))@@ -390,7 +390,7 @@    <|>    ((pRegExprDynamic "[^%1\\xd7]*" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","VerbEnd")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","VerbEnd") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","VerbEnd")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Label") =   (((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","LabelParameter"))@@ -399,7 +399,7 @@    <|>    ((pRegExpr regex_'5b'5e'5c'5b'5c'7b'5d'2b >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Label")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Label") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Label")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","LabelOption") =   (((pString False "\\(" >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","MathMode"))@@ -414,14 +414,14 @@    <|>    ((pRegExpr regex_'5cs'2a'5c'5d'5cs'2a >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","LabelOption")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","LabelOption") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","LabelOption")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","LabelParameter") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'5cs'2a'5c'7d'5cs'2a >>= withAttribute NormalTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","LabelParameter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","LabelParameter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","LabelParameter")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","FancyLabel") =   (((pRegExpr regex_'5cs'2a'5c'7b'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FancyLabelParameter"))@@ -437,7 +437,7 @@    <|>    ((pRegExpr regex_'5cs'2a'5c'7d'5cs'2a >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FancyLabelParameter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FancyLabelParameter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FancyLabelParameter")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","FancyLabelRoundBrackets") =   (((pString False "\\(" >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","MathMode"))@@ -452,14 +452,14 @@    <|>    ((pRegExpr regex_'5cs'2a'5c'29'5cs'2a >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FancyLabelRoundBrackets")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FancyLabelRoundBrackets") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FancyLabelRoundBrackets")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","FindEndEnvironment") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","EndEnvironment"))    <|>    ((pRegExpr regex_'5cS >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FindEndEnvironment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FindEndEnvironment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FindEndEnvironment")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","EndEnvironment") =   (((pRegExpr regex_'5ba'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","EndLatexEnv"))@@ -468,7 +468,7 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute AlertTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","EndEnvironment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","EndEnvironment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","EndEnvironment")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","EndLatexEnv") =   (((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext >> popContext >> popContext))@@ -479,14 +479,14 @@    <|>    ((pRegExpr regex_'5ba'2dzA'2dZ'5d >>= withAttribute AlertTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","EndLatexEnv")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","EndLatexEnv") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","EndLatexEnv")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","FindBeginEnvironment") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","BeginEnvironment"))    <|>    ((pRegExpr regex_'5cS >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","FindBeginEnvironment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","FindBeginEnvironment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","FindBeginEnvironment")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","BeginEnvironment") =   (((pRegExpr regex_'28lstlisting'7c'28B'7cL'29'3fVerbatim'29 >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","VerbatimEnvParam"))@@ -509,7 +509,7 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5cxd7'5d >>= withAttribute AlertTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","BeginEnvironment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","BeginEnvironment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","BeginEnvironment")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","LatexEnv") =   (((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext >> popContext >> popContext))@@ -520,7 +520,7 @@    <|>    ((parseRules ("LaTeX","EnvCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","LatexEnv")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","LatexEnv") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","LatexEnv")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","VerbatimEnv") =   (((pDetectChar False '}' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","Verbatim"))@@ -538,14 +538,14 @@    <|>    ((pDetectChar False ']' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","Verbatim"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","VerbatimEnvParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","VerbatimEnvParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","VerbatimEnvParam")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Verbatim") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'5c'5cend'28'3f'3d'5cs'2a'5c'7b'28verbatim'7clstlisting'7cboxedverbatim'7c'28B'7cL'29'3fVerbatim'29'5c'2a'3f'5c'7d'29 >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","VerbFindEnd"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Verbatim")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Verbatim") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Verbatim")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","VerbFindEnd") =   (((pRegExpr regex_'5cs'2a'5c'7b >>= withAttribute NormalTok))@@ -570,7 +570,7 @@    <|>    ((pRegExpr regex_'5c'5cend'28'3f'3d'5cs'2a'5c'7bcomment'5c'2a'3f'5c'7d'29 >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","CommFindEnd"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","BlockComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","BlockComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","BlockComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("LaTeX","CommFindEnd") =   (((pRegExpr regex_'5cs'2a'5c'7b >>= withAttribute NormalTok))@@ -588,7 +588,7 @@    <|>    ((parseRules ("LaTeX","EnvCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathEnv")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathEnv") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathEnv")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathEnvParam") =   (((pRegExpr regex_'5c'7d'5c'7b'5b'5e'5c'7d'5d'2a'5c'7d >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","MathModeEnv"))@@ -599,7 +599,7 @@    <|>    ((parseRules ("LaTeX","EnvCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathEnvParam")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathEnvParam") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathEnvParam")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","EnvCommon") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))@@ -610,7 +610,7 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5cxd7'5d'5b'5e'5c'7d'5d'2a >>= withAttribute AlertTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","EnvCommon")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","EnvCommon") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","EnvCommon")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeEnv") =   (((pRegExpr regex_'5c'5cbegin'28'3f'3d'5b'5ea'2dzA'2dZ'5d'29 >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","FindBeginEnvironment"))@@ -641,7 +641,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'25'5cs'2aEND'2e'2a'24 >>= withAttribute RegionMarkerTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEnv")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeEnv") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEnv")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathFindEnd") =   (((pRegExpr regex_'5cs'2a'5c'7b >>= withAttribute NormalTok))@@ -670,7 +670,7 @@    <|>    ((parseRules ("LaTeX","Normal Text")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Tab")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Tab") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Tab")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Column Separator") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","Column Separator"))@@ -679,7 +679,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Column Separator")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Column Separator") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Column Separator")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","TabFindEnd") =   (((pRegExpr regex_'5cs'2a'5c'7b >>= withAttribute NormalTok))@@ -701,7 +701,7 @@    <|>    ((parseRules ("LaTeX","MathModeCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathMode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathMode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathMode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeDisplay") =   (((pString False "$$" >>= withAttribute NormalTok) >>~ (popContext))@@ -714,7 +714,7 @@    <|>    ((parseRules ("LaTeX","MathModeCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeDisplay")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeDisplay") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeDisplay")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeEquation") =   (((pDetect2Chars False '\\' ']' >>= withAttribute NormalTok) >>~ (popContext))@@ -727,7 +727,7 @@    <|>    ((parseRules ("LaTeX","MathModeCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEquation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeEquation") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEquation")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeEnsure") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","MathModeEnsure"))@@ -736,7 +736,7 @@    <|>    ((parseRules ("LaTeX","MathModeCommon")))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEnsure")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeEnsure") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeEnsure")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeCommon") =   (((pRegExpr regex_'5c'5c'28begin'7cend'29'5cs'2a'5c'7b'28equation'7cdisplaymath'7ceqnarray'7csubeqnarray'7cmath'7cmultline'7cgather'7calign'7cflalign'7calignat'7cxalignat'7cxxalignat'7cIEEEeqnarray'29'5c'2a'3f'5c'7d >>= withAttribute AlertTok))@@ -757,7 +757,7 @@    <|>    ((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeCommon")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeCommon") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeCommon")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathContrSeq") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))@@ -766,12 +766,12 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeText") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("LaTeX","MathModeTextParameterStart"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeText")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeText") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeText")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeTextParameterStart") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute NormalTok))@@ -786,7 +786,7 @@    <|>    ((pDetectChar False '%' >>= withAttribute CommentTok) >>~ pushContext ("LaTeX","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeTextParameterStart")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeTextParameterStart") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeTextParameterStart")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","MathModeTextParameter") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute NormalTok))@@ -799,14 +799,14 @@    <|>    ((pDetectChar False '%' >>= withAttribute CommentTok) >>~ pushContext ("LaTeX","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeTextParameter")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","MathModeTextParameter") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","MathModeTextParameter")) >> pDefault >>= withAttribute NormalTok))  parseRules ("LaTeX","Multiline Comment") =   (((pString False "\\fi" >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pString False "\\else" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Multiline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Multiline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Multiline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("LaTeX","Comment") =   (((pRegExpr regex_'28FIXME'7cTODO'29'3a'3f >>= withAttribute AlertTok))@@ -815,7 +815,7 @@    <|>    ((pString False "\\KateResetHL" >>= withAttribute CommentTok) >>~ pushContext ("LaTeX","Normal Text"))    <|>-   (currentContext >>= \x -> guard (x == ("LaTeX","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("LaTeX","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("LaTeX","Comment")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("LaTeX","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Lex.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,29 +41,32 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Lex/Flex","Pre Start") -> return ()-    ("Lex/Flex","Definitions") -> return ()-    ("Lex/Flex","Rules") -> return ()-    ("Lex/Flex","User Code") -> return ()-    ("Lex/Flex","Percent Command") -> (popContext) >> pEndLine-    ("Lex/Flex","Comment") -> return ()-    ("Lex/Flex","Definition RegExpr") -> (popContext) >> pEndLine-    ("Lex/Flex","Rule RegExpr") -> (popContext) >> pEndLine-    ("Lex/Flex","RegExpr (") -> return ()-    ("Lex/Flex","RegExpr [") -> return ()-    ("Lex/Flex","RegExpr {") -> return ()-    ("Lex/Flex","RegExpr Q") -> return ()-    ("Lex/Flex","RegExpr Base") -> return ()-    ("Lex/Flex","Start Conditions Scope") -> return ()-    ("Lex/Flex","Action") -> (popContext) >> pEndLine-    ("Lex/Flex","Detect C") -> return ()-    ("Lex/Flex","Indented C") -> (popContext) >> pEndLine-    ("Lex/Flex","Lex C Bloc") -> return ()-    ("Lex/Flex","Lex Rule C Bloc") -> return ()-    ("Lex/Flex","Normal C Bloc") -> return ()-    ("Lex/Flex","Action C") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Lex/Flex","Pre Start") -> return ()+      ("Lex/Flex","Definitions") -> return ()+      ("Lex/Flex","Rules") -> return ()+      ("Lex/Flex","User Code") -> return ()+      ("Lex/Flex","Percent Command") -> (popContext) >> pEndLine+      ("Lex/Flex","Comment") -> return ()+      ("Lex/Flex","Definition RegExpr") -> (popContext) >> pEndLine+      ("Lex/Flex","Rule RegExpr") -> (popContext) >> pEndLine+      ("Lex/Flex","RegExpr (") -> return ()+      ("Lex/Flex","RegExpr [") -> return ()+      ("Lex/Flex","RegExpr {") -> return ()+      ("Lex/Flex","RegExpr Q") -> return ()+      ("Lex/Flex","RegExpr Base") -> return ()+      ("Lex/Flex","Start Conditions Scope") -> return ()+      ("Lex/Flex","Action") -> (popContext) >> pEndLine+      ("Lex/Flex","Detect C") -> return ()+      ("Lex/Flex","Indented C") -> (popContext) >> pEndLine+      ("Lex/Flex","Lex C Bloc") -> return ()+      ("Lex/Flex","Lex Rule C Bloc") -> return ()+      ("Lex/Flex","Normal C Bloc") -> return ()+      ("Lex/Flex","Action C") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -85,12 +87,10 @@ regex_'5c'7c'5cs'2a'24 = compileRegex "\\|\\s*$" regex_'5cs = compileRegex "\\s" -defaultAttributes = [(("Lex/Flex","Pre Start"),NormalTok),(("Lex/Flex","Definitions"),NormalTok),(("Lex/Flex","Rules"),NormalTok),(("Lex/Flex","User Code"),NormalTok),(("Lex/Flex","Percent Command"),KeywordTok),(("Lex/Flex","Comment"),CommentTok),(("Lex/Flex","Definition RegExpr"),StringTok),(("Lex/Flex","Rule RegExpr"),StringTok),(("Lex/Flex","RegExpr ("),StringTok),(("Lex/Flex","RegExpr ["),StringTok),(("Lex/Flex","RegExpr {"),StringTok),(("Lex/Flex","RegExpr Q"),StringTok),(("Lex/Flex","RegExpr Base"),StringTok),(("Lex/Flex","Start Conditions Scope"),NormalTok),(("Lex/Flex","Action"),NormalTok),(("Lex/Flex","Detect C"),NormalTok),(("Lex/Flex","Indented C"),NormalTok),(("Lex/Flex","Lex C Bloc"),NormalTok),(("Lex/Flex","Lex Rule C Bloc"),NormalTok),(("Lex/Flex","Normal C Bloc"),NormalTok),(("Lex/Flex","Action C"),NormalTok)]- parseRules ("Lex/Flex","Pre Start") =   (((lookAhead (pRegExpr regex_'2e) >> pushContext ("Lex/Flex","Definitions") >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Pre Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Pre Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Pre Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Definitions") =   (((parseRules ("Lex/Flex","Detect C")))@@ -103,7 +103,7 @@    <|>    ((pColumn 0 >> pRegExpr regex_'5bA'2dZa'2dz'5f'5d'5cw'2a'5cs'2b >>= withAttribute DataTypeTok) >>~ pushContext ("Lex/Flex","Definition RegExpr"))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Definitions")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Definitions") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Definitions")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Rules") =   (((parseRules ("Lex/Flex","Detect C")))@@ -115,15 +115,15 @@ parseRules ("Lex/Flex","User Code") =   (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","User Code")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","User Code") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","User Code")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Percent Command") =-  (currentContext >>= \x -> guard (x == ("Lex/Flex","Percent Command")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Percent Command") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Lex/Flex","Percent Command")) >> pDefault >>= withAttribute KeywordTok)  parseRules ("Lex/Flex","Comment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Lex/Flex","Definition RegExpr") =   (((parseRules ("Lex/Flex","RegExpr Base")))@@ -132,7 +132,7 @@    <|>    ((pRegExpr regex_'2e'2a >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Definition RegExpr")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Definition RegExpr") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Definition RegExpr")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","Rule RegExpr") =   (((pRegExpr regex_'5c'7b'24 >>= withAttribute BaseNTok) >>~ pushContext ("Lex/Flex","Start Conditions Scope"))@@ -143,7 +143,7 @@    <|>    ((pRegExpr regex_'5cs'2b >>= withAttribute NormalTok) >>~ pushContext ("Lex/Flex","Action"))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Rule RegExpr")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Rule RegExpr") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Rule RegExpr")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","RegExpr (") =   (((parseRules ("Lex/Flex","RegExpr Base")))@@ -152,7 +152,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr (")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","RegExpr (") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr (")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","RegExpr [") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))@@ -161,7 +161,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr [")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","RegExpr [") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr [")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","RegExpr {") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))@@ -170,7 +170,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr {")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","RegExpr {") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr {")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","RegExpr Q") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))@@ -179,7 +179,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr Q")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","RegExpr Q") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr Q")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","RegExpr Base") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))@@ -192,7 +192,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Lex/Flex","RegExpr Q"))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr Base")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","RegExpr Base") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","RegExpr Base")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lex/Flex","Start Conditions Scope") =   (((pRegExpr regex_'5cs'2a'5c'7d >>= withAttribute BaseNTok) >>~ (popContext))@@ -213,26 +213,26 @@    <|>    ((pColumn 0 >> pDetect2Chars False '%' '{' >>= withAttribute BaseNTok) >>~ pushContext ("Lex/Flex","Lex C Bloc"))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Detect C")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Detect C") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Detect C")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Indented C") =   (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Indented C")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Indented C") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Indented C")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Lex C Bloc") =   (((pColumn 0 >> pDetect2Chars False '%' '}' >>= withAttribute BaseNTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Lex C Bloc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Lex C Bloc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Lex C Bloc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Lex Rule C Bloc") =   (((pDetect2Chars False '%' '}' >>= withAttribute BaseNTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Lex Rule C Bloc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Lex Rule C Bloc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Lex Rule C Bloc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Normal C Bloc") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("Lex/Flex","Normal C Bloc"))@@ -241,7 +241,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Normal C Bloc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Normal C Bloc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Normal C Bloc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lex/Flex","Action C") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("Lex/Flex","Normal C Bloc"))@@ -250,7 +250,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Lex/Flex","Action C")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lex/Flex","Action C") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lex/Flex","Action C")) >> pDefault >>= withAttribute NormalTok))  parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression 
Text/Highlighting/Kate/Syntax/LiterateHaskell.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,14 +41,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Literate Haskell","text") -> return ()-    ("Literate Haskell","normal") -> (popContext) >> pEndLine-    ("Literate Haskell","normals") -> return ()-    ("Literate Haskell","comments'") -> pushContext ("Literate Haskell","uncomments") >> return ()-    ("Literate Haskell","uncomments") -> return ()-    ("Literate Haskell","recomments") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Literate Haskell","text") -> return ()+      ("Literate Haskell","normal") -> (popContext) >> pEndLine+      ("Literate Haskell","normals") -> return ()+      ("Literate Haskell","comments'") -> pushContext ("Literate Haskell","uncomments") >> return ()+      ("Literate Haskell","uncomments") -> return ()+      ("Literate Haskell","recomments") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -60,8 +62,6 @@  regex_'5c'7b'2d'5b'5e'23'5d = compileRegex "\\{-[^#]" -defaultAttributes = [(("Literate Haskell","text"),NormalTok),(("Literate Haskell","normal"),NormalTok),(("Literate Haskell","normals"),NormalTok),(("Literate Haskell","comments'"),CommentTok),(("Literate Haskell","uncomments"),NormalTok),(("Literate Haskell","recomments"),CommentTok)]- parseRules ("Literate Haskell","text") =   (((pColumn 0 >> pDetectChar False '>' >>= withAttribute OtherTok) >>~ pushContext ("Literate Haskell","normal"))    <|>@@ -71,14 +71,14 @@    <|>    ((pString False "\\begin{spec}" >>= withAttribute NormalTok) >>~ pushContext ("Literate Haskell","normals"))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Literate Haskell","normal") =   (((pRegExpr regex_'5c'7b'2d'5b'5e'23'5d >>= withAttribute CommentTok) >>~ pushContext ("Literate Haskell","comments'"))    <|>    ((Text.Highlighting.Kate.Syntax.Haskell.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Literate Haskell","normals") =   (((pString False "\\end{code}" >>= withAttribute NormalTok) >>~ (popContext))@@ -87,24 +87,24 @@    <|>    ((Text.Highlighting.Kate.Syntax.Haskell.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","normals")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","normals") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","normals")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Literate Haskell","comments'") =   (((pDetect2Chars False '-' '}' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","comments'")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","comments'") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","comments'")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Literate Haskell","uncomments") =   (((pColumn 0 >> pDetectChar False '>' >>= withAttribute OtherTok) >>~ pushContext ("Literate Haskell","recomments"))    <|>    ((pColumn 0 >> pDetectChar False '<' >>= withAttribute OtherTok) >>~ pushContext ("Literate Haskell","recomments"))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","uncomments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","uncomments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","uncomments")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Literate Haskell","recomments") =   (((pDetect2Chars False '-' '}' >>= withAttribute CommentTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Literate Haskell","recomments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Literate Haskell","recomments") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Literate Haskell","recomments")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Haskell", _) = Text.Highlighting.Kate.Syntax.Haskell.parseExpression 
Text/Highlighting/Kate/Syntax/Lua.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,16 +42,19 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Lua","Base") -> pushContext ("Lua","Normal") >> return ()-    ("Lua","Normal") -> return ()-    ("Lua","Comment") -> (popContext) >> pEndLine-    ("Lua","Block Comment") -> return ()-    ("Lua","String_single") -> pushContext ("Lua","Error") >> return ()-    ("Lua","String_double") -> pushContext ("Lua","Error") >> return ()-    ("Lua","String_block") -> return ()-    ("Lua","Error") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Lua","Base") -> pushContext ("Lua","Normal") >> return ()+      ("Lua","Normal") -> return ()+      ("Lua","Comment") -> (popContext) >> pEndLine+      ("Lua","Block Comment") -> return ()+      ("Lua","String_single") -> pushContext ("Lua","Error") >> return ()+      ("Lua","String_double") -> pushContext ("Lua","Error") >> return ()+      ("Lua","String_block") -> return ()+      ("Lua","Error") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -82,8 +84,6 @@ regex_'5c'5c'28a'7cb'7cf'7cn'7cr'7ct'7cv'7c'5c'5c'7c'22'7c'5c'27'7c'5b'7c'5d'29 = compileRegex "\\\\(a|b|f|n|r|t|v|\\\\|\"|\\'|[|])" regex_'5c'5c'5babfnrtv'27'22'5c'5c'5c'5b'5c'5d'5d = compileRegex "\\\\[abfnrtv'\"\\\\\\[\\]]" -defaultAttributes = [(("Lua","Base"),CommentTok),(("Lua","Normal"),NormalTok),(("Lua","Comment"),CommentTok),(("Lua","Block Comment"),CommentTok),(("Lua","String_single"),StringTok),(("Lua","String_double"),StringTok),(("Lua","String_block"),StringTok),(("Lua","Error"),ErrorTok)]- parseRules ("Lua","Base") =   (((pColumn 0 >> pRegExpr regex_'23'21'2e'2a'24 >>= withAttribute CommentTok) >>~ pushContext ("Lua","Normal"))    <|>@@ -152,14 +152,14 @@    <|>    ((pAnyChar "[]().=~+-*/^><#;" >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Lua","Comment") =   (((pDetect2Chars False '-' '-' >>= withAttribute AlertTok))    <|>    ((pKeyword " \n\t():!+,-<=>%&*/;?[]^{|}~\\\"" list_attention >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Lua","Block Comment") =   (((pRegExprDynamic "\\]%1\\]" >>= withAttribute CommentTok) >>~ (popContext))@@ -168,31 +168,31 @@    <|>    ((pKeyword " \n\t():!+,-<=>%&*/;?[]^{|}~\\\"" list_attention >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","Block Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","Block Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","Block Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Lua","String_single") =   (((pRegExpr regex_'5c'5c'28a'7cb'7cf'7cn'7cr'7ct'7cv'7c'5c'5c'7c'22'7c'5c'27'7c'5b'7c'5d'29 >>= withAttribute OtherTok))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","String_single")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","String_single") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","String_single")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lua","String_double") =   (((pRegExpr regex_'5c'5c'5babfnrtv'27'22'5c'5c'5c'5b'5c'5d'5d >>= withAttribute OtherTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","String_double")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","String_double") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","String_double")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lua","String_block") =   (((pRegExpr regex_'5c'5c'28a'7cb'7cf'7cn'7cr'7ct'7cv'7c'5c'5c'7c'22'7c'5c'27'7c'5b'7c'5d'29 >>= withAttribute OtherTok))    <|>    ((pRegExprDynamic "\\]%1\\]" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Lua","String_block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","String_block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Lua","String_block")) >> pDefault >>= withAttribute StringTok))  parseRules ("Lua","Error") =-  (currentContext >>= \x -> guard (x == ("Lua","Error")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Lua","Error") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Lua","Error")) >> pDefault >>= withAttribute ErrorTok)  parseRules ("DoxygenLua", _) = Text.Highlighting.Kate.Syntax.Doxygenlua.parseExpression 
Text/Highlighting/Kate/Syntax/Makefile.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,18 +41,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Makefile","Normal") -> return ()-    ("Makefile","String") -> (popContext) >> pEndLine-    ("Makefile","Value") -> (popContext) >> pEndLine-    ("Makefile","VarFromValue(") -> return ()-    ("Makefile","VarFromValue{") -> return ()-    ("Makefile","VarFromNormal(") -> return ()-    ("Makefile","VarFromNormal{") -> return ()-    ("Makefile","FunctionCall(") -> return ()-    ("Makefile","FunctionCall{") -> return ()-    ("Makefile","Commands") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Makefile","Normal") -> return ()+      ("Makefile","String") -> (popContext) >> pEndLine+      ("Makefile","Value") -> (popContext) >> pEndLine+      ("Makefile","VarFromValue(") -> return ()+      ("Makefile","VarFromValue{") -> return ()+      ("Makefile","VarFromNormal(") -> return ()+      ("Makefile","VarFromNormal{") -> return ()+      ("Makefile","FunctionCall(") -> return ()+      ("Makefile","FunctionCall{") -> return ()+      ("Makefile","Commands") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -71,8 +73,6 @@ regex_'40'5b'2d'5f'5cd'5cw'5d'2a'40 = compileRegex "@[-_\\d\\w]*@" regex_'5b'5f'5cw'2d'5d'2a'5cb = compileRegex "[_\\w-]*\\b" -defaultAttributes = [(("Makefile","Normal"),NormalTok),(("Makefile","String"),StringTok),(("Makefile","Value"),StringTok),(("Makefile","VarFromValue("),DataTypeTok),(("Makefile","VarFromValue{"),DataTypeTok),(("Makefile","VarFromNormal("),DataTypeTok),(("Makefile","VarFromNormal{"),DataTypeTok),(("Makefile","FunctionCall("),StringTok),(("Makefile","FunctionCall{"),StringTok),(("Makefile","Commands"),NormalTok)]- parseRules ("Makefile","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -98,14 +98,14 @@    <|>    ((pRegExpr regex_'23'2e'2a'24 >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Makefile","String") =   (((pLineContinue >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Makefile","Value") =   (((pLineContinue >>= withAttribute CharTok))@@ -118,31 +118,31 @@    <|>    ((pDetectChar False ';' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","Value")) >> pDefault >>= withAttribute StringTok))  parseRules ("Makefile","VarFromValue(") =   (((pDetectChar False ')' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","VarFromValue(")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","VarFromValue(") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","VarFromValue(")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Makefile","VarFromValue{") =   (((pDetectChar False '}' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","VarFromValue{")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","VarFromValue{") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","VarFromValue{")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Makefile","VarFromNormal(") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_functions >>= withAttribute KeywordTok) >>~ pushContext ("Makefile","FunctionCall("))    <|>    ((pDetectChar False ')' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","VarFromNormal(")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","VarFromNormal(") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","VarFromNormal(")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Makefile","VarFromNormal{") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_functions >>= withAttribute KeywordTok) >>~ pushContext ("Makefile","FunctionCall{"))    <|>    ((pDetectChar False '}' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","VarFromNormal{")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","VarFromNormal{") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","VarFromNormal{")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Makefile","FunctionCall(") =   (((pDetect2Chars False '$' '{' >>= withAttribute CharTok) >>~ pushContext ("Makefile","VarFromNormal{"))@@ -151,7 +151,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute CharTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","FunctionCall(")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","FunctionCall(") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","FunctionCall(")) >> pDefault >>= withAttribute StringTok))  parseRules ("Makefile","FunctionCall{") =   (((pDetect2Chars False '$' '{' >>= withAttribute CharTok) >>~ pushContext ("Makefile","VarFromNormal{"))@@ -160,7 +160,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute CharTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","FunctionCall{")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","FunctionCall{") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","FunctionCall{")) >> pDefault >>= withAttribute StringTok))  parseRules ("Makefile","Commands") =   (((pDetect2Chars False '$' '{' >>= withAttribute CharTok) >>~ pushContext ("Makefile","VarFromNormal{"))@@ -169,7 +169,7 @@    <|>    ((pRegExpr regex_'5b'5f'5cw'2d'5d'2a'5cb >>= withAttribute BaseNTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Makefile","Commands")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Makefile","Commands") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Makefile","Commands")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Makefile","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Mandoc.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,11 +41,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Troff Mandoc","Normal") -> return ()-    ("Troff Mandoc","DetectDirective") -> (popContext) >> pEndLine-    ("Troff Mandoc","Directive") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Troff Mandoc","Normal") -> return ()+      ("Troff Mandoc","DetectDirective") -> (popContext) >> pEndLine+      ("Troff Mandoc","Directive") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -60,8 +62,6 @@ list_others = Set.fromList $ words $ "DT"  -defaultAttributes = [(("Troff Mandoc","Normal"),NormalTok),(("Troff Mandoc","DetectDirective"),FunctionTok),(("Troff Mandoc","Directive"),StringTok)]- parseRules ("Troff Mandoc","Normal") =   (((parseRules ("Troff Mandoc","DetectComments##Roff")))    <|>@@ -69,7 +69,7 @@    <|>    ((parseRules ("Troff Mandoc","DetectOthers##Roff")))    <|>-   (currentContext >>= \x -> guard (x == ("Troff Mandoc","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Troff Mandoc","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Troff Mandoc","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Troff Mandoc","DetectDirective") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_headings >>= withAttribute KeywordTok) >>~ pushContext ("Troff Mandoc","Directive"))@@ -82,12 +82,12 @@    <|>    ((parseRules ("Troff Mandoc","DetectDirective##Roff")))    <|>-   (currentContext >>= \x -> guard (x == ("Troff Mandoc","DetectDirective")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Troff Mandoc","DetectDirective") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Troff Mandoc","DetectDirective")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Troff Mandoc","Directive") =   (((parseRules ("Troff Mandoc","Directive##Roff")))    <|>-   (currentContext >>= \x -> guard (x == ("Troff Mandoc","Directive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Troff Mandoc","Directive") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Troff Mandoc","Directive")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("Troff Mandoc","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Matlab.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,10 +41,13 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Matlab","_normal") -> (popContext) >> pEndLine-    ("Matlab","_adjoint") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Matlab","_normal") -> (popContext) >> pEndLine+      ("Matlab","_adjoint") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -67,8 +69,6 @@ regex_'28'5cd'2b'28'5c'2e'5cd'2b'29'3f'7c'5c'2e'5cd'2b'29'28'5beE'5d'5b'2b'2d'5d'3f'5cd'2b'29'3f'5bij'5d'3f = compileRegex "(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?" regex_'27'2b = compileRegex "'+" -defaultAttributes = [(("Matlab","_normal"),NormalTok),(("Matlab","_adjoint"),NormalTok)]- parseRules ("Matlab","_normal") =   (((pRegExpr regex_'5ba'2dzA'2dZ'5d'5cw'2a'28'3f'3d'27'29 >>= withAttribute NormalTok) >>~ pushContext ("Matlab","_adjoint"))    <|>@@ -118,12 +118,12 @@    <|>    ((pAnyChar "*+-/\\&|<>~^=,;:@" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Matlab","_normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Matlab","_normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Matlab","_normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Matlab","_adjoint") =   (((pRegExpr regex_'27'2b >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Matlab","_adjoint")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Matlab","_adjoint") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Matlab","_adjoint")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Matlab","_normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Maxima.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,11 +41,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Maxima","Normal Text") -> (popContext) >> pEndLine-    ("Maxima","String") -> return ()-    ("Maxima","Comment") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Maxima","Normal Text") -> (popContext) >> pEndLine+      ("Maxima","String") -> return ()+      ("Maxima","Comment") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -65,8 +67,6 @@ regex_'5b'2d'2b'5d'3f'5cd'2b'5bBbDdEeSs'5d'5b'2d'2b'5d'3f'5cd'2b = compileRegex "[-+]?\\d+[BbDdEeSs][-+]?\\d+" regex_'5b'2d'2b'5d'3f'5cd'2b = compileRegex "[-+]?\\d+" -defaultAttributes = [(("Maxima","Normal Text"),NormalTok),(("Maxima","String"),StringTok),(("Maxima","Comment"),NormalTok)]- parseRules ("Maxima","Normal Text") =   (((pKeyword " \n\t.():!+,-<=>&*/;?[]^{|}~\\@#" list_MaximaFunction >>= withAttribute FunctionTok))    <|>@@ -90,12 +90,12 @@    <|>    ((pDetectChar False '\'' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Maxima","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Maxima","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Maxima","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Maxima","String") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Maxima","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Maxima","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Maxima","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Maxima","Comment") =   (((pKeyword " \n\t.():!+,-<=>&*/;?[]^{|}~\\@#" list_SpecialComment >>= withAttribute NormalTok))@@ -104,7 +104,7 @@    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Maxima","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Maxima","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Maxima","Comment")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Maxima","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Metafont.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,18 +41,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Metapost/Metafont","Normal Text") -> return ()-    ("Metapost/Metafont","string") -> return ()-    ("Metapost/Metafont","TeXMode") -> return ()-    ("Metapost/Metafont","ContrSeq") -> (popContext) >> pEndLine-    ("Metapost/Metafont","ToEndOfLine") -> (popContext) >> pEndLine-    ("Metapost/Metafont","Verb") -> (popContext >> popContext) >> pEndLine-    ("Metapost/Metafont","VerbEnd") -> (popContext >> popContext >> popContext) >> pEndLine-    ("Metapost/Metafont","MathMode") -> return ()-    ("Metapost/Metafont","MathContrSeq") -> (popContext) >> pEndLine-    ("Metapost/Metafont","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Metapost/Metafont","Normal Text") -> return ()+      ("Metapost/Metafont","string") -> return ()+      ("Metapost/Metafont","TeXMode") -> return ()+      ("Metapost/Metafont","ContrSeq") -> (popContext) >> pEndLine+      ("Metapost/Metafont","ToEndOfLine") -> (popContext) >> pEndLine+      ("Metapost/Metafont","Verb") -> (popContext >> popContext) >> pEndLine+      ("Metapost/Metafont","VerbEnd") -> (popContext >> popContext >> popContext) >> pEndLine+      ("Metapost/Metafont","MathMode") -> return ()+      ("Metapost/Metafont","MathContrSeq") -> (popContext) >> pEndLine+      ("Metapost/Metafont","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -106,8 +108,6 @@ regex_'5ba'2dzA'2dZ'5d'2b'5c'2a'3f = compileRegex "[a-zA-Z]+\\*?" regex_'28FIXME'7cTODO'29'3a'3f = compileRegex "(FIXME|TODO):?" -defaultAttributes = [(("Metapost/Metafont","Normal Text"),NormalTok),(("Metapost/Metafont","string"),StringTok),(("Metapost/Metafont","TeXMode"),NormalTok),(("Metapost/Metafont","ContrSeq"),NormalTok),(("Metapost/Metafont","ToEndOfLine"),NormalTok),(("Metapost/Metafont","Verb"),NormalTok),(("Metapost/Metafont","VerbEnd"),NormalTok),(("Metapost/Metafont","MathMode"),NormalTok),(("Metapost/Metafont","MathContrSeq"),NormalTok),(("Metapost/Metafont","Comment"),CommentTok)]- parseRules ("Metapost/Metafont","Normal Text") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_mfBoolExp >>= withAttribute KeywordTok))    <|>@@ -197,7 +197,7 @@    <|>    ((pRegExpr regex_'5cbendfor'5cb >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","string") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -208,7 +208,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Metapost/Metafont","TeXMode") =   (((pDetectChar False '\\' >>= withAttribute NormalTok) >>~ pushContext ("Metapost/Metafont","ContrSeq"))@@ -219,7 +219,7 @@    <|>    ((pRegExpr regex_'5cbetex'5cb >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","TeXMode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","TeXMode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","TeXMode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","ContrSeq") =   (((pString False "verb*" >>= withAttribute NormalTok) >>~ pushContext ("Metapost/Metafont","Verb"))@@ -232,15 +232,15 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","ContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","ContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","ContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","ToEndOfLine") =-  (currentContext >>= \x -> guard (x == ("Metapost/Metafont","ToEndOfLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","ToEndOfLine") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Metapost/Metafont","ToEndOfLine")) >> pDefault >>= withAttribute NormalTok)  parseRules ("Metapost/Metafont","Verb") =   (((pRegExprDynamic "(.)" >>= withAttribute NormalTok) >>~ pushContext ("Metapost/Metafont","VerbEnd"))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Verb")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","Verb") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Verb")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","VerbEnd") =   (((pString True "%1" >>= withAttribute NormalTok) >>~ (popContext >> popContext >> popContext))@@ -249,7 +249,7 @@    <|>    ((pRegExprDynamic "[^%1\\xd7]*" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","VerbEnd")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","VerbEnd") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","VerbEnd")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","MathMode") =   (((pString False "$$" >>= withAttribute AlertTok))@@ -262,7 +262,7 @@    <|>    ((pDetect2Chars False '\\' ']' >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","MathMode")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","MathMode") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","MathMode")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","MathContrSeq") =   (((pDetectChar False '\215' >>= withAttribute NormalTok))@@ -271,14 +271,14 @@    <|>    ((pRegExpr regex_'5b'5ea'2dzA'2dZ'5d >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","MathContrSeq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","MathContrSeq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","MathContrSeq")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Metapost/Metafont","Comment") =   (((pRegExpr regex_'28FIXME'7cTODO'29'3a'3f >>= withAttribute AlertTok))    <|>    ((pDetectChar False '\215' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Metapost/Metafont","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Metapost/Metafont","Comment")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("Metapost/Metafont","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Mips.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,10 +41,13 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("MIPS Assembler","normal") -> return ()-    ("MIPS Assembler","string") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("MIPS Assembler","normal") -> return ()+      ("MIPS Assembler","string") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -67,8 +69,6 @@ regex_'5b'5cw'5f'5c'2e'5d'2b'3a = compileRegex "[\\w_\\.]+:" regex_'5c'5c'2e = compileRegex "\\\\." -defaultAttributes = [(("MIPS Assembler","normal"),NormalTok),(("MIPS Assembler","string"),StringTok)]- parseRules ("MIPS Assembler","normal") =   (((pKeyword " \n\t():!+,-<=>%&*/;?[]^{|}~\\" list_hardware >>= withAttribute KeywordTok))    <|>@@ -102,14 +102,14 @@    <|>    ((pInt >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("MIPS Assembler","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("MIPS Assembler","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("MIPS Assembler","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("MIPS Assembler","string") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute CharTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("MIPS Assembler","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("MIPS Assembler","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("MIPS Assembler","string")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("MIPS Assembler","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Modula2.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,14 +41,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Modula-2","Normal") -> return ()-    ("Modula-2","String1") -> (popContext) >> pEndLine-    ("Modula-2","String2") -> (popContext) >> pEndLine-    ("Modula-2","Comment2") -> return ()-    ("Modula-2","Comment3") -> (popContext) >> pEndLine-    ("Modula-2","Prep1") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Modula-2","Normal") -> return ()+      ("Modula-2","String1") -> (popContext) >> pEndLine+      ("Modula-2","String2") -> (popContext) >> pEndLine+      ("Modula-2","Comment2") -> return ()+      ("Modula-2","Comment3") -> (popContext) >> pEndLine+      ("Modula-2","Prep1") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -62,8 +64,6 @@ list_types = Set.fromList $ words $ "INTEGER CARDINAL SHORTINT SHORTCARD LONGINT LONGREAL CHAR BOOLEAN POINTER ADDRESS ADR REAL File"  -defaultAttributes = [(("Modula-2","Normal"),NormalTok),(("Modula-2","String1"),StringTok),(("Modula-2","String2"),StringTok),(("Modula-2","Comment2"),CommentTok),(("Modula-2","Comment3"),CommentTok),(("Modula-2","Prep1"),OtherTok)]- parseRules ("Modula-2","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -83,30 +83,30 @@    <|>    ((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("Modula-2","Comment2"))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-2","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-2","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Modula-2","String1") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-2","String1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","String1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-2","String1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Modula-2","String2") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-2","String2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","String2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-2","String2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Modula-2","Comment2") =   (((pDetect2Chars False '*' ')' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-2","Comment2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","Comment2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-2","Comment2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Modula-2","Comment3") =-  (currentContext >>= \x -> guard (x == ("Modula-2","Comment3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","Comment3") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Modula-2","Comment3")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Modula-2","Prep1") =   (((pString False "$*)" >>= withAttribute OtherTok) >>~ pushContext ("Modula-2","Prep1"))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-2","Prep1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-2","Prep1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-2","Prep1")) >> pDefault >>= withAttribute OtherTok))   parseRules x = parseRules ("Modula-2","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Modula3.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,12 +41,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Modula-3","Normal") -> return ()-    ("Modula-3","String1") -> (popContext) >> pEndLine-    ("Modula-3","Comment2") -> return ()-    ("Modula-3","Prep1") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Modula-3","Normal") -> return ()+      ("Modula-3","String1") -> (popContext) >> pEndLine+      ("Modula-3","Comment2") -> return ()+      ("Modula-3","Prep1") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -70,8 +72,6 @@ regex_'5cb'28'5b'5c'2b'7c'5c'2d'5d'7b0'2c1'7d'5b0'2d9'5d'7b1'2c'7d'7c'28'5b2'2d9'5d'7c1'5b0'2d6'5d'29'5c'5f'5b0'2d9A'2dFa'2df'5d'7b1'2c'7d'29'5cb = compileRegex "\\b([\\+|\\-]{0,1}[0-9]{1,}|([2-9]|1[0-6])\\_[0-9A-Fa-f]{1,})\\b" regex_'5c'27'28'2e'7c'5c'5c'5bntrf'5c'5c'27'22'5d'7c'5c'5c'5b0'2d7'5d'7b3'7d'29'5c'27 = compileRegex "\\'(.|\\\\[ntrf\\\\'\"]|\\\\[0-7]{3})\\'" -defaultAttributes = [(("Modula-3","Normal"),NormalTok),(("Modula-3","String1"),StringTok),(("Modula-3","Comment2"),CommentTok),(("Modula-3","Prep1"),OtherTok)]- parseRules ("Modula-3","Normal") =   (((pRegExpr regex_PROCEDURE'5b'5cs'5d'2e'2a'5c'28 >>= withAttribute KeywordTok))    <|>@@ -105,24 +105,24 @@    <|>    ((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("Modula-3","Comment2"))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-3","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-3","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-3","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Modula-3","String1") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-3","String1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-3","String1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-3","String1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Modula-3","Comment2") =   (((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("Modula-3","Comment2"))    <|>    ((pDetect2Chars False '*' ')' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-3","Comment2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-3","Comment2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-3","Comment2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Modula-3","Prep1") =   (((pDetect2Chars False '*' '>' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Modula-3","Prep1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Modula-3","Prep1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Modula-3","Prep1")) >> pDefault >>= withAttribute OtherTok))   parseRules x = parseRules ("Modula-3","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Monobasic.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,11 +41,14 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("MonoBasic","Normal") -> return ()-    ("MonoBasic","String") -> (popContext) >> pEndLine-    ("MonoBasic","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("MonoBasic","Normal") -> return ()+      ("MonoBasic","String") -> (popContext) >> pEndLine+      ("MonoBasic","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -99,8 +101,6 @@ regex_'23If'2e'2a'24 = compileRegex "#If.*$" regex_'23End'2eIf'2e'2a'24 = compileRegex "#End.If.*$" -defaultAttributes = [(("MonoBasic","Normal"),NormalTok),(("MonoBasic","String"),StringTok),(("MonoBasic","Comment"),CommentTok)]- parseRules ("MonoBasic","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -192,7 +192,7 @@    <|>    ((pRegExpr regex_'23End'2eIf'2e'2a'24 >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("MonoBasic","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("MonoBasic","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("MonoBasic","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("MonoBasic","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -201,10 +201,10 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("MonoBasic","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("MonoBasic","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("MonoBasic","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("MonoBasic","Comment") =-  (currentContext >>= \x -> guard (x == ("MonoBasic","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("MonoBasic","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("MonoBasic","Comment")) >> pDefault >>= withAttribute CommentTok)   parseRules x = parseRules ("MonoBasic","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Nasm.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,12 +41,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Intel x86 (NASM)","Normal") -> return ()-    ("Intel x86 (NASM)","Comment") -> (popContext) >> pEndLine-    ("Intel x86 (NASM)","Preprocessor") -> (popContext) >> pEndLine-    ("Intel x86 (NASM)","String") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Intel x86 (NASM)","Normal") -> return ()+      ("Intel x86 (NASM)","Comment") -> (popContext) >> pEndLine+      ("Intel x86 (NASM)","Preprocessor") -> (popContext) >> pEndLine+      ("Intel x86 (NASM)","String") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -66,8 +68,6 @@ regex_'28'5e'7c'5b_'5ct'2c'5d'2b'29'28'28'5c'24'7c0x'29'7b1'7d'5b0'2d9'5d'2b'5ba'2df0'2d9'5d'2a'7c'5b0'2d9'5d'2b'5ba'2df0'2d9'5d'2ah'29'28'5b_'5ct'2c'5d'2b'7c'24'29 = compileRegex "(^|[ \\t,]+)((\\$|0x){1}[0-9]+[a-f0-9]*|[0-9]+[a-f0-9]*h)([ \\t,]+|$)" regex_'28'5e'7c'5b_'5ct'2c'5d'2b'29'28'5b0'2d7'5d'2b'28q'7co'29'7c'5b01'5d'2bb'29'28'5b_'5ct'2c'5d'2b'7c'24'29 = compileRegex "(^|[ \\t,]+)([0-7]+(q|o)|[01]+b)([ \\t,]+|$)" -defaultAttributes = [(("Intel x86 (NASM)","Normal"),NormalTok),(("Intel x86 (NASM)","Comment"),CommentTok),(("Intel x86 (NASM)","Preprocessor"),OtherTok),(("Intel x86 (NASM)","String"),StringTok)]- parseRules ("Intel x86 (NASM)","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_registers >>= withAttribute KeywordTok))    <|>@@ -105,18 +105,18 @@    <|>    ((pHlCChar >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Intel x86 (NASM)","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Intel x86 (NASM)","Comment") =-  (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Intel x86 (NASM)","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Intel x86 (NASM)","Preprocessor") =-  (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Intel x86 (NASM)","Preprocessor") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","Preprocessor")) >> pDefault >>= withAttribute OtherTok)  parseRules ("Intel x86 (NASM)","String") =   (((pAnyChar "\"'" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Intel x86 (NASM)","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Intel x86 (NASM)","String")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("Intel x86 (NASM)","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Noweb.hs view
@@ -11,7 +11,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -43,12 +42,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("noweb","RawDocumentation") -> return ()-    ("noweb","CodeQuote") -> return ()-    ("noweb","CodeSection") -> return ()-    ("noweb","SectionNames") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("noweb","RawDocumentation") -> return ()+      ("noweb","CodeQuote") -> return ()+      ("noweb","CodeSection") -> return ()+      ("noweb","SectionNames") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -64,8 +66,6 @@ regex_'40'3c'3c = compileRegex "@<<" regex_'3c'3c'2e'2a'5b'5e'40'5d'3e'3e'28'3f'21'3d'29 = compileRegex "<<.*[^@]>>(?!=)" -defaultAttributes = [(("noweb","RawDocumentation"),NormalTok),(("noweb","CodeQuote"),NormalTok),(("noweb","CodeSection"),NormalTok),(("noweb","SectionNames"),NormalTok)]- parseRules ("noweb","RawDocumentation") =   (((pColumn 0 >> pRegExpr regex_'3c'3c'2e'2a'3e'3e'3d'24 >>= withAttribute RegionMarkerTok) >>~ pushContext ("noweb","CodeSection"))    <|>@@ -75,7 +75,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("noweb","RawDocumentation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("noweb","RawDocumentation") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("noweb","RawDocumentation")) >> pDefault >>= withAttribute NormalTok))  parseRules ("noweb","CodeQuote") =   (((pDetect2Chars False '@' ']' >>= withAttribute NormalTok))@@ -86,7 +86,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("noweb","CodeQuote")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("noweb","CodeQuote") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("noweb","CodeQuote")) >> pDefault >>= withAttribute NormalTok))  parseRules ("noweb","CodeSection") =   (((pColumn 0 >> pRegExpr regex_'40'24 >>= withAttribute RegionMarkerTok) >>~ pushContext ("noweb","RawDocumentation"))@@ -99,14 +99,14 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("noweb","CodeSection")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("noweb","CodeSection") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("noweb","CodeSection")) >> pDefault >>= withAttribute NormalTok))  parseRules ("noweb","SectionNames") =   (((pRegExpr regex_'40'3c'3c >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'3c'3c'2e'2a'5b'5e'40'5d'3e'3e'28'3f'21'3d'29 >>= withAttribute RegionMarkerTok))    <|>-   (currentContext >>= \x -> guard (x == ("noweb","SectionNames")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("noweb","SectionNames") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("noweb","SectionNames")) >> pDefault >>= withAttribute NormalTok))  parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression
Text/Highlighting/Kate/Syntax/Objectivec.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,14 +42,17 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Objective-C","Default") -> return ()-    ("Objective-C","String") -> (popContext) >> pEndLine-    ("Objective-C","SingleLineComment") -> (popContext) >> pEndLine-    ("Objective-C","MultiLineComment") -> return ()-    ("Objective-C","Preprocessor") -> pushContext ("Objective-C","Default") >> return ()-    ("Objective-C","MultiLineCommentPrep") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Objective-C","Default") -> return ()+      ("Objective-C","String") -> (popContext) >> pEndLine+      ("Objective-C","SingleLineComment") -> (popContext) >> pEndLine+      ("Objective-C","MultiLineComment") -> return ()+      ("Objective-C","Preprocessor") -> pushContext ("Objective-C","Default") >> return ()+      ("Objective-C","MultiLineCommentPrep") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -63,8 +65,6 @@  regex_'23 = compileRegex "#" -defaultAttributes = [(("Objective-C","Default"),NormalTok),(("Objective-C","String"),StringTok),(("Objective-C","SingleLineComment"),CommentTok),(("Objective-C","MultiLineComment"),CommentTok),(("Objective-C","Preprocessor"),OtherTok),(("Objective-C","MultiLineCommentPrep"),CommentTok)]- parseRules ("Objective-C","Default") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -110,7 +110,7 @@    <|>    ((pDetect2Chars False '@' '"' >>= withAttribute StringTok) >>~ pushContext ("Objective-C","String"))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C","Default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","Default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C","Default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective-C","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -119,15 +119,15 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Objective-C","SingleLineComment") =-  (currentContext >>= \x -> guard (x == ("Objective-C","SingleLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","SingleLineComment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Objective-C","SingleLineComment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Objective-C","MultiLineComment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok))@@ -142,12 +142,12 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C","MultiLineCommentPrep"))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Objective-C","MultiLineCommentPrep") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C","MultiLineCommentPrep")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C","MultiLineCommentPrep") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C","MultiLineCommentPrep")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression 
Text/Highlighting/Kate/Syntax/Objectivecpp.hs view
@@ -11,7 +11,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -44,21 +43,24 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Objective-C++","Default") -> return ()-    ("Objective-C++","String") -> (popContext) >> pEndLine-    ("Objective-C++","SingleLineComment") -> (popContext) >> pEndLine-    ("Objective-C++","MultiLineComment") -> return ()-    ("Objective-C++","Preprocessor") -> pushContext ("Objective-C++","Default") >> return ()-    ("Objective-C++","MultiLineCommentPrep") -> return ()-    ("Objective-C++","Region Marker") -> (popContext) >> pEndLine-    ("Objective-C++","Commentar 1") -> (popContext) >> pEndLine-    ("Objective-C++","Commentar 2") -> return ()-    ("Objective-C++","Preprocessor") -> (popContext) >> pEndLine-    ("Objective-C++","Define") -> (popContext) >> pEndLine-    ("Objective-C++","Outscoped") -> return ()-    ("Objective-C++","Outscoped intern") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Objective-C++","Default") -> return ()+      ("Objective-C++","String") -> (popContext) >> pEndLine+      ("Objective-C++","SingleLineComment") -> (popContext) >> pEndLine+      ("Objective-C++","MultiLineComment") -> return ()+      ("Objective-C++","Preprocessor") -> pushContext ("Objective-C++","Default") >> return ()+      ("Objective-C++","MultiLineCommentPrep") -> return ()+      ("Objective-C++","Region Marker") -> (popContext) >> pEndLine+      ("Objective-C++","Commentar 1") -> (popContext) >> pEndLine+      ("Objective-C++","Commentar 2") -> return ()+      ("Objective-C++","Preprocessor") -> (popContext) >> pEndLine+      ("Objective-C++","Define") -> (popContext) >> pEndLine+      ("Objective-C++","Outscoped") -> return ()+      ("Objective-C++","Outscoped intern") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -78,8 +80,6 @@ regex_'23'5cs'2a'28endif'7celse'7celif'29 = compileRegex "#\\s*(endif|else|elif)" regex_'23'5cs'2aendif = compileRegex "#\\s*endif" -defaultAttributes = [(("Objective-C++","Default"),NormalTok),(("Objective-C++","String"),StringTok),(("Objective-C++","SingleLineComment"),CommentTok),(("Objective-C++","MultiLineComment"),CommentTok),(("Objective-C++","Preprocessor"),OtherTok),(("Objective-C++","MultiLineCommentPrep"),CommentTok),(("Objective-C++","Region Marker"),RegionMarkerTok),(("Objective-C++","Commentar 1"),CommentTok),(("Objective-C++","Commentar 2"),CommentTok),(("Objective-C++","Preprocessor"),OtherTok),(("Objective-C++","Define"),OtherTok),(("Objective-C++","Outscoped"),CommentTok),(("Objective-C++","Outscoped intern"),CommentTok)]- parseRules ("Objective-C++","Default") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -149,7 +149,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]{|}~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective-C++","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -158,15 +158,15 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Objective-C++","SingleLineComment") =-  (currentContext >>= \x -> guard (x == ("Objective-C++","SingleLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","SingleLineComment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Objective-C++","SingleLineComment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Objective-C++","MultiLineComment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C++","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok))@@ -181,7 +181,7 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","MultiLineCommentPrep"))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Objective-C++","MultiLineCommentPrep") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -190,10 +190,10 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","MultiLineCommentPrep")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","MultiLineCommentPrep") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","MultiLineCommentPrep")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C++","Region Marker") =-  (currentContext >>= \x -> guard (x == ("Objective-C++","Region Marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Region Marker") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Objective-C++","Region Marker")) >> pDefault >>= withAttribute RegionMarkerTok)  parseRules ("Objective-C++","Commentar 1") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -202,7 +202,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C++","Commentar 2") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -213,7 +213,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C++","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok))@@ -232,12 +232,12 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","MultiLineCommentPrep"))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Objective-C++","Define") =   (((pLineContinue >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Define")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Define") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Define")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Objective-C++","Outscoped") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -258,7 +258,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2a'28endif'7celse'7celif'29 >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Outscoped")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Outscoped") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Outscoped")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective-C++","Outscoped intern") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -279,7 +279,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective-C++","Outscoped intern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective-C++","Outscoped intern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective-C++","Outscoped intern")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression
Text/Highlighting/Kate/Syntax/Ocaml.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,18 +41,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Objective Caml","Normal") -> return ()-    ("Objective Caml","Multiline Comment") -> return ()-    ("Objective Caml","String Constant") -> return ()-    ("Objective Caml","Block") -> return ()-    ("Objective Caml","Sig") -> return ()-    ("Objective Caml","Struct") -> return ()-    ("Objective Caml","Object") -> return ()-    ("Objective Caml","ModuleEnv") -> return ()-    ("Objective Caml","ModuleEnv2") -> return ()-    ("Objective Caml","Camlp4 Quotation Constant") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Objective Caml","Normal") -> return ()+      ("Objective Caml","Multiline Comment") -> return ()+      ("Objective Caml","String Constant") -> return ()+      ("Objective Caml","Block") -> return ()+      ("Objective Caml","Sig") -> return ()+      ("Objective Caml","Struct") -> return ()+      ("Objective Caml","Object") -> return ()+      ("Objective Caml","ModuleEnv") -> return ()+      ("Objective Caml","ModuleEnv2") -> return ()+      ("Objective Caml","Camlp4 Quotation Constant") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -91,8 +93,6 @@ regex_'5c'5c'28'5c'5c'7c'3e'3e'7c'3c'3c'29 = compileRegex "\\\\(\\\\|>>|<<)" regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c = compileRegex "\\\\<:[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*<" -defaultAttributes = [(("Objective Caml","Normal"),NormalTok),(("Objective Caml","Multiline Comment"),CommentTok),(("Objective Caml","String Constant"),StringTok),(("Objective Caml","Block"),NormalTok),(("Objective Caml","Sig"),NormalTok),(("Objective Caml","Struct"),NormalTok),(("Objective Caml","Object"),NormalTok),(("Objective Caml","ModuleEnv"),NormalTok),(("Objective Caml","ModuleEnv2"),NormalTok),(("Objective Caml","Camlp4 Quotation Constant"),StringTok)]- parseRules ("Objective Caml","Normal") =   (((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("Objective Caml","Multiline Comment"))    <|>@@ -160,14 +160,14 @@    <|>    ((pRegExpr regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","Multiline Comment") =   (((pDetect2Chars False '*' ')' >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pDetect2Chars False '(' '*' >>= withAttribute CommentTok) >>~ pushContext ("Objective Caml","Multiline Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Multiline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Multiline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Multiline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Objective Caml","String Constant") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))@@ -176,35 +176,35 @@    <|>    ((pRegExpr regex_'5c'5c'24 >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","String Constant")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","String Constant") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","String Constant")) >> pDefault >>= withAttribute StringTok))  parseRules ("Objective Caml","Block") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Objective Caml","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Block")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Block") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Block")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","Sig") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Objective Caml","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Sig")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Sig") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Sig")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","Struct") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Objective Caml","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Struct")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Struct") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Struct")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","Object") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Objective Caml","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Object")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Object") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Object")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","ModuleEnv") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -222,7 +222,7 @@    <|>    ((pString False "." >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","ModuleEnv2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","ModuleEnv2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","ModuleEnv2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Objective Caml","Camlp4 Quotation Constant") =   (((pDetect2Chars False '>' '>' >>= withAttribute StringTok) >>~ (popContext))@@ -235,7 +235,7 @@    <|>    ((pRegExpr regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Objective Caml","Camlp4 Quotation Constant")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Objective Caml","Camlp4 Quotation Constant") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Objective Caml","Camlp4 Quotation Constant")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("Objective Caml","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Octave.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,10 +41,13 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Octave","_normal") -> return ()-    ("Octave","_adjoint") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Octave","_normal") -> return ()+      ("Octave","_adjoint") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -87,8 +89,6 @@ regex_'28'5cd'2b'28'5c'2e'5cd'2b'29'3f'7c'5c'2e'5cd'2b'29'28'5beE'5d'5b'2b'2d'5d'3f'5cd'2b'29'3f'5bij'5d'3f = compileRegex "(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?" regex_'27'2b = compileRegex "'+" -defaultAttributes = [(("Octave","_normal"),NormalTok),(("Octave","_adjoint"),NormalTok)]- parseRules ("Octave","_normal") =   (((pRegExpr regex_'5cb'28for'29'5cb >>= withAttribute NormalTok))    <|>@@ -190,12 +190,12 @@    <|>    ((pAnyChar "!\"%(*+,/;=>[]|~#&)-:<>\\^" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Octave","_normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Octave","_normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Octave","_normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Octave","_adjoint") =   (((pRegExpr regex_'27'2b >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Octave","_adjoint")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Octave","_adjoint") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Octave","_adjoint")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Octave","_normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Pascal.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,18 +41,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Pascal","Normal") -> return ()-    ("Pascal","CharNum") -> (popContext) >> pEndLine-    ("Pascal","HexCharNum") -> (popContext) >> pEndLine-    ("Pascal","Hex") -> (popContext) >> pEndLine-    ("Pascal","String") -> (popContext) >> pEndLine-    ("Pascal","Prep1") -> (popContext) >> pEndLine-    ("Pascal","Prep2") -> (popContext) >> pEndLine-    ("Pascal","Comment1") -> return ()-    ("Pascal","Comment2") -> return ()-    ("Pascal","Comment3") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Pascal","Normal") -> return ()+      ("Pascal","CharNum") -> (popContext) >> pEndLine+      ("Pascal","HexCharNum") -> (popContext) >> pEndLine+      ("Pascal","Hex") -> (popContext) >> pEndLine+      ("Pascal","String") -> (popContext) >> pEndLine+      ("Pascal","Prep1") -> (popContext) >> pEndLine+      ("Pascal","Prep2") -> (popContext) >> pEndLine+      ("Pascal","Comment1") -> return ()+      ("Pascal","Comment2") -> return ()+      ("Pascal","Comment3") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -72,8 +74,6 @@ regex_'5b'5e0'2d9'5d = compileRegex "[^0-9]" regex_'5b'5ea'2dfA'2dF0'2d9'5d = compileRegex "[^a-fA-F0-9]" -defaultAttributes = [(("Pascal","Normal"),NormalTok),(("Pascal","CharNum"),StringTok),(("Pascal","HexCharNum"),BaseNTok),(("Pascal","Hex"),BaseNTok),(("Pascal","String"),StringTok),(("Pascal","Prep1"),OtherTok),(("Pascal","Prep2"),OtherTok),(("Pascal","Comment1"),CommentTok),(("Pascal","Comment2"),CommentTok),(("Pascal","Comment3"),CommentTok)]- parseRules ("Pascal","Normal") =   (((pRegExpr regex_'5cb'28begin'7ccase'7crecord'29'28'3f'3d'28'5c'7b'5b'5e'7d'5d'2a'28'5c'7d'7c'24'29'7c'5c'28'5c'2a'2e'2a'28'5c'2a'5c'29'7c'24'29'29'2a'28'5b'5cs'5d'7c'24'7c'2f'2f'29'29 >>= withAttribute KeywordTok))    <|>@@ -107,58 +107,58 @@    <|>    ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Pascal","Comment3"))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Pascal","CharNum") =   (((pDetectChar False '$' >>= withAttribute BaseNTok) >>~ pushContext ("Pascal","HexCharNum"))    <|>    ((pRegExpr regex_'5b'5e0'2d9'5d >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","CharNum")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","CharNum") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","CharNum")) >> pDefault >>= withAttribute StringTok))  parseRules ("Pascal","HexCharNum") =   (((pRegExpr regex_'5b'5ea'2dfA'2dF0'2d9'5d >>= withAttribute BaseNTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","HexCharNum")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","HexCharNum") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","HexCharNum")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("Pascal","Hex") =   (((pRegExpr regex_'5b'5ea'2dfA'2dF0'2d9'5d >>= withAttribute BaseNTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Hex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Hex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Hex")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("Pascal","String") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Pascal","Prep1") =   (((pDetect2Chars False '*' ')' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Prep1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Prep1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Prep1")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Pascal","Prep2") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Prep2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Prep2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Prep2")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Pascal","Comment1") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attention >>= withAttribute AlertTok))    <|>    ((pDetectChar False '}' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Comment1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Comment1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Comment1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Pascal","Comment2") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attention >>= withAttribute AlertTok))    <|>    ((pDetect2Chars False '*' ')' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Comment2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Comment2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Comment2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Pascal","Comment3") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_attention >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Pascal","Comment3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pascal","Comment3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pascal","Comment3")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("Pascal","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Perl.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,73 +42,76 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Perl","normal") -> return ()-    ("Perl","find_quoted") -> return ()-    ("Perl","find_qqx") -> return ()-    ("Perl","find_qw") -> return ()-    ("Perl","ipstring_internal") -> return ()-    ("Perl","ip_string") -> return ()-    ("Perl","ip_string_2") -> return ()-    ("Perl","ip_string_3") -> return ()-    ("Perl","ip_string_4") -> return ()-    ("Perl","ip_string_5") -> return ()-    ("Perl","ip_string_6") -> return ()-    ("Perl","string") -> return ()-    ("Perl","string_2") -> return ()-    ("Perl","string_3") -> return ()-    ("Perl","string_4") -> return ()-    ("Perl","string_5") -> return ()-    ("Perl","string_6") -> return ()-    ("Perl","find_subst") -> return ()-    ("Perl","subst_curlybrace_pattern") -> return ()-    ("Perl","subst_curlybrace_middle") -> return ()-    ("Perl","subst_curlybrace_replace") -> return ()-    ("Perl","subst_curlybrace_replace_recursive") -> return ()-    ("Perl","subst_paren_pattern") -> return ()-    ("Perl","subst_paren_replace") -> return ()-    ("Perl","subst_bracket_pattern") -> return ()-    ("Perl","subst_bracket_replace") -> return ()-    ("Perl","subst_slash_pattern") -> return ()-    ("Perl","subst_slash_replace") -> return ()-    ("Perl","subst_sq_pattern") -> return ()-    ("Perl","subst_sq_replace") -> return ()-    ("Perl","tr") -> (popContext) >> pEndLine-    ("Perl","find_pattern") -> return ()-    ("Perl","pattern_slash") -> return ()-    ("Perl","pattern") -> return ()-    ("Perl","pattern_brace") -> return ()-    ("Perl","pattern_bracket") -> return ()-    ("Perl","pattern_paren") -> return ()-    ("Perl","pattern_sq") -> return ()-    ("Perl","regex_pattern_internal_rules_1") -> return ()-    ("Perl","regex_pattern_internal_rules_2") -> return ()-    ("Perl","regex_pattern_internal") -> return ()-    ("Perl","regex_pattern_internal_ip") -> return ()-    ("Perl","pat_ext") -> return ()-    ("Perl","pat_char_class") -> return ()-    ("Perl","find_variable") -> (popContext) >> pEndLine-    ("Perl","find_variable_unsafe") -> (popContext) >> pEndLine-    ("Perl","var_detect") -> (popContext >> popContext) >> pEndLine-    ("Perl","var_detect_unsafe") -> (popContext >> popContext) >> pEndLine-    ("Perl","var_detect_rules") -> (popContext >> popContext) >> pEndLine-    ("Perl","quote_word") -> return ()-    ("Perl","quote_word_paren") -> return ()-    ("Perl","quote_word_brace") -> return ()-    ("Perl","quote_word_bracket") -> return ()-    ("Perl","find_here_document") -> (popContext) >> pEndLine-    ("Perl","here_document") -> return ()-    ("Perl","here_document_dumb") -> return ()-    ("Perl","data_handle") -> return ()-    ("Perl","end_handle") -> return ()-    ("Perl","Backticked") -> return ()-    ("Perl","slash_safe_escape") -> (popContext) >> pEndLine-    ("Perl","package_qualified_blank") -> return ()-    ("Perl","sub_name_def") -> (popContext) >> pEndLine-    ("Perl","sub_arg_definition") -> return ()-    ("Perl","pod") -> return ()-    ("Perl","comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Perl","normal") -> return ()+      ("Perl","find_quoted") -> return ()+      ("Perl","find_qqx") -> return ()+      ("Perl","find_qw") -> return ()+      ("Perl","ipstring_internal") -> return ()+      ("Perl","ip_string") -> return ()+      ("Perl","ip_string_2") -> return ()+      ("Perl","ip_string_3") -> return ()+      ("Perl","ip_string_4") -> return ()+      ("Perl","ip_string_5") -> return ()+      ("Perl","ip_string_6") -> return ()+      ("Perl","string") -> return ()+      ("Perl","string_2") -> return ()+      ("Perl","string_3") -> return ()+      ("Perl","string_4") -> return ()+      ("Perl","string_5") -> return ()+      ("Perl","string_6") -> return ()+      ("Perl","find_subst") -> return ()+      ("Perl","subst_curlybrace_pattern") -> return ()+      ("Perl","subst_curlybrace_middle") -> return ()+      ("Perl","subst_curlybrace_replace") -> return ()+      ("Perl","subst_curlybrace_replace_recursive") -> return ()+      ("Perl","subst_paren_pattern") -> return ()+      ("Perl","subst_paren_replace") -> return ()+      ("Perl","subst_bracket_pattern") -> return ()+      ("Perl","subst_bracket_replace") -> return ()+      ("Perl","subst_slash_pattern") -> return ()+      ("Perl","subst_slash_replace") -> return ()+      ("Perl","subst_sq_pattern") -> return ()+      ("Perl","subst_sq_replace") -> return ()+      ("Perl","tr") -> (popContext) >> pEndLine+      ("Perl","find_pattern") -> return ()+      ("Perl","pattern_slash") -> return ()+      ("Perl","pattern") -> return ()+      ("Perl","pattern_brace") -> return ()+      ("Perl","pattern_bracket") -> return ()+      ("Perl","pattern_paren") -> return ()+      ("Perl","pattern_sq") -> return ()+      ("Perl","regex_pattern_internal_rules_1") -> return ()+      ("Perl","regex_pattern_internal_rules_2") -> return ()+      ("Perl","regex_pattern_internal") -> return ()+      ("Perl","regex_pattern_internal_ip") -> return ()+      ("Perl","pat_ext") -> return ()+      ("Perl","pat_char_class") -> return ()+      ("Perl","find_variable") -> (popContext) >> pEndLine+      ("Perl","find_variable_unsafe") -> (popContext) >> pEndLine+      ("Perl","var_detect") -> (popContext >> popContext) >> pEndLine+      ("Perl","var_detect_unsafe") -> (popContext >> popContext) >> pEndLine+      ("Perl","var_detect_rules") -> (popContext >> popContext) >> pEndLine+      ("Perl","quote_word") -> return ()+      ("Perl","quote_word_paren") -> return ()+      ("Perl","quote_word_brace") -> return ()+      ("Perl","quote_word_bracket") -> return ()+      ("Perl","find_here_document") -> (popContext) >> pEndLine+      ("Perl","here_document") -> return ()+      ("Perl","here_document_dumb") -> return ()+      ("Perl","data_handle") -> return ()+      ("Perl","end_handle") -> return ()+      ("Perl","Backticked") -> return ()+      ("Perl","slash_safe_escape") -> (popContext) >> pEndLine+      ("Perl","package_qualified_blank") -> return ()+      ("Perl","sub_name_def") -> (popContext) >> pEndLine+      ("Perl","sub_arg_definition") -> return ()+      ("Perl","pod") -> return ()+      ("Perl","comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -200,8 +202,6 @@ regex_'5cs'2a'5c'28 = compileRegex "\\s*\\(" regex_'5c'3dcut'2e'2a'24 = compileRegex "\\=cut.*$" -defaultAttributes = [(("Perl","normal"),NormalTok),(("Perl","find_quoted"),NormalTok),(("Perl","find_qqx"),NormalTok),(("Perl","find_qw"),NormalTok),(("Perl","ipstring_internal"),StringTok),(("Perl","ip_string"),StringTok),(("Perl","ip_string_2"),StringTok),(("Perl","ip_string_3"),StringTok),(("Perl","ip_string_4"),StringTok),(("Perl","ip_string_5"),StringTok),(("Perl","ip_string_6"),StringTok),(("Perl","string"),StringTok),(("Perl","string_2"),StringTok),(("Perl","string_3"),StringTok),(("Perl","string_4"),StringTok),(("Perl","string_5"),StringTok),(("Perl","string_6"),StringTok),(("Perl","find_subst"),NormalTok),(("Perl","subst_curlybrace_pattern"),OtherTok),(("Perl","subst_curlybrace_middle"),NormalTok),(("Perl","subst_curlybrace_replace"),StringTok),(("Perl","subst_curlybrace_replace_recursive"),StringTok),(("Perl","subst_paren_pattern"),OtherTok),(("Perl","subst_paren_replace"),StringTok),(("Perl","subst_bracket_pattern"),OtherTok),(("Perl","subst_bracket_replace"),StringTok),(("Perl","subst_slash_pattern"),OtherTok),(("Perl","subst_slash_replace"),StringTok),(("Perl","subst_sq_pattern"),OtherTok),(("Perl","subst_sq_replace"),StringTok),(("Perl","tr"),OtherTok),(("Perl","find_pattern"),OtherTok),(("Perl","pattern_slash"),OtherTok),(("Perl","pattern"),OtherTok),(("Perl","pattern_brace"),OtherTok),(("Perl","pattern_bracket"),OtherTok),(("Perl","pattern_paren"),OtherTok),(("Perl","pattern_sq"),OtherTok),(("Perl","regex_pattern_internal_rules_1"),NormalTok),(("Perl","regex_pattern_internal_rules_2"),NormalTok),(("Perl","regex_pattern_internal"),OtherTok),(("Perl","regex_pattern_internal_ip"),OtherTok),(("Perl","pat_ext"),CharTok),(("Perl","pat_char_class"),BaseNTok),(("Perl","find_variable"),DataTypeTok),(("Perl","find_variable_unsafe"),DataTypeTok),(("Perl","var_detect"),DataTypeTok),(("Perl","var_detect_unsafe"),DataTypeTok),(("Perl","var_detect_rules"),DataTypeTok),(("Perl","quote_word"),NormalTok),(("Perl","quote_word_paren"),NormalTok),(("Perl","quote_word_brace"),NormalTok),(("Perl","quote_word_bracket"),NormalTok),(("Perl","find_here_document"),NormalTok),(("Perl","here_document"),StringTok),(("Perl","here_document_dumb"),NormalTok),(("Perl","data_handle"),NormalTok),(("Perl","end_handle"),CommentTok),(("Perl","Backticked"),StringTok),(("Perl","slash_safe_escape"),NormalTok),(("Perl","package_qualified_blank"),NormalTok),(("Perl","sub_name_def"),NormalTok),(("Perl","sub_arg_definition"),NormalTok),(("Perl","pod"),CommentTok),(("Perl","comment"),CommentTok)]- parseRules ("Perl","normal") =   (((pColumn 0 >> pRegExpr regex_'23'21'5c'2f'2e'2a >>= withAttribute KeywordTok))    <|>@@ -277,7 +277,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","find_quoted") =   (((pRegExpr regex_x'5cs'2a'28'27'29 >>= withAttribute KeywordTok) >>~ pushContext ("Perl","string_6"))@@ -298,7 +298,7 @@    <|>    ((pRegExpr regex_'5cs'2b'23'2e'2a >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_quoted")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_quoted") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_quoted")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","find_qqx") =   (((pDetectChar False '(' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","ip_string_2"))@@ -313,7 +313,7 @@    <|>    ((pRegExpr regex_'5cs'2b'23'2e'2a >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_qqx")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_qqx") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_qqx")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","find_qw") =   (((pDetectChar False '(' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","quote_word_paren"))@@ -326,7 +326,7 @@    <|>    ((pRegExpr regex_'5cs'2b'23'2e'2a >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_qw")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_qw") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_qw")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","ipstring_internal") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -337,14 +337,14 @@    <|>    ((lookAhead (pRegExpr regex_'28'3f'3a'5b'5c'24'40'5d'5cS'7c'25'5b'5cw'7b'5d'29) >> pushContext ("Perl","find_variable_unsafe") >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ipstring_internal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ipstring_internal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ipstring_internal")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string") =   (((pDetectChar False '"' >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string_2") =   (((pRangeDetect '(' ')' >>= withAttribute StringTok))@@ -353,7 +353,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string_3") =   (((pRangeDetect '{' '}' >>= withAttribute StringTok))@@ -362,7 +362,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string_4") =   (((pRangeDetect '[' ']' >>= withAttribute StringTok))@@ -371,7 +371,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string_5") =   (((pRangeDetect '<' '>' >>= withAttribute StringTok))@@ -380,7 +380,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","ip_string_6") =   (((pRegExprDynamic "\\%1" >>= withAttribute StringTok))@@ -389,7 +389,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","ip_string_6")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","ip_string_6") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","ip_string_6")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -400,7 +400,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string_2") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -413,7 +413,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string_3") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -426,7 +426,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string_4") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -439,7 +439,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string_5") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -454,7 +454,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","string_6") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -465,7 +465,7 @@    <|>    ((pDetectChar True '1' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","string_6")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","string_6") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","string_6")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","find_subst") =   (((pRegExpr regex_'5cs'2b'23'2e'2a >>= withAttribute CommentTok))@@ -480,7 +480,7 @@    <|>    ((pRegExpr regex_'28'5b'5e'5cw'5cs'5b'5c'5d'7b'7d'28'29'5d'29 >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_slash_pattern"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_subst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_subst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_subst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","subst_curlybrace_pattern") =   (((pRegExpr regex_'5cs'2b'23'2e'2a'24 >>= withAttribute CommentTok))@@ -489,14 +489,14 @@    <|>    ((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_curlybrace_middle"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_curlybrace_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","subst_curlybrace_middle") =   (((pRegExpr regex_'23'2e'2a'24 >>= withAttribute CommentTok))    <|>    ((pDetectChar False '{' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_curlybrace_replace"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_middle")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_curlybrace_middle") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_middle")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","subst_curlybrace_replace") =   (((parseRules ("Perl","ipstring_internal")))@@ -505,7 +505,7 @@    <|>    ((pRegExpr regex_'5c'7d'5bcegimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_replace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_curlybrace_replace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_replace")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","subst_curlybrace_replace_recursive") =   (((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Perl","subst_curlybrace_replace_recursive"))@@ -514,7 +514,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_replace_recursive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_curlybrace_replace_recursive") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_curlybrace_replace_recursive")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","subst_paren_pattern") =   (((pRegExpr regex_'5cs'2b'23'2e'2a'24 >>= withAttribute CommentTok))@@ -523,7 +523,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_paren_replace"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_paren_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_paren_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_paren_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","subst_paren_replace") =   (((parseRules ("Perl","ipstring_internal")))@@ -532,7 +532,7 @@    <|>    ((pRegExpr regex_'5c'29'5bcegimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_paren_replace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_paren_replace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_paren_replace")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","subst_bracket_pattern") =   (((pRegExpr regex_'5cs'2b'23'2e'2a'24 >>= withAttribute CommentTok))@@ -541,7 +541,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_bracket_replace"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_bracket_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_bracket_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_bracket_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","subst_bracket_replace") =   (((parseRules ("Perl","ipstring_internal")))@@ -550,7 +550,7 @@    <|>    ((pRegExpr regex_'5c'5d'5bcegimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_bracket_replace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_bracket_replace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_bracket_replace")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","subst_slash_pattern") =   (((pRegExprDynamic "\\$(?=%1)" >>= withAttribute CharTok))@@ -559,14 +559,14 @@    <|>    ((parseRules ("Perl","regex_pattern_internal_ip")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_slash_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_slash_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_slash_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","subst_slash_replace") =   (((pRegExprDynamic "%1[cegimosx]*" >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_slash_replace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_slash_replace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_slash_replace")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","subst_sq_pattern") =   (((pRegExpr regex_'5cs'2b'23'2e'2a'24 >>= withAttribute CommentTok))@@ -575,12 +575,12 @@    <|>    ((pDetectChar False '\'' >>= withAttribute KeywordTok) >>~ pushContext ("Perl","subst_sq_replace"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_sq_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_sq_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_sq_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","subst_sq_replace") =   (((pRegExpr regex_'27'5bcegimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","subst_sq_replace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","subst_sq_replace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","subst_sq_replace")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","tr") =   (((pRegExpr regex_'5c'28'5b'5e'29'5d'2a'5c'29'5cs'2a'5c'28'3f'3a'5b'5e'29'5d'2a'5c'29 >>= withAttribute OtherTok) >>~ (popContext))@@ -606,7 +606,7 @@    <|>    ((pRegExpr regex_'28'5b'5e'5cw'5cs'5d'29 >>= withAttribute KeywordTok) >>~ pushContext ("Perl","pattern"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern_slash") =   (((pRegExpr regex_'5c'24'28'3f'3d'2f'29 >>= withAttribute CharTok))@@ -615,7 +615,7 @@    <|>    ((pRegExpr regex_'2f'5bcgimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern_slash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern_slash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern_slash")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern") =   (((pRegExprDynamic "\\$(?=%1)" >>= withAttribute CharTok))@@ -626,35 +626,35 @@    <|>    ((pRegExprDynamic "\\$(?=\\%1)" >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern_brace") =   (((pRegExpr regex_'5c'7d'5bcgimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Perl","regex_pattern_internal_ip")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern_brace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern_brace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern_brace")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern_bracket") =   (((pRegExpr regex_'5c'5d'5bcgimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Perl","regex_pattern_internal_ip")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern_bracket")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern_bracket") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern_bracket")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern_paren") =   (((pRegExpr regex_'5c'29'5bcgimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Perl","regex_pattern_internal_ip")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern_paren")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern_paren") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern_paren")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pattern_sq") =   (((pRegExpr regex_'27'5bcgimosx'5d'2a >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Perl","regex_pattern_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pattern_sq")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pattern_sq") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pattern_sq")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","regex_pattern_internal_rules_1") =   (((pFirstNonSpace >> pRegExpr regex_'23'2e'2a'24 >>= withAttribute CommentTok))@@ -667,7 +667,7 @@    <|>    ((pRegExpr regex_'5c'5c'2e >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_rules_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","regex_pattern_internal_rules_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_rules_1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","regex_pattern_internal_rules_2") =   (((pDetect2Chars False '(' '?' >>= withAttribute CharTok) >>~ pushContext ("Perl","pat_ext"))@@ -682,14 +682,14 @@    <|>    ((pRegExpr regex_'5cs'7b3'2c'7d'23'2e'2a'24 >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_rules_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","regex_pattern_internal_rules_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_rules_2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","regex_pattern_internal") =   (((parseRules ("Perl","regex_pattern_internal_rules_1")))    <|>    ((parseRules ("Perl","regex_pattern_internal_rules_2")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","regex_pattern_internal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","regex_pattern_internal_ip") =   (((parseRules ("Perl","regex_pattern_internal_rules_1")))@@ -698,7 +698,7 @@    <|>    ((parseRules ("Perl","regex_pattern_internal_rules_2")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_ip")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","regex_pattern_internal_ip") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","regex_pattern_internal_ip")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Perl","pat_ext") =   (((pRegExpr regex_'5c'23'5b'5e'29'5d'2a >>= withAttribute CommentTok) >>~ (popContext))@@ -707,7 +707,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pat_ext")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pat_ext") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pat_ext")) >> pDefault >>= withAttribute CharTok))  parseRules ("Perl","pat_char_class") =   (((pDetectChar False '^' >>= withAttribute CharTok))@@ -720,7 +720,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pat_char_class")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pat_char_class") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pat_char_class")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("Perl","find_variable") =   (((pRegExpr regex_'5c'24'5b0'2d9'5d'2b >>= withAttribute DataTypeTok) >>~ pushContext ("Perl","var_detect"))@@ -799,7 +799,7 @@    <|>    ((pDetect2Chars False '-' '-' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","var_detect_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","var_detect_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","var_detect_rules")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Perl","quote_word") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -810,7 +810,7 @@    <|>    ((pDetectChar True '1' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","quote_word")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","quote_word") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","quote_word")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","quote_word_paren") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -821,7 +821,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","quote_word_paren")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","quote_word_paren") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","quote_word_paren")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","quote_word_brace") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -832,7 +832,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","quote_word_brace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","quote_word_brace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","quote_word_brace")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","quote_word_bracket") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -843,7 +843,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","quote_word_bracket")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","quote_word_bracket") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","quote_word_bracket")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","find_here_document") =   (((pRegExpr regex_'28'5cw'2b'29'5cs'2a'3b'3f >>= withAttribute KeywordTok) >>~ pushContext ("Perl","here_document"))@@ -854,7 +854,7 @@    <|>    ((pRegExpr regex_'5cs'2a'27'28'5b'5e'27'5d'2b'29'27'5cs'2a'3b'3f >>= withAttribute KeywordTok) >>~ pushContext ("Perl","here_document_dumb"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","find_here_document")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","find_here_document") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","find_here_document")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","here_document") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -865,7 +865,7 @@    <|>    ((parseRules ("Perl","ipstring_internal")))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","here_document")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","here_document") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","here_document")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","here_document_dumb") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -874,28 +874,28 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","here_document_dumb")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","here_document_dumb") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","here_document_dumb")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","data_handle") =   (((pColumn 0 >> pRegExpr regex_'5c'3d'28'3f'3ahead'5b1'2d6'5d'7cover'7cback'7citem'7cfor'7cbegin'7cend'7cpod'29'5cs'2b'2e'2a >>= withAttribute CommentTok) >>~ pushContext ("Perl","pod"))    <|>    ((pFirstNonSpace >> pString False "__END__" >>= withAttribute KeywordTok) >>~ pushContext ("Perl","normal"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","data_handle")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","data_handle") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","data_handle")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","end_handle") =   (((pColumn 0 >> pRegExpr regex_'5c'3d'28'3f'3ahead'5b1'2d6'5d'7cover'7cback'7citem'7cfor'7cbegin'7cend'7cpod'29'5cs'2a'2e'2a >>= withAttribute CommentTok) >>~ pushContext ("Perl","pod"))    <|>    ((pFirstNonSpace >> pString False "__DATA__" >>= withAttribute KeywordTok) >>~ pushContext ("Perl","data_handle"))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","end_handle")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","end_handle") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","end_handle")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Perl","Backticked") =   (((parseRules ("Perl","ipstring_internal")))    <|>    ((pDetectChar False '`' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","Backticked")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","Backticked") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","Backticked")) >> pDefault >>= withAttribute StringTok))  parseRules ("Perl","slash_safe_escape") =   (((pRegExpr regex_'5cs'2a'5c'7d'5cs'2a'2f'7b1'2c2'7d >>= withAttribute NormalTok) >>~ (popContext))@@ -909,7 +909,7 @@ parseRules ("Perl","package_qualified_blank") =   (((pRegExpr regex_'5b'5cw'5f'5d'2b >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","package_qualified_blank")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","package_qualified_blank") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","package_qualified_blank")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Perl","sub_name_def") =   (((pRegExpr regex_'5cw'2b >>= withAttribute FunctionTok))@@ -940,7 +940,7 @@    <|>    ((pColumn 0 >> pRegExpr regex_'5c'3dcut'2e'2a'24 >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","pod")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","pod") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","pod")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Perl","comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -949,7 +949,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("Perl","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Perl","comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Perl","comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Php.hs view
@@ -15,7 +15,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -48,24 +47,27 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("PHP/PHP","start") -> return ()-    ("PHP/PHP","phpsource") -> return ()-    ("PHP/PHP","ternary") -> return ()-    ("PHP/PHP","case") -> return ()-    ("PHP/PHP","onelinecomment") -> (popContext) >> pEndLine-    ("PHP/PHP","twolinecomment") -> return ()-    ("PHP/PHP","doublebackquotestringcommon") -> return ()-    ("PHP/PHP","backquotestring") -> return ()-    ("PHP/PHP","doublequotestring") -> return ()-    ("PHP/PHP","singlequotestring") -> return ()-    ("PHP/PHP","htmlheredoc") -> return ()-    ("PHP/PHP","cssheredoc") -> return ()-    ("PHP/PHP","mysqlheredoc") -> return ()-    ("PHP/PHP","javascriptheredoc") -> return ()-    ("PHP/PHP","heredoc") -> return ()-    ("PHP/PHP","commonheredoc") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("PHP/PHP","start") -> return ()+      ("PHP/PHP","phpsource") -> return ()+      ("PHP/PHP","ternary") -> return ()+      ("PHP/PHP","case") -> return ()+      ("PHP/PHP","onelinecomment") -> (popContext) >> pEndLine+      ("PHP/PHP","twolinecomment") -> return ()+      ("PHP/PHP","doublebackquotestringcommon") -> return ()+      ("PHP/PHP","backquotestring") -> return ()+      ("PHP/PHP","doublequotestring") -> return ()+      ("PHP/PHP","singlequotestring") -> return ()+      ("PHP/PHP","htmlheredoc") -> return ()+      ("PHP/PHP","cssheredoc") -> return ()+      ("PHP/PHP","mysqlheredoc") -> return ()+      ("PHP/PHP","javascriptheredoc") -> return ()+      ("PHP/PHP","heredoc") -> return ()+      ("PHP/PHP","commonheredoc") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -101,14 +103,12 @@ regex_'5c'7b'5c'24'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5b'5e'22'5d'2a'22'7c'5c'24'5ba'2dzA'2dZ'5d'2a'29'7c'27'5b'5e'27'5d'2a'27'7c'5c'5d'29'2a'28'2d'3e'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'5ba'2dzA'2dZ0'2d9'5f'5d'2a'5c'5d'29'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'29'2a'5c'7d = compileRegex "\\{\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[([0-9]*|\"[^\"]*\"|\\$[a-zA-Z]*)|'[^']*'|\\])*(->[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[[a-zA-Z0-9_]*\\])*(\\[([0-9]*|\"[a-zA-Z_]*\")|'[a-zA-Z_]*'|\\])*)*\\}" regex_'5c'7b'5c'24'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'28'2d'3e'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'5ba'2dzA'2dZ0'2d9'5f'5d'2a'5c'5d'29'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'29'2a'5c'7d = compileRegex "\\{\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[([0-9]*|\"[a-zA-Z_]*\")|'[a-zA-Z_]*'|\\])*(->[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[[a-zA-Z0-9_]*\\])*(\\[([0-9]*|\"[a-zA-Z_]*\")|'[a-zA-Z_]*'|\\])*)*\\}" -defaultAttributes = [(("PHP/PHP","start"),NormalTok),(("PHP/PHP","phpsource"),NormalTok),(("PHP/PHP","ternary"),NormalTok),(("PHP/PHP","case"),NormalTok),(("PHP/PHP","onelinecomment"),CommentTok),(("PHP/PHP","twolinecomment"),CommentTok),(("PHP/PHP","doublebackquotestringcommon"),StringTok),(("PHP/PHP","backquotestring"),StringTok),(("PHP/PHP","doublequotestring"),StringTok),(("PHP/PHP","singlequotestring"),StringTok),(("PHP/PHP","htmlheredoc"),NormalTok),(("PHP/PHP","cssheredoc"),NormalTok),(("PHP/PHP","mysqlheredoc"),NormalTok),(("PHP/PHP","javascriptheredoc"),NormalTok),(("PHP/PHP","heredoc"),StringTok),(("PHP/PHP","commonheredoc"),StringTok)]- parseRules ("PHP/PHP","start") =   (((pRegExpr regex_'3c'5c'3f'28'3f'3a'3d'7cphp'29'3f >>= withAttribute KeywordTok) >>~ pushContext ("PHP/PHP","phpsource"))    <|>    ((pString False "?>" >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","phpsource") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -191,7 +191,7 @@    <|>    ((pAnyChar ";(),[]" >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","phpsource")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","phpsource") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","phpsource")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","ternary") =   (((pDetect2Chars False ':' ':' >>= withAttribute NormalTok))@@ -200,26 +200,26 @@    <|>    ((parseRules ("PHP/PHP","phpsource")))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","ternary")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","ternary") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","ternary")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","case") =   (((parseRules ("PHP/PHP","ternary")))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","case")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","case") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","case")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","onelinecomment") =   (((lookAhead (pString False "?>") >> (popContext) >> currentContext >>= parseRules))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","onelinecomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","onelinecomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","onelinecomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("PHP/PHP","twolinecomment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","twolinecomment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","twolinecomment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","twolinecomment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("PHP/PHP","doublebackquotestringcommon") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute KeywordTok))@@ -246,7 +246,7 @@    <|>    ((pRegExpr regex_'5c'7b'5c'24'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5b'5e'22'5d'2a'22'7c'5c'24'5ba'2dzA'2dZ'5d'2a'29'7c'27'5b'5e'27'5d'2a'27'7c'5c'5d'29'2a'28'2d'3e'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'5ba'2dzA'2dZ0'2d9'5f'5d'2a'5c'5d'29'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'29'2a'5c'7d >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","doublebackquotestringcommon")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","doublebackquotestringcommon") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","doublebackquotestringcommon")) >> pDefault >>= withAttribute StringTok))  parseRules ("PHP/PHP","backquotestring") =   (((parseRules ("PHP/PHP","doublebackquotestringcommon")))@@ -255,7 +255,7 @@    <|>    ((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","backquotestring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","backquotestring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","backquotestring")) >> pDefault >>= withAttribute StringTok))  parseRules ("PHP/PHP","doublequotestring") =   (((parseRules ("PHP/PHP","doublebackquotestringcommon")))@@ -264,7 +264,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","doublequotestring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","doublequotestring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","doublequotestring")) >> pDefault >>= withAttribute StringTok))  parseRules ("PHP/PHP","singlequotestring") =   (((pDetect2Chars False '\\' '\'' >>= withAttribute KeywordTok))@@ -273,7 +273,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","singlequotestring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","singlequotestring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","singlequotestring")) >> pDefault >>= withAttribute StringTok))  parseRules ("PHP/PHP","htmlheredoc") =   (((pColumn 0 >> pRegExprDynamic "%1;?$" >>= withAttribute KeywordTok) >>~ (popContext))@@ -282,7 +282,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Html.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","htmlheredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","htmlheredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","htmlheredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","cssheredoc") =   (((pColumn 0 >> pRegExprDynamic "%1;?$" >>= withAttribute KeywordTok) >>~ (popContext))@@ -291,7 +291,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Css.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","cssheredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","cssheredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","cssheredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","mysqlheredoc") =   (((pColumn 0 >> pRegExprDynamic "%1;?$" >>= withAttribute KeywordTok) >>~ (popContext))@@ -300,7 +300,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.SqlMysql.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","mysqlheredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","mysqlheredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","mysqlheredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","javascriptheredoc") =   (((pColumn 0 >> pRegExprDynamic "%1;?$" >>= withAttribute KeywordTok) >>~ (popContext))@@ -309,14 +309,14 @@    <|>    ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","javascriptheredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","javascriptheredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","javascriptheredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PHP/PHP","heredoc") =   (((pColumn 0 >> pRegExprDynamic "%1;?$" >>= withAttribute KeywordTok) >>~ (popContext))    <|>    ((parseRules ("PHP/PHP","commonheredoc")))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","heredoc")) >> pDefault >>= withAttribute StringTok))  parseRules ("PHP/PHP","commonheredoc") =   (((pRegExpr regex_'5c'24'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'5ba'2dzA'2dZ0'2d9'5f'5d'2a'5c'5d'29'2a >>= withAttribute KeywordTok))@@ -325,7 +325,7 @@    <|>    ((pRegExpr regex_'5c'7b'5c'24'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'28'2d'3e'5ba'2dzA'2dZ'5f'5cx7f'2d'5cxff'5d'5ba'2dzA'2dZ0'2d9'5f'5cx7f'2d'5cxff'5d'2a'28'5c'5b'5ba'2dzA'2dZ0'2d9'5f'5d'2a'5c'5d'29'2a'28'5c'5b'28'5b0'2d9'5d'2a'7c'22'5ba'2dzA'2dZ'5f'5d'2a'22'29'7c'27'5ba'2dzA'2dZ'5f'5d'2a'27'7c'5c'5d'29'2a'29'2a'5c'7d >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("PHP/PHP","commonheredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PHP/PHP","commonheredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PHP/PHP","commonheredoc")) >> pDefault >>= withAttribute StringTok))  parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression
Text/Highlighting/Kate/Syntax/Pike.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,15 +41,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Pike","Normal") -> return ()-    ("Pike","String") -> (popContext) >> pEndLine-    ("Pike","Line Comment") -> (popContext) >> pEndLine-    ("Pike","Block Comment") -> return ()-    ("Pike","Preprocessor") -> (popContext) >> pEndLine-    ("Pike","Outscoped") -> return ()-    ("Pike","Outscoped intern") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Pike","Normal") -> return ()+      ("Pike","String") -> (popContext) >> pEndLine+      ("Pike","Line Comment") -> (popContext) >> pEndLine+      ("Pike","Block Comment") -> return ()+      ("Pike","Preprocessor") -> (popContext) >> pEndLine+      ("Pike","Outscoped") -> return ()+      ("Pike","Outscoped intern") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -71,8 +73,6 @@ regex_'23'5cs'2a'28endif'7celif'7celse'29 = compileRegex "#\\s*(endif|elif|else)" regex_'23'5cs'2aendif = compileRegex "#\\s*endif" -defaultAttributes = [(("Pike","Normal"),NormalTok),(("Pike","String"),StringTok),(("Pike","Line Comment"),CommentTok),(("Pike","Block Comment"),CommentTok),(("Pike","Preprocessor"),OtherTok),(("Pike","Outscoped"),CommentTok),(("Pike","Outscoped intern"),CommentTok)]- parseRules ("Pike","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -110,7 +110,7 @@    <|>    ((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute OtherTok) >>~ pushContext ("Pike","Preprocessor"))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Pike","String") =   (((pRegExpr regex_'5c'5cd'5b0'2d9'5d'2b >>= withAttribute CharTok))@@ -121,19 +121,19 @@    <|>    ((pLineContinue >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Pike","Line Comment") =   (((pRegExpr regex_'28FIXME'7cTODO'7cNOT'28IC'29'3fE'29'3a'3f >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Line Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Line Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Line Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Pike","Block Comment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pRegExpr regex_'28FIXME'7cTODO'7cNOT'28IC'29'3fE'29'3a'3f >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Block Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Block Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Block Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Pike","Preprocessor") =   (((pRangeDetect '"' '"' >>= withAttribute StringTok))@@ -146,7 +146,7 @@    <|>    ((pLineContinue >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Pike","Outscoped") =   (((pRegExpr regex_'28FIXME'7cTODO'7cNOT'28IC'29'3fE'29'3a'3f >>= withAttribute AlertTok))@@ -157,7 +157,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2a'28endif'7celif'7celse'29 >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Outscoped")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Outscoped") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Outscoped")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Pike","Outscoped intern") =   (((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Pike","Block Comment"))@@ -166,7 +166,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aendif >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Pike","Outscoped intern")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Pike","Outscoped intern") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Pike","Outscoped intern")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("Pike","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Postscript.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,12 +41,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("PostScript","Normal") -> return ()-    ("PostScript","Comment") -> (popContext) >> pEndLine-    ("PostScript","Header") -> (popContext) >> pEndLine-    ("PostScript","String") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("PostScript","Normal") -> return ()+      ("PostScript","Comment") -> (popContext) >> pEndLine+      ("PostScript","Header") -> (popContext) >> pEndLine+      ("PostScript","String") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -59,8 +61,6 @@  regex_'5c'2f'7b1'2c2'7d'5b'5e'5cs'5c'28'5c'29'5c'7b'5c'7d'5c'5b'5c'5d'25'2f'5d'2a = compileRegex "\\/{1,2}[^\\s\\(\\)\\{\\}\\[\\]%/]*" -defaultAttributes = [(("PostScript","Normal"),NormalTok),(("PostScript","Comment"),CommentTok),(("PostScript","Header"),OtherTok),(("PostScript","String"),StringTok)]- parseRules ("PostScript","Normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok))    <|>@@ -76,18 +76,18 @@    <|>    ((pRegExpr regex_'5c'2f'7b1'2c2'7d'5b'5e'5cs'5c'28'5c'29'5c'7b'5c'7d'5c'5b'5c'5d'25'2f'5d'2a >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("PostScript","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PostScript","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PostScript","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("PostScript","Comment") =-  (currentContext >>= \x -> guard (x == ("PostScript","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PostScript","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("PostScript","Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("PostScript","Header") =-  (currentContext >>= \x -> guard (x == ("PostScript","Header")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PostScript","Header") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("PostScript","Header")) >> pDefault >>= withAttribute OtherTok)  parseRules ("PostScript","String") =   (((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("PostScript","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("PostScript","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("PostScript","String")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("PostScript","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Prolog.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,13 +41,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Prolog","normal") -> return ()-    ("Prolog","comment") -> (popContext) >> pEndLine-    ("Prolog","string") -> return ()-    ("Prolog","string2") -> return ()-    ("Prolog","comment region") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Prolog","normal") -> return ()+      ("Prolog","comment") -> (popContext) >> pEndLine+      ("Prolog","string") -> return ()+      ("Prolog","string2") -> return ()+      ("Prolog","comment region") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -67,8 +69,6 @@ regex_'5bA'2dZ'5f'5d'5bA'2dZa'2dz0'2d9'5f'5d'2a = compileRegex "[A-Z_][A-Za-z0-9_]*" regex_'5ba'2dz'5d'5bA'2dZa'2dz0'2d9'5f'5d'2a = compileRegex "[a-z][A-Za-z0-9_]*" -defaultAttributes = [(("Prolog","normal"),NormalTok),(("Prolog","comment"),CommentTok),(("Prolog","string"),StringTok),(("Prolog","string2"),StringTok),(("Prolog","comment region"),CommentTok)]- parseRules ("Prolog","normal") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywordl >>= withAttribute KeywordTok))    <|>@@ -98,29 +98,29 @@    <|>    ((pAnyChar "~!^*()-+=[]|\\:;,./?&<>" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Prolog","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Prolog","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Prolog","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Prolog","comment") =-  (currentContext >>= \x -> guard (x == ("Prolog","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Prolog","comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Prolog","comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Prolog","string") =   (((pHlCStringChar >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Prolog","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Prolog","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Prolog","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Prolog","string2") =   (((pHlCChar >>= withAttribute StringTok))    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Prolog","string2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Prolog","string2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Prolog","string2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Prolog","comment region") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Prolog","comment region")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Prolog","comment region") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Prolog","comment region")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("Prolog","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Python.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,25 +42,28 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Python","Normal") -> return ()-    ("Python","CheckForString") -> (popContext) >> pEndLine-    ("Python","parenthesised") -> return ()-    ("Python","Hash comment") -> (popContext) >> pEndLine-    ("Python","Tripple A-comment") -> return ()-    ("Python","Tripple Q-comment") -> return ()-    ("Python","Single A-comment") -> return ()-    ("Python","Single Q-comment") -> return ()-    ("Python","stringformat") -> return ()-    ("Python","Tripple A-string") -> return ()-    ("Python","Raw Tripple A-string") -> return ()-    ("Python","Tripple Q-string") -> return ()-    ("Python","Raw Tripple Q-string") -> return ()-    ("Python","Single A-string") -> return ()-    ("Python","Single Q-string") -> return ()-    ("Python","Raw A-string") -> return ()-    ("Python","Raw Q-string") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Python","Normal") -> return ()+      ("Python","CheckForString") -> (popContext) >> pEndLine+      ("Python","parenthesised") -> return ()+      ("Python","Hash comment") -> (popContext) >> pEndLine+      ("Python","Tripple A-comment") -> return ()+      ("Python","Tripple Q-comment") -> return ()+      ("Python","Single A-comment") -> return ()+      ("Python","Single Q-comment") -> return ()+      ("Python","stringformat") -> return ()+      ("Python","Tripple A-string") -> return ()+      ("Python","Raw Tripple A-string") -> return ()+      ("Python","Tripple Q-string") -> return ()+      ("Python","Raw Tripple Q-string") -> return ()+      ("Python","Single A-string") -> return ()+      ("Python","Single Q-string") -> return ()+      ("Python","Raw A-string") -> return ()+      ("Python","Raw Q-string") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -87,8 +89,6 @@ regex_'40'5b'5fa'2dzA'2dZ'5d'5b'5c'2e'5fa'2dzA'2dZ0'2d9'5d'2a = compileRegex "@[_a-zA-Z][\\._a-zA-Z0-9]*" regex_'25'28'28'5c'28'5ba'2dzA'2dZ0'2d9'5f'5d'2b'5c'29'29'3f'5b'230'5c'2d_'2b'5d'3f'28'5b1'2d9'5d'5b0'2d9'5d'2a'7c'5c'2a'29'3f'28'5c'2e'28'5b1'2d9'5d'5b0'2d9'5d'2a'7c'5c'2a'29'29'3f'5bhlL'5d'3f'5bcrsdiouxXeEfFgG'25'5d'7cprog'7cdefault'29 = compileRegex "%((\\([a-zA-Z0-9_]+\\))?[#0\\- +]?([1-9][0-9]*|\\*)?(\\.([1-9][0-9]*|\\*))?[hlL]?[crsdiouxXeEfFgG%]|prog|default)" -defaultAttributes = [(("Python","Normal"),NormalTok),(("Python","CheckForString"),NormalTok),(("Python","parenthesised"),NormalTok),(("Python","Hash comment"),CommentTok),(("Python","Tripple A-comment"),CommentTok),(("Python","Tripple Q-comment"),CommentTok),(("Python","Single A-comment"),CommentTok),(("Python","Single Q-comment"),CommentTok),(("Python","stringformat"),OtherTok),(("Python","Tripple A-string"),StringTok),(("Python","Raw Tripple A-string"),StringTok),(("Python","Tripple Q-string"),StringTok),(("Python","Raw Tripple Q-string"),StringTok),(("Python","Single A-string"),StringTok),(("Python","Single Q-string"),StringTok),(("Python","Raw A-string"),StringTok),(("Python","Raw Q-string"),StringTok)]- parseRules ("Python","Normal") =   (((pLineContinue >>= withAttribute NormalTok) >>~ pushContext ("Python","CheckForString"))    <|>@@ -162,7 +162,7 @@    <|>    ((pFirstNonSpace >> pRegExpr regex_'40'5b'5fa'2dzA'2dZ'5d'5b'5c'2e'5fa'2dzA'2dZ0'2d9'5d'2a >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Python","CheckForString") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -180,19 +180,19 @@ parseRules ("Python","parenthesised") =   (((parseRules ("Python","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Python","parenthesised")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","parenthesised") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","parenthesised")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Python","Hash comment") =   (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Hash comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Hash comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Hash comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Python","Tripple A-comment") =   (((pString False "'''" >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Tripple A-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Tripple A-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Tripple A-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Python","Tripple Q-comment") =   (((pHlCChar >>= withAttribute CommentTok))@@ -201,7 +201,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Tripple Q-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Tripple Q-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Tripple Q-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Python","Single A-comment") =   (((pHlCStringChar >>= withAttribute CommentTok))@@ -210,7 +210,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Single A-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Single A-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Single A-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Python","Single Q-comment") =   (((pHlCStringChar >>= withAttribute CommentTok))@@ -219,12 +219,12 @@    <|>    ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Single Q-comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Single Q-comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Single Q-comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Python","stringformat") =   (((pRegExpr regex_'25'28'28'5c'28'5ba'2dzA'2dZ0'2d9'5f'5d'2b'5c'29'29'3f'5b'230'5c'2d_'2b'5d'3f'28'5b1'2d9'5d'5b0'2d9'5d'2a'7c'5c'2a'29'3f'28'5c'2e'28'5b1'2d9'5d'5b0'2d9'5d'2a'7c'5c'2a'29'29'3f'5bhlL'5d'3f'5bcrsdiouxXeEfFgG'25'5d'7cprog'7cdefault'29 >>= withAttribute OtherTok))    <|>-   (currentContext >>= \x -> guard (x == ("Python","stringformat")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","stringformat") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","stringformat")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Python","Tripple A-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -233,7 +233,7 @@    <|>    ((pString False "'''" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Tripple A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Tripple A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Tripple A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Raw Tripple A-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -242,7 +242,7 @@    <|>    ((pString False "'''" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Raw Tripple A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Raw Tripple A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Raw Tripple A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Tripple Q-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -251,7 +251,7 @@    <|>    ((pString False "\"\"\"" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Tripple Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Tripple Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Tripple Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Raw Tripple Q-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -260,7 +260,7 @@    <|>    ((pString False "\"\"\"" >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Raw Tripple Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Raw Tripple Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Raw Tripple Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Single A-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -269,7 +269,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Single A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Single A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Single A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Single Q-string") =   (((pHlCStringChar >>= withAttribute CharTok))@@ -278,7 +278,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Single Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Single Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Single Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Raw A-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -287,7 +287,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Raw A-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Raw A-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Raw A-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Python","Raw Q-string") =   (((pHlCStringChar >>= withAttribute StringTok))@@ -296,7 +296,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Python","Raw Q-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Python","Raw Q-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Python","Raw Q-string")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression 
Text/Highlighting/Kate/Syntax/R.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,18 +41,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("R Script","level0") -> return ()-    ("R Script","ctx0") -> return ()-    ("R Script","parenthesis") -> return ()-    ("R Script","string") -> return ()-    ("R Script","string2") -> return ()-    ("R Script","backquotedsymbol") -> return ()-    ("R Script","operator_rhs") -> return ()-    ("R Script","Headline") -> (popContext) >> pEndLine-    ("R Script","Comment") -> (popContext) >> pEndLine-    ("R Script","CommonRules") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("R Script","level0") -> return ()+      ("R Script","ctx0") -> return ()+      ("R Script","parenthesis") -> return ()+      ("R Script","string") -> return ()+      ("R Script","string2") -> return ()+      ("R Script","backquotedsymbol") -> return ()+      ("R Script","operator_rhs") -> return ()+      ("R Script","Headline") -> (popContext) >> pEndLine+      ("R Script","Comment") -> (popContext) >> pEndLine+      ("R Script","CommonRules") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -75,8 +77,6 @@ regex_'28'5c'2b'7c'5c'2d'7c'5c'2a'7b1'2c2'7d'7c'2f'7c'3c'3d'3f'7c'3e'3d'3f'7c'3d'7b1'2c2'7d'7c'5c'21'3d'3f'7c'5c'7c'7b1'2c2'7d'7c'26'7b1'2c2'7d'7c'3a'7b1'2c3'7d'7c'5c'5e'7c'40'7c'5c'24'7c'7e'29 = compileRegex "(\\+|\\-|\\*{1,2}|/|<=?|>=?|={1,2}|\\!=?|\\|{1,2}|&{1,2}|:{1,3}|\\^|@|\\$|~)" regex_'25'5b'5e'25'5d'2a'25 = compileRegex "%[^%]*%" -defaultAttributes = [(("R Script","level0"),NormalTok),(("R Script","ctx0"),NormalTok),(("R Script","parenthesis"),NormalTok),(("R Script","string"),StringTok),(("R Script","string2"),StringTok),(("R Script","backquotedsymbol"),DataTypeTok),(("R Script","operator_rhs"),NormalTok),(("R Script","Headline"),NormalTok),(("R Script","Comment"),CommentTok),(("R Script","CommonRules"),NormalTok)]- parseRules ("R Script","level0") =   (((parseRules ("R Script","CommonRules")))    <|>@@ -84,7 +84,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","level0")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","level0") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","level0")) >> pDefault >>= withAttribute NormalTok))  parseRules ("R Script","ctx0") =   (((parseRules ("R Script","CommonRules")))@@ -93,7 +93,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","ctx0")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","ctx0") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","ctx0")) >> pDefault >>= withAttribute NormalTok))  parseRules ("R Script","parenthesis") =   (((pLineContinue >>= withAttribute NormalTok))@@ -106,28 +106,28 @@    <|>    ((pDetectChar False '}' >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","parenthesis")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","parenthesis") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","parenthesis")) >> pDefault >>= withAttribute NormalTok))  parseRules ("R Script","string") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pHlCStringChar >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("R Script","string2") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pHlCStringChar >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","string2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","string2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","string2")) >> pDefault >>= withAttribute StringTok))  parseRules ("R Script","backquotedsymbol") =   (((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((pHlCStringChar >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","backquotedsymbol")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","backquotedsymbol") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","backquotedsymbol")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("R Script","operator_rhs") =   (((pString False "##" >>= withAttribute NormalTok) >>~ pushContext ("R Script","Headline"))@@ -141,10 +141,10 @@    ((popContext) >> currentContext >>= parseRules))  parseRules ("R Script","Headline") =-  (currentContext >>= \x -> guard (x == ("R Script","Headline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","Headline") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("R Script","Headline")) >> pDefault >>= withAttribute NormalTok)  parseRules ("R Script","Comment") =-  (currentContext >>= \x -> guard (x == ("R Script","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("R Script","Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("R Script","CommonRules") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("R Script","string"))@@ -187,7 +187,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("R Script","CommonRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("R Script","CommonRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("R Script","CommonRules")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("R Script","level0") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Relaxngcompact.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,13 +41,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("RelaxNG-Compact","Normal Text") -> return ()-    ("RelaxNG-Compact","Comments") -> (popContext) >> pEndLine-    ("RelaxNG-Compact","String") -> return ()-    ("RelaxNG-Compact","Node Names") -> (popContext) >> pEndLine-    ("RelaxNG-Compact","Definitions") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("RelaxNG-Compact","Normal Text") -> return ()+      ("RelaxNG-Compact","Comments") -> (popContext) >> pEndLine+      ("RelaxNG-Compact","String") -> return ()+      ("RelaxNG-Compact","Node Names") -> (popContext) >> pEndLine+      ("RelaxNG-Compact","Definitions") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -62,8 +64,6 @@  regex_'5b'5cw'5c'2e'2d'5d'2b'5b'5cs'5d'2b'3d = compileRegex "[\\w\\.-]+[\\s]+=" -defaultAttributes = [(("RelaxNG-Compact","Normal Text"),NormalTok),(("RelaxNG-Compact","Comments"),CommentTok),(("RelaxNG-Compact","String"),StringTok),(("RelaxNG-Compact","Node Names"),OtherTok),(("RelaxNG-Compact","Definitions"),FunctionTok)]- parseRules ("RelaxNG-Compact","Normal Text") =   (((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("RelaxNG-Compact","Comments"))    <|>@@ -77,25 +77,25 @@    <|>    ((lookAhead (pRegExpr regex_'5b'5cw'5c'2e'2d'5d'2b'5b'5cs'5d'2b'3d) >> pushContext ("RelaxNG-Compact","Definitions") >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("RelaxNG-Compact","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("RelaxNG-Compact","Comments") =-  (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Comments")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("RelaxNG-Compact","Comments") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Comments")) >> pDefault >>= withAttribute CommentTok)  parseRules ("RelaxNG-Compact","String") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("RelaxNG-Compact","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("RelaxNG-Compact","Node Names") =   (((lookAhead (pDetectChar False '{') >> (popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Node Names")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("RelaxNG-Compact","Node Names") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Node Names")) >> pDefault >>= withAttribute OtherTok))  parseRules ("RelaxNG-Compact","Definitions") =   (((lookAhead (pDetectChar False '=') >> (popContext >> popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Definitions")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("RelaxNG-Compact","Definitions") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","Definitions")) >> pDefault >>= withAttribute FunctionTok))   parseRules x = parseRules ("RelaxNG-Compact","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Rhtml.hs view
@@ -12,7 +12,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -45,108 +44,111 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Ruby/Rails/RHTML","Start") -> return ()-    ("Ruby/Rails/RHTML","FindHTML") -> return ()-    ("Ruby/Rails/RHTML","FindEntityRefs") -> return ()-    ("Ruby/Rails/RHTML","FindPEntityRefs") -> return ()-    ("Ruby/Rails/RHTML","FindAttributes") -> return ()-    ("Ruby/Rails/RHTML","FindDTDRules") -> return ()-    ("Ruby/Rails/RHTML","Comment") -> return ()-    ("Ruby/Rails/RHTML","CDATA") -> return ()-    ("Ruby/Rails/RHTML","PI") -> return ()-    ("Ruby/Rails/RHTML","Doctype") -> return ()-    ("Ruby/Rails/RHTML","Doctype Internal Subset") -> return ()-    ("Ruby/Rails/RHTML","Doctype Markupdecl") -> return ()-    ("Ruby/Rails/RHTML","Doctype Markupdecl DQ") -> return ()-    ("Ruby/Rails/RHTML","Doctype Markupdecl SQ") -> return ()-    ("Ruby/Rails/RHTML","El Open") -> return ()-    ("Ruby/Rails/RHTML","El Close") -> return ()-    ("Ruby/Rails/RHTML","El Close 2") -> return ()-    ("Ruby/Rails/RHTML","El Close 3") -> return ()-    ("Ruby/Rails/RHTML","CSS") -> return ()-    ("Ruby/Rails/RHTML","CSS content") -> return ()-    ("Ruby/Rails/RHTML","JS") -> return ()-    ("Ruby/Rails/RHTML","JS content") -> return ()-    ("Ruby/Rails/RHTML","JS comment close") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","Value") -> return ()-    ("Ruby/Rails/RHTML","Value NQ") -> (popContext >> popContext) >> pEndLine-    ("Ruby/Rails/RHTML","Value DQ") -> return ()-    ("Ruby/Rails/RHTML","Value SQ") -> return ()-    ("Ruby/Rails/RHTML","rubysourceline") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","rubysource") -> return ()-    ("Ruby/Rails/RHTML","Line Continue") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","Quoted String") -> return ()-    ("Ruby/Rails/RHTML","Apostrophed String") -> return ()-    ("Ruby/Rails/RHTML","Command String") -> return ()-    ("Ruby/Rails/RHTML","Embedded documentation") -> return ()-    ("Ruby/Rails/RHTML","RegEx 1") -> return ()-    ("Ruby/Rails/RHTML","Subst") -> return ()-    ("Ruby/Rails/RHTML","Short Subst") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","Member Access") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","Comment Line") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","General Comment") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","RDoc Label") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","find_heredoc") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","find_indented_heredoc") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","indented_heredoc") -> return ()-    ("Ruby/Rails/RHTML","apostrophed_indented_heredoc") -> return ()-    ("Ruby/Rails/RHTML","normal_heredoc") -> return ()-    ("Ruby/Rails/RHTML","apostrophed_normal_heredoc") -> return ()-    ("Ruby/Rails/RHTML","heredoc_rules") -> return ()-    ("Ruby/Rails/RHTML","find_gdl_input") -> (popContext) >> pEndLine-    ("Ruby/Rails/RHTML","gdl_dq_string_1") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_1_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_2") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_2_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_3") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_3_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_4") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_4_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_dq_string_5") -> return ()-    ("Ruby/Rails/RHTML","dq_string_rules") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_1") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_1_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_2") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_2_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_3") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_3_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_4") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_4_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_token_array_5") -> return ()-    ("Ruby/Rails/RHTML","token_array_rules") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_1") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_2") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_3") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_4") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_apostrophed_5") -> return ()-    ("Ruby/Rails/RHTML","apostrophed_rules") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_1") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_1_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_2") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_2_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_3") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_3_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_4") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_4_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_shell_command_5") -> return ()-    ("Ruby/Rails/RHTML","shell_command_rules") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_1") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_1_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_2") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_2_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_3") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_3_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_4") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_4_nested") -> return ()-    ("Ruby/Rails/RHTML","gdl_regexpr_5") -> return ()-    ("Ruby/Rails/RHTML","regexpr_rules") -> return ()-    ("Ruby/Rails/RHTML","DATA") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Ruby/Rails/RHTML","Start") -> return ()+      ("Ruby/Rails/RHTML","FindHTML") -> return ()+      ("Ruby/Rails/RHTML","FindEntityRefs") -> return ()+      ("Ruby/Rails/RHTML","FindPEntityRefs") -> return ()+      ("Ruby/Rails/RHTML","FindAttributes") -> return ()+      ("Ruby/Rails/RHTML","FindDTDRules") -> return ()+      ("Ruby/Rails/RHTML","Comment") -> return ()+      ("Ruby/Rails/RHTML","CDATA") -> return ()+      ("Ruby/Rails/RHTML","PI") -> return ()+      ("Ruby/Rails/RHTML","Doctype") -> return ()+      ("Ruby/Rails/RHTML","Doctype Internal Subset") -> return ()+      ("Ruby/Rails/RHTML","Doctype Markupdecl") -> return ()+      ("Ruby/Rails/RHTML","Doctype Markupdecl DQ") -> return ()+      ("Ruby/Rails/RHTML","Doctype Markupdecl SQ") -> return ()+      ("Ruby/Rails/RHTML","El Open") -> return ()+      ("Ruby/Rails/RHTML","El Close") -> return ()+      ("Ruby/Rails/RHTML","El Close 2") -> return ()+      ("Ruby/Rails/RHTML","El Close 3") -> return ()+      ("Ruby/Rails/RHTML","CSS") -> return ()+      ("Ruby/Rails/RHTML","CSS content") -> return ()+      ("Ruby/Rails/RHTML","JS") -> return ()+      ("Ruby/Rails/RHTML","JS content") -> return ()+      ("Ruby/Rails/RHTML","JS comment close") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","Value") -> return ()+      ("Ruby/Rails/RHTML","Value NQ") -> (popContext >> popContext) >> pEndLine+      ("Ruby/Rails/RHTML","Value DQ") -> return ()+      ("Ruby/Rails/RHTML","Value SQ") -> return ()+      ("Ruby/Rails/RHTML","rubysourceline") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","rubysource") -> return ()+      ("Ruby/Rails/RHTML","Line Continue") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","Quoted String") -> return ()+      ("Ruby/Rails/RHTML","Apostrophed String") -> return ()+      ("Ruby/Rails/RHTML","Command String") -> return ()+      ("Ruby/Rails/RHTML","Embedded documentation") -> return ()+      ("Ruby/Rails/RHTML","RegEx 1") -> return ()+      ("Ruby/Rails/RHTML","Subst") -> return ()+      ("Ruby/Rails/RHTML","Short Subst") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","Member Access") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","Comment Line") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","General Comment") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","RDoc Label") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","find_heredoc") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","find_indented_heredoc") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","indented_heredoc") -> return ()+      ("Ruby/Rails/RHTML","apostrophed_indented_heredoc") -> return ()+      ("Ruby/Rails/RHTML","normal_heredoc") -> return ()+      ("Ruby/Rails/RHTML","apostrophed_normal_heredoc") -> return ()+      ("Ruby/Rails/RHTML","heredoc_rules") -> return ()+      ("Ruby/Rails/RHTML","find_gdl_input") -> (popContext) >> pEndLine+      ("Ruby/Rails/RHTML","gdl_dq_string_1") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_1_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_2") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_2_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_3") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_3_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_4") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_4_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_dq_string_5") -> return ()+      ("Ruby/Rails/RHTML","dq_string_rules") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_1") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_1_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_2") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_2_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_3") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_3_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_4") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_4_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_token_array_5") -> return ()+      ("Ruby/Rails/RHTML","token_array_rules") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_1") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_2") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_3") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_4") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_apostrophed_5") -> return ()+      ("Ruby/Rails/RHTML","apostrophed_rules") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_1") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_1_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_2") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_2_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_3") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_3_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_4") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_4_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_shell_command_5") -> return ()+      ("Ruby/Rails/RHTML","shell_command_rules") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_1") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_1_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_2") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_2_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_3") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_3_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_4") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_4_nested") -> return ()+      ("Ruby/Rails/RHTML","gdl_regexpr_5") -> return ()+      ("Ruby/Rails/RHTML","regexpr_rules") -> return ()+      ("Ruby/Rails/RHTML","DATA") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -280,12 +282,10 @@ regex_'5c'5d'5buiomxn'5d'2a = compileRegex "\\][uiomxn]*" regex_'3e'5buiomxn'5d'2a = compileRegex ">[uiomxn]*" -defaultAttributes = [(("Ruby/Rails/RHTML","Start"),NormalTok),(("Ruby/Rails/RHTML","FindHTML"),NormalTok),(("Ruby/Rails/RHTML","FindEntityRefs"),NormalTok),(("Ruby/Rails/RHTML","FindPEntityRefs"),NormalTok),(("Ruby/Rails/RHTML","FindAttributes"),NormalTok),(("Ruby/Rails/RHTML","FindDTDRules"),NormalTok),(("Ruby/Rails/RHTML","Comment"),CommentTok),(("Ruby/Rails/RHTML","CDATA"),NormalTok),(("Ruby/Rails/RHTML","PI"),NormalTok),(("Ruby/Rails/RHTML","Doctype"),NormalTok),(("Ruby/Rails/RHTML","Doctype Internal Subset"),NormalTok),(("Ruby/Rails/RHTML","Doctype Markupdecl"),NormalTok),(("Ruby/Rails/RHTML","Doctype Markupdecl DQ"),StringTok),(("Ruby/Rails/RHTML","Doctype Markupdecl SQ"),StringTok),(("Ruby/Rails/RHTML","El Open"),NormalTok),(("Ruby/Rails/RHTML","El Close"),NormalTok),(("Ruby/Rails/RHTML","El Close 2"),NormalTok),(("Ruby/Rails/RHTML","El Close 3"),NormalTok),(("Ruby/Rails/RHTML","CSS"),NormalTok),(("Ruby/Rails/RHTML","CSS content"),NormalTok),(("Ruby/Rails/RHTML","JS"),NormalTok),(("Ruby/Rails/RHTML","JS content"),NormalTok),(("Ruby/Rails/RHTML","JS comment close"),CommentTok),(("Ruby/Rails/RHTML","Value"),NormalTok),(("Ruby/Rails/RHTML","Value NQ"),NormalTok),(("Ruby/Rails/RHTML","Value DQ"),StringTok),(("Ruby/Rails/RHTML","Value SQ"),StringTok),(("Ruby/Rails/RHTML","rubysourceline"),NormalTok),(("Ruby/Rails/RHTML","rubysource"),NormalTok),(("Ruby/Rails/RHTML","Line Continue"),NormalTok),(("Ruby/Rails/RHTML","Quoted String"),StringTok),(("Ruby/Rails/RHTML","Apostrophed String"),StringTok),(("Ruby/Rails/RHTML","Command String"),StringTok),(("Ruby/Rails/RHTML","Embedded documentation"),CommentTok),(("Ruby/Rails/RHTML","RegEx 1"),OtherTok),(("Ruby/Rails/RHTML","Subst"),NormalTok),(("Ruby/Rails/RHTML","Short Subst"),OtherTok),(("Ruby/Rails/RHTML","Member Access"),NormalTok),(("Ruby/Rails/RHTML","Comment Line"),CommentTok),(("Ruby/Rails/RHTML","General Comment"),CommentTok),(("Ruby/Rails/RHTML","RDoc Label"),OtherTok),(("Ruby/Rails/RHTML","find_heredoc"),NormalTok),(("Ruby/Rails/RHTML","find_indented_heredoc"),NormalTok),(("Ruby/Rails/RHTML","indented_heredoc"),NormalTok),(("Ruby/Rails/RHTML","apostrophed_indented_heredoc"),NormalTok),(("Ruby/Rails/RHTML","normal_heredoc"),NormalTok),(("Ruby/Rails/RHTML","apostrophed_normal_heredoc"),NormalTok),(("Ruby/Rails/RHTML","heredoc_rules"),NormalTok),(("Ruby/Rails/RHTML","find_gdl_input"),NormalTok),(("Ruby/Rails/RHTML","gdl_dq_string_1"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_1_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_2"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_2_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_3"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_3_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_4"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_4_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_dq_string_5"),StringTok),(("Ruby/Rails/RHTML","dq_string_rules"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_1"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_1_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_2"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_2_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_3"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_3_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_4"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_4_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_token_array_5"),StringTok),(("Ruby/Rails/RHTML","token_array_rules"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_1"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_1_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_2"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_2_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_3"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_3_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_4"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_4_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_apostrophed_5"),StringTok),(("Ruby/Rails/RHTML","apostrophed_rules"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_1"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_1_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_2"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_2_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_3"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_3_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_4"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_4_nested"),StringTok),(("Ruby/Rails/RHTML","gdl_shell_command_5"),StringTok),(("Ruby/Rails/RHTML","shell_command_rules"),StringTok),(("Ruby/Rails/RHTML","gdl_regexpr_1"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_1_nested"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_2"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_2_nested"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_3"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_3_nested"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_4"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_4_nested"),OtherTok),(("Ruby/Rails/RHTML","gdl_regexpr_5"),OtherTok),(("Ruby/Rails/RHTML","regexpr_rules"),OtherTok),(("Ruby/Rails/RHTML","DATA"),NormalTok)]- parseRules ("Ruby/Rails/RHTML","Start") =   (((parseRules ("Ruby/Rails/RHTML","FindHTML")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","FindHTML") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -328,14 +328,14 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindHTML")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","FindHTML") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindHTML")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","FindEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>    ((pAnyChar "&<" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","FindEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -344,7 +344,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","FindAttributes") =   (((pColumn 0 >> pRegExpr regex_'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a >>= withAttribute OtherTok))@@ -353,12 +353,12 @@    <|>    ((pDetectChar False '=' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Value"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindAttributes")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","FindAttributes") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindAttributes")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","FindDTDRules") =   (((pRegExpr regex_'3c'21'28ELEMENT'7cENTITY'7cATTLIST'7cNOTATION'29'5cb >>= withAttribute DataTypeTok) >>~ pushContext ("Ruby/Rails/RHTML","Doctype Markupdecl"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindDTDRules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","FindDTDRules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","FindDTDRules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -371,7 +371,7 @@    <|>    ((pRegExpr regex_'2d'28'2d'28'3f'21'2d'3e'29'29'2b >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby/Rails/RHTML","CDATA") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -382,19 +382,19 @@    <|>    ((pString False "]]&gt;" >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("Ruby/Rails/RHTML","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -407,7 +407,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -416,7 +416,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Doctype Markupdecl DQ") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -425,7 +425,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","Doctype Markupdecl SQ") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -434,7 +434,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","El Open") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -447,7 +447,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Open")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","El Open") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Open")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","El Close") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -456,7 +456,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","El Close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","El Close 2") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -465,7 +465,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","El Close 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close 2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","El Close 3") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -474,7 +474,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close 3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","El Close 3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","El Close 3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","CSS") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -487,7 +487,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CSS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","CSS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CSS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","CSS content") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -496,7 +496,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Css.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CSS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","CSS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CSS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","JS") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -509,7 +509,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","JS") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","JS content") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -520,14 +520,14 @@    <|>    ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","JS content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","JS comment close") =   (((pRegExpr regex_'3c'2fscript'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","El Close 3"))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS comment close")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","JS comment close") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS comment close")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby/Rails/RHTML","Value") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -558,7 +558,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Value DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Value DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Value DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","Value SQ") =   (((pRegExpr regex_'3c'25'3d'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","rubysource"))@@ -567,12 +567,12 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Value SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Value SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Value SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","rubysourceline") =   (((parseRules ("Ruby/Rails/RHTML","rubysource")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","rubysourceline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","rubysourceline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","rubysourceline")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","rubysource") =   (((pLineContinue >>= withAttribute NormalTok) >>~ pushContext ("Ruby/Rails/RHTML","Line Continue"))@@ -713,7 +713,7 @@    <|>    ((pRegExpr regex_'5cs'2a'5b'25'5d'28'3f'3d'5bQqxw'5d'3f'5b'5e'5cs'3e'5d'29 >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","find_gdl_input"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","rubysource")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","rubysource") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","rubysource")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Line Continue") =   (((pFirstNonSpace >> pRegExpr regex_'28while'7cuntil'29'5cb'28'3f'21'2e'2a'5cbdo'5cb'29 >>= withAttribute KeywordTok))@@ -722,7 +722,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","rubysource")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Line Continue")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Line Continue") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Line Continue")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Quoted String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -735,7 +735,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Quoted String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Quoted String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Quoted String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","Apostrophed String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -744,7 +744,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Apostrophed String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Apostrophed String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Apostrophed String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","Command String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -759,12 +759,12 @@    <|>    ((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Command String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Command String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Command String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","Embedded documentation") =   (((pColumn 0 >> pString False "=end" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Embedded documentation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Embedded documentation") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Embedded documentation")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby/Rails/RHTML","RegEx 1") =   (((pRegExpr regex_'5c'5c'5c'2f >>= withAttribute OtherTok))@@ -777,21 +777,21 @@    <|>    ((pRegExpr regex_'2f'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","RegEx 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","RegEx 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","RegEx 1")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","Subst") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))    <|>    ((parseRules ("Ruby/Rails/RHTML","rubysource")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Subst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Subst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Subst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Short Subst") =   (((pRegExpr regex_'23'40'7b1'2c2'7d >>= withAttribute OtherTok))    <|>    ((pRegExpr regex_'5cw'28'3f'21'5cw'29 >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Short Subst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Short Subst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Short Subst")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","Member Access") =   (((pRegExpr regex_'5c'2e'3f'5b'5fa'2dz'5d'5cw'2a'28'5c'3f'7c'5c'21'29'3f'28'3f'3d'5b'5e'5cw'5cd'5c'2e'5c'3a'5d'29 >>= withAttribute NormalTok) >>~ (popContext))@@ -818,7 +818,7 @@    <|>    ((pRegExpr regex_'5cW >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Member Access")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Member Access") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Member Access")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","Comment Line") =   (((pRegExpr regex_'5cw'5c'3a'5c'3a'5cs >>= withAttribute CommentTok) >>~ pushContext ("Ruby/Rails/RHTML","RDoc Label"))@@ -827,60 +827,60 @@    <|>    ((pRegExpr regex_'2d'3f'25'3e >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Comment Line")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","Comment Line") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","Comment Line")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby/Rails/RHTML","General Comment") =   (((pKeyword " \n\t.():+,-<=>%&*/;[]^{|}~\\" list_attention >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","General Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","General Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","General Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby/Rails/RHTML","RDoc Label") =-  (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","RDoc Label")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","RDoc Label") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","RDoc Label")) >> pDefault >>= withAttribute OtherTok)  parseRules ("Ruby/Rails/RHTML","find_heredoc") =   (((pRegExpr regex_'27'28'5cw'2b'29'27 >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","apostrophed_normal_heredoc"))    <|>    ((pRegExpr regex_'22'3f'28'5cw'2b'29'22'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","normal_heredoc"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","find_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","find_indented_heredoc") =   (((pRegExpr regex_'27'28'5cw'2b'29'27 >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","apostrophed_indented_heredoc"))    <|>    ((pRegExpr regex_'22'3f'28'5cw'2b'29'22'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","indented_heredoc"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","find_indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_indented_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","indented_heredoc") =   (((pFirstNonSpace >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Ruby/Rails/RHTML","heredoc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","indented_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","apostrophed_indented_heredoc") =   (((pFirstNonSpace >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","apostrophed_indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_indented_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","normal_heredoc") =   (((pColumn 0 >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Ruby/Rails/RHTML","heredoc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","normal_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","normal_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","normal_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","apostrophed_normal_heredoc") =   (((pColumn 0 >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_normal_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","apostrophed_normal_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_normal_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","heredoc_rules") =   (((pRegExpr regex_'23'40'7b1'2c2'7d >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Short Subst"))    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","heredoc_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","heredoc_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","heredoc_rules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","find_gdl_input") =   (((pRegExpr regex_w'5c'28 >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_token_array_1"))@@ -933,7 +933,7 @@    <|>    ((pRegExpr regex_Q'3f'28'5b'5e'5cs'5cw'5d'29 >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_dq_string_5"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_gdl_input")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","find_gdl_input") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","find_gdl_input")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_1") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -944,7 +944,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_1_nested") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -953,7 +953,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_2") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -964,7 +964,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_dq_string_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_2_nested") =   (((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_dq_string_2_nested"))@@ -973,7 +973,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_3") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -984,7 +984,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_3_nested") =   (((pDetectChar False '[' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_dq_string_3_nested"))@@ -993,7 +993,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_4") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -1004,7 +1004,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_4_nested") =   (((pDetectChar False '<' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_dq_string_4_nested"))@@ -1013,7 +1013,7 @@    <|>    ((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_dq_string_5") =   (((parseRules ("Ruby/Rails/RHTML","dq_string_rules")))@@ -1022,7 +1022,7 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_dq_string_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_dq_string_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","dq_string_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))@@ -1031,7 +1031,7 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","dq_string_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","dq_string_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","dq_string_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_1") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1042,7 +1042,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_1_nested") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1051,7 +1051,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_2") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1062,7 +1062,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_token_array_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_2_nested") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1071,7 +1071,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_3") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1082,7 +1082,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_3_nested") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1091,7 +1091,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_4") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1102,7 +1102,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_4_nested") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1111,7 +1111,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_token_array_5") =   (((parseRules ("Ruby/Rails/RHTML","token_array_rules")))@@ -1120,12 +1120,12 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_token_array_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_token_array_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","token_array_rules") =   (((pString False "\\\\" >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","token_array_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","token_array_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","token_array_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_1") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1136,7 +1136,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1145,7 +1145,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_2") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1156,7 +1156,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1165,7 +1165,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_3") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1176,7 +1176,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1185,7 +1185,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_4") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1196,7 +1196,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1205,7 +1205,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_apostrophed_5") =   (((parseRules ("Ruby/Rails/RHTML","apostrophed_rules")))@@ -1214,12 +1214,12 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_apostrophed_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_apostrophed_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","apostrophed_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","apostrophed_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","apostrophed_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_1") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1230,7 +1230,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_1_nested") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1239,7 +1239,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_2") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1250,7 +1250,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_shell_command_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_2_nested") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1259,7 +1259,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_3") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1270,7 +1270,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_3_nested") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1279,7 +1279,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_4") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1290,7 +1290,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_4_nested") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1299,7 +1299,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_shell_command_5") =   (((parseRules ("Ruby/Rails/RHTML","shell_command_rules")))@@ -1308,7 +1308,7 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_shell_command_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_shell_command_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","shell_command_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))@@ -1317,7 +1317,7 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","shell_command_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","shell_command_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","shell_command_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_1") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1328,7 +1328,7 @@    <|>    ((pRegExpr regex_'5c'29'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_1")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_1_nested") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1337,7 +1337,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_1_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_2") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1348,7 +1348,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","gdl_regexpr_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_2")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_2_nested") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1357,7 +1357,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_2_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_3") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1368,7 +1368,7 @@    <|>    ((pRegExpr regex_'5c'5d'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_3")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_3_nested") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1377,7 +1377,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_3_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_4") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1388,7 +1388,7 @@    <|>    ((pRegExpr regex_'3e'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_4")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_4_nested") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1397,7 +1397,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_4_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","gdl_regexpr_5") =   (((parseRules ("Ruby/Rails/RHTML","regexpr_rules")))@@ -1406,7 +1406,7 @@    <|>    ((pRegExprDynamic "\\s*%1[uiomxn]*" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","gdl_regexpr_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","gdl_regexpr_5")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","regexpr_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute OtherTok))@@ -1415,10 +1415,10 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby/Rails/RHTML","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","regexpr_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","regexpr_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","regexpr_rules")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby/Rails/RHTML","DATA") =-  (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","DATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby/Rails/RHTML","DATA") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","DATA")) >> pDefault >>= withAttribute NormalTok)  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression
Text/Highlighting/Kate/Syntax/Ruby.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,87 +42,90 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Ruby","Normal") -> return ()-    ("Ruby","check_div_1") -> (popContext) >> pEndLine-    ("Ruby","check_div_1_pop") -> (popContext >> popContext) >> pEndLine-    ("Ruby","check_div_2") -> (popContext) >> pEndLine-    ("Ruby","check_div_2_internal") -> (popContext >> popContext) >> pEndLine-    ("Ruby","check_div_2_pop") -> (popContext >> popContext) >> pEndLine-    ("Ruby","check_div_2_pop_internal") -> (popContext >> popContext >> popContext) >> pEndLine-    ("Ruby","Line Continue") -> (popContext) >> pEndLine-    ("Ruby","Find closing block brace") -> return ()-    ("Ruby","Quoted String") -> return ()-    ("Ruby","Apostrophed String") -> return ()-    ("Ruby","Command String") -> return ()-    ("Ruby","Embedded documentation") -> return ()-    ("Ruby","RegEx 1") -> return ()-    ("Ruby","Subst") -> return ()-    ("Ruby","Short Subst") -> (popContext) >> pEndLine-    ("Ruby","Member Access") -> (popContext) >> pEndLine-    ("Ruby","Comment Line") -> (popContext) >> pEndLine-    ("Ruby","General Comment") -> (popContext) >> pEndLine-    ("Ruby","RDoc Label") -> (popContext) >> pEndLine-    ("Ruby","find_heredoc") -> (popContext) >> pEndLine-    ("Ruby","find_indented_heredoc") -> (popContext) >> pEndLine-    ("Ruby","indented_heredoc") -> return ()-    ("Ruby","apostrophed_indented_heredoc") -> return ()-    ("Ruby","normal_heredoc") -> return ()-    ("Ruby","apostrophed_normal_heredoc") -> return ()-    ("Ruby","heredoc_rules") -> return ()-    ("Ruby","find_gdl_input") -> (popContext) >> pEndLine-    ("Ruby","gdl_dq_string_1") -> return ()-    ("Ruby","gdl_dq_string_1_nested") -> return ()-    ("Ruby","gdl_dq_string_2") -> return ()-    ("Ruby","gdl_dq_string_2_nested") -> return ()-    ("Ruby","gdl_dq_string_3") -> return ()-    ("Ruby","gdl_dq_string_3_nested") -> return ()-    ("Ruby","gdl_dq_string_4") -> return ()-    ("Ruby","gdl_dq_string_4_nested") -> return ()-    ("Ruby","gdl_dq_string_5") -> return ()-    ("Ruby","dq_string_rules") -> return ()-    ("Ruby","gdl_token_array_1") -> return ()-    ("Ruby","gdl_token_array_1_nested") -> return ()-    ("Ruby","gdl_token_array_2") -> return ()-    ("Ruby","gdl_token_array_2_nested") -> return ()-    ("Ruby","gdl_token_array_3") -> return ()-    ("Ruby","gdl_token_array_3_nested") -> return ()-    ("Ruby","gdl_token_array_4") -> return ()-    ("Ruby","gdl_token_array_4_nested") -> return ()-    ("Ruby","gdl_token_array_5") -> return ()-    ("Ruby","token_array_rules") -> return ()-    ("Ruby","gdl_apostrophed_1") -> return ()-    ("Ruby","gdl_apostrophed_1_nested") -> return ()-    ("Ruby","gdl_apostrophed_2") -> return ()-    ("Ruby","gdl_apostrophed_2_nested") -> return ()-    ("Ruby","gdl_apostrophed_3") -> return ()-    ("Ruby","gdl_apostrophed_3_nested") -> return ()-    ("Ruby","gdl_apostrophed_4") -> return ()-    ("Ruby","gdl_apostrophed_4_nested") -> return ()-    ("Ruby","gdl_apostrophed_5") -> return ()-    ("Ruby","apostrophed_rules") -> return ()-    ("Ruby","gdl_shell_command_1") -> return ()-    ("Ruby","gdl_shell_command_1_nested") -> return ()-    ("Ruby","gdl_shell_command_2") -> return ()-    ("Ruby","gdl_shell_command_2_nested") -> return ()-    ("Ruby","gdl_shell_command_3") -> return ()-    ("Ruby","gdl_shell_command_3_nested") -> return ()-    ("Ruby","gdl_shell_command_4") -> return ()-    ("Ruby","gdl_shell_command_4_nested") -> return ()-    ("Ruby","gdl_shell_command_5") -> return ()-    ("Ruby","shell_command_rules") -> return ()-    ("Ruby","gdl_regexpr_1") -> return ()-    ("Ruby","gdl_regexpr_1_nested") -> return ()-    ("Ruby","gdl_regexpr_2") -> return ()-    ("Ruby","gdl_regexpr_2_nested") -> return ()-    ("Ruby","gdl_regexpr_3") -> return ()-    ("Ruby","gdl_regexpr_3_nested") -> return ()-    ("Ruby","gdl_regexpr_4") -> return ()-    ("Ruby","gdl_regexpr_4_nested") -> return ()-    ("Ruby","gdl_regexpr_5") -> return ()-    ("Ruby","regexpr_rules") -> return ()-    ("Ruby","DATA") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Ruby","Normal") -> return ()+      ("Ruby","check_div_1") -> (popContext) >> pEndLine+      ("Ruby","check_div_1_pop") -> (popContext >> popContext) >> pEndLine+      ("Ruby","check_div_2") -> (popContext) >> pEndLine+      ("Ruby","check_div_2_internal") -> (popContext >> popContext) >> pEndLine+      ("Ruby","check_div_2_pop") -> (popContext >> popContext) >> pEndLine+      ("Ruby","check_div_2_pop_internal") -> (popContext >> popContext >> popContext) >> pEndLine+      ("Ruby","Line Continue") -> (popContext) >> pEndLine+      ("Ruby","Find closing block brace") -> return ()+      ("Ruby","Quoted String") -> return ()+      ("Ruby","Apostrophed String") -> return ()+      ("Ruby","Command String") -> return ()+      ("Ruby","Embedded documentation") -> return ()+      ("Ruby","RegEx 1") -> return ()+      ("Ruby","Subst") -> return ()+      ("Ruby","Short Subst") -> (popContext) >> pEndLine+      ("Ruby","Member Access") -> (popContext) >> pEndLine+      ("Ruby","Comment Line") -> (popContext) >> pEndLine+      ("Ruby","General Comment") -> (popContext) >> pEndLine+      ("Ruby","RDoc Label") -> (popContext) >> pEndLine+      ("Ruby","find_heredoc") -> (popContext) >> pEndLine+      ("Ruby","find_indented_heredoc") -> (popContext) >> pEndLine+      ("Ruby","indented_heredoc") -> return ()+      ("Ruby","apostrophed_indented_heredoc") -> return ()+      ("Ruby","normal_heredoc") -> return ()+      ("Ruby","apostrophed_normal_heredoc") -> return ()+      ("Ruby","heredoc_rules") -> return ()+      ("Ruby","find_gdl_input") -> (popContext) >> pEndLine+      ("Ruby","gdl_dq_string_1") -> return ()+      ("Ruby","gdl_dq_string_1_nested") -> return ()+      ("Ruby","gdl_dq_string_2") -> return ()+      ("Ruby","gdl_dq_string_2_nested") -> return ()+      ("Ruby","gdl_dq_string_3") -> return ()+      ("Ruby","gdl_dq_string_3_nested") -> return ()+      ("Ruby","gdl_dq_string_4") -> return ()+      ("Ruby","gdl_dq_string_4_nested") -> return ()+      ("Ruby","gdl_dq_string_5") -> return ()+      ("Ruby","dq_string_rules") -> return ()+      ("Ruby","gdl_token_array_1") -> return ()+      ("Ruby","gdl_token_array_1_nested") -> return ()+      ("Ruby","gdl_token_array_2") -> return ()+      ("Ruby","gdl_token_array_2_nested") -> return ()+      ("Ruby","gdl_token_array_3") -> return ()+      ("Ruby","gdl_token_array_3_nested") -> return ()+      ("Ruby","gdl_token_array_4") -> return ()+      ("Ruby","gdl_token_array_4_nested") -> return ()+      ("Ruby","gdl_token_array_5") -> return ()+      ("Ruby","token_array_rules") -> return ()+      ("Ruby","gdl_apostrophed_1") -> return ()+      ("Ruby","gdl_apostrophed_1_nested") -> return ()+      ("Ruby","gdl_apostrophed_2") -> return ()+      ("Ruby","gdl_apostrophed_2_nested") -> return ()+      ("Ruby","gdl_apostrophed_3") -> return ()+      ("Ruby","gdl_apostrophed_3_nested") -> return ()+      ("Ruby","gdl_apostrophed_4") -> return ()+      ("Ruby","gdl_apostrophed_4_nested") -> return ()+      ("Ruby","gdl_apostrophed_5") -> return ()+      ("Ruby","apostrophed_rules") -> return ()+      ("Ruby","gdl_shell_command_1") -> return ()+      ("Ruby","gdl_shell_command_1_nested") -> return ()+      ("Ruby","gdl_shell_command_2") -> return ()+      ("Ruby","gdl_shell_command_2_nested") -> return ()+      ("Ruby","gdl_shell_command_3") -> return ()+      ("Ruby","gdl_shell_command_3_nested") -> return ()+      ("Ruby","gdl_shell_command_4") -> return ()+      ("Ruby","gdl_shell_command_4_nested") -> return ()+      ("Ruby","gdl_shell_command_5") -> return ()+      ("Ruby","shell_command_rules") -> return ()+      ("Ruby","gdl_regexpr_1") -> return ()+      ("Ruby","gdl_regexpr_1_nested") -> return ()+      ("Ruby","gdl_regexpr_2") -> return ()+      ("Ruby","gdl_regexpr_2_nested") -> return ()+      ("Ruby","gdl_regexpr_3") -> return ()+      ("Ruby","gdl_regexpr_3_nested") -> return ()+      ("Ruby","gdl_regexpr_4") -> return ()+      ("Ruby","gdl_regexpr_4_nested") -> return ()+      ("Ruby","gdl_regexpr_5") -> return ()+      ("Ruby","regexpr_rules") -> return ()+      ("Ruby","DATA") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -238,8 +240,6 @@ regex_'5c'5d'5buiomxn'5d'2a = compileRegex "\\][uiomxn]*" regex_'3e'5buiomxn'5d'2a = compileRegex ">[uiomxn]*" -defaultAttributes = [(("Ruby","Normal"),NormalTok),(("Ruby","check_div_1"),NormalTok),(("Ruby","check_div_1_pop"),NormalTok),(("Ruby","check_div_2"),NormalTok),(("Ruby","check_div_2_internal"),NormalTok),(("Ruby","check_div_2_pop"),NormalTok),(("Ruby","check_div_2_pop_internal"),NormalTok),(("Ruby","Line Continue"),NormalTok),(("Ruby","Find closing block brace"),NormalTok),(("Ruby","Quoted String"),StringTok),(("Ruby","Apostrophed String"),StringTok),(("Ruby","Command String"),StringTok),(("Ruby","Embedded documentation"),CommentTok),(("Ruby","RegEx 1"),OtherTok),(("Ruby","Subst"),NormalTok),(("Ruby","Short Subst"),OtherTok),(("Ruby","Member Access"),NormalTok),(("Ruby","Comment Line"),CommentTok),(("Ruby","General Comment"),CommentTok),(("Ruby","RDoc Label"),OtherTok),(("Ruby","find_heredoc"),NormalTok),(("Ruby","find_indented_heredoc"),NormalTok),(("Ruby","indented_heredoc"),OtherTok),(("Ruby","apostrophed_indented_heredoc"),OtherTok),(("Ruby","normal_heredoc"),OtherTok),(("Ruby","apostrophed_normal_heredoc"),OtherTok),(("Ruby","heredoc_rules"),NormalTok),(("Ruby","find_gdl_input"),NormalTok),(("Ruby","gdl_dq_string_1"),StringTok),(("Ruby","gdl_dq_string_1_nested"),StringTok),(("Ruby","gdl_dq_string_2"),StringTok),(("Ruby","gdl_dq_string_2_nested"),StringTok),(("Ruby","gdl_dq_string_3"),StringTok),(("Ruby","gdl_dq_string_3_nested"),StringTok),(("Ruby","gdl_dq_string_4"),StringTok),(("Ruby","gdl_dq_string_4_nested"),StringTok),(("Ruby","gdl_dq_string_5"),StringTok),(("Ruby","dq_string_rules"),StringTok),(("Ruby","gdl_token_array_1"),StringTok),(("Ruby","gdl_token_array_1_nested"),StringTok),(("Ruby","gdl_token_array_2"),StringTok),(("Ruby","gdl_token_array_2_nested"),StringTok),(("Ruby","gdl_token_array_3"),StringTok),(("Ruby","gdl_token_array_3_nested"),StringTok),(("Ruby","gdl_token_array_4"),StringTok),(("Ruby","gdl_token_array_4_nested"),StringTok),(("Ruby","gdl_token_array_5"),StringTok),(("Ruby","token_array_rules"),StringTok),(("Ruby","gdl_apostrophed_1"),StringTok),(("Ruby","gdl_apostrophed_1_nested"),StringTok),(("Ruby","gdl_apostrophed_2"),StringTok),(("Ruby","gdl_apostrophed_2_nested"),StringTok),(("Ruby","gdl_apostrophed_3"),StringTok),(("Ruby","gdl_apostrophed_3_nested"),StringTok),(("Ruby","gdl_apostrophed_4"),StringTok),(("Ruby","gdl_apostrophed_4_nested"),StringTok),(("Ruby","gdl_apostrophed_5"),StringTok),(("Ruby","apostrophed_rules"),StringTok),(("Ruby","gdl_shell_command_1"),StringTok),(("Ruby","gdl_shell_command_1_nested"),StringTok),(("Ruby","gdl_shell_command_2"),StringTok),(("Ruby","gdl_shell_command_2_nested"),StringTok),(("Ruby","gdl_shell_command_3"),StringTok),(("Ruby","gdl_shell_command_3_nested"),StringTok),(("Ruby","gdl_shell_command_4"),StringTok),(("Ruby","gdl_shell_command_4_nested"),StringTok),(("Ruby","gdl_shell_command_5"),StringTok),(("Ruby","shell_command_rules"),StringTok),(("Ruby","gdl_regexpr_1"),OtherTok),(("Ruby","gdl_regexpr_1_nested"),OtherTok),(("Ruby","gdl_regexpr_2"),OtherTok),(("Ruby","gdl_regexpr_2_nested"),OtherTok),(("Ruby","gdl_regexpr_3"),OtherTok),(("Ruby","gdl_regexpr_3_nested"),OtherTok),(("Ruby","gdl_regexpr_4"),OtherTok),(("Ruby","gdl_regexpr_4_nested"),OtherTok),(("Ruby","gdl_regexpr_5"),OtherTok),(("Ruby","regexpr_rules"),OtherTok),(("Ruby","DATA"),NormalTok)]- parseRules ("Ruby","Normal") =   (((pLineContinue >>= withAttribute NormalTok) >>~ pushContext ("Ruby","Line Continue"))    <|>@@ -385,7 +385,7 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok) >>~ pushContext ("Ruby","check_div_2"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","check_div_1") =   (((pRegExpr regex_'5cs'2a >>= withAttribute NormalTok))@@ -434,14 +434,14 @@    <|>    ((parseRules ("Ruby","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Line Continue")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Line Continue") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Line Continue")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","Find closing block brace") =   (((pDetectChar False '}' >>= withAttribute NormalTok) >>~ pushContext ("Ruby","check_div_1_pop"))    <|>    ((parseRules ("Ruby","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Find closing block brace")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Find closing block brace") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Find closing block brace")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","Quoted String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -454,7 +454,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Ruby","check_div_1_pop"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Quoted String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Quoted String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Quoted String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","Apostrophed String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -463,7 +463,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("Ruby","check_div_1_pop"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Apostrophed String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Apostrophed String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Apostrophed String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","Command String") =   (((pString False "\\\\" >>= withAttribute StringTok))@@ -476,14 +476,14 @@    <|>    ((pDetectChar False '`' >>= withAttribute StringTok) >>~ pushContext ("Ruby","check_div_1_pop"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Command String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Command String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Command String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","Embedded documentation") =   (((pColumn 0 >> pRegExpr regex_'3dend'28'3f'3a'5cs'2e'2a'7c'24'29 >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Embedded documentation")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Embedded documentation") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Embedded documentation")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby","RegEx 1") =   (((pRegExpr regex_'5c'5c'5c'2f >>= withAttribute OtherTok))@@ -494,21 +494,21 @@    <|>    ((pRegExpr regex_'2f'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ pushContext ("Ruby","check_div_1_pop"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","RegEx 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","RegEx 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","RegEx 1")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","Subst") =   (((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))    <|>    ((parseRules ("Ruby","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Subst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Subst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Subst")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","Short Subst") =   (((pRegExpr regex_'23'40'7b1'2c2'7d >>= withAttribute OtherTok))    <|>    ((pRegExpr regex_'5cw'28'3f'21'5cw'29 >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Short Subst")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Short Subst") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Short Subst")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","Member Access") =   (((pRegExpr regex_'5c'2e'3f'5b'5fa'2dz'5d'5cw'2a'28'5c'3f'7c'5c'21'29'3f'28'3f'3d'5b'5e'5cw'5cd'5c'2e'5c'3a'5d'29 >>= withAttribute NormalTok) >>~ pushContext ("Ruby","check_div_2_pop"))@@ -535,67 +535,67 @@    <|>    ((pRegExpr regex_'5cW >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Member Access")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Member Access") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Member Access")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","Comment Line") =   (((pRegExpr regex_'5cw'5c'3a'5c'3a'5cs >>= withAttribute CommentTok) >>~ pushContext ("Ruby","RDoc Label"))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","Comment Line")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","Comment Line") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","Comment Line")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby","General Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","General Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","General Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","General Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Ruby","RDoc Label") =-  (currentContext >>= \x -> guard (x == ("Ruby","RDoc Label")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","RDoc Label") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ruby","RDoc Label")) >> pDefault >>= withAttribute OtherTok)  parseRules ("Ruby","find_heredoc") =   (((pRegExpr regex_'27'28'5cw'2b'29'27 >>= withAttribute KeywordTok) >>~ pushContext ("Ruby","apostrophed_normal_heredoc"))    <|>    ((pRegExpr regex_'22'3f'28'5cw'2b'29'22'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby","normal_heredoc"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","find_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","find_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","find_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","find_indented_heredoc") =   (((pRegExpr regex_'27'28'5cw'2b'29'27 >>= withAttribute KeywordTok) >>~ pushContext ("Ruby","apostrophed_indented_heredoc"))    <|>    ((pRegExpr regex_'22'3f'28'5cw'2b'29'22'3f >>= withAttribute KeywordTok) >>~ pushContext ("Ruby","indented_heredoc"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","find_indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","find_indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","find_indented_heredoc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","indented_heredoc") =   (((pFirstNonSpace >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Ruby","heredoc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","indented_heredoc")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","apostrophed_indented_heredoc") =   (((pFirstNonSpace >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_indented_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","apostrophed_indented_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_indented_heredoc")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","normal_heredoc") =   (((pColumn 0 >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("Ruby","heredoc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","normal_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","normal_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","normal_heredoc")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","apostrophed_normal_heredoc") =   (((pColumn 0 >> pRegExprDynamic "%1$" >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_normal_heredoc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","apostrophed_normal_heredoc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_normal_heredoc")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","heredoc_rules") =   (((pRegExpr regex_'23'40'7b1'2c2'7d >>= withAttribute OtherTok) >>~ pushContext ("Ruby","Short Subst"))    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","heredoc_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","heredoc_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","heredoc_rules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","find_gdl_input") =   (((pRegExpr regex_w'5c'28 >>= withAttribute OtherTok) >>~ pushContext ("Ruby","gdl_token_array_1"))@@ -658,7 +658,7 @@    <|>    ((pRegExpr regex_Q'3f'28'5b'5e'5cs'5cw'5d'29 >>= withAttribute OtherTok) >>~ pushContext ("Ruby","gdl_dq_string_5"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","find_gdl_input")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","find_gdl_input") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","find_gdl_input")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Ruby","gdl_dq_string_1") =   (((parseRules ("Ruby","dq_string_rules")))@@ -669,7 +669,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_1_nested") =   (((parseRules ("Ruby","dq_string_rules")))@@ -678,7 +678,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_2") =   (((parseRules ("Ruby","dq_string_rules")))@@ -689,7 +689,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_dq_string_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_2_nested") =   (((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_dq_string_2_nested"))@@ -698,7 +698,7 @@    <|>    ((parseRules ("Ruby","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_3") =   (((parseRules ("Ruby","dq_string_rules")))@@ -709,7 +709,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_3_nested") =   (((pDetectChar False '[' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_dq_string_3_nested"))@@ -718,7 +718,7 @@    <|>    ((parseRules ("Ruby","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_4") =   (((parseRules ("Ruby","dq_string_rules")))@@ -729,7 +729,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_4_nested") =   (((pDetectChar False '<' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_dq_string_4_nested"))@@ -738,7 +738,7 @@    <|>    ((parseRules ("Ruby","dq_string_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_dq_string_5") =   (((parseRules ("Ruby","dq_string_rules")))@@ -747,7 +747,7 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_dq_string_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_dq_string_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","dq_string_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))@@ -756,7 +756,7 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","dq_string_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","dq_string_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","dq_string_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_1") =   (((parseRules ("Ruby","token_array_rules")))@@ -767,7 +767,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_1_nested") =   (((parseRules ("Ruby","token_array_rules")))@@ -776,7 +776,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_2") =   (((parseRules ("Ruby","token_array_rules")))@@ -787,7 +787,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_token_array_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_2_nested") =   (((parseRules ("Ruby","token_array_rules")))@@ -796,7 +796,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_3") =   (((parseRules ("Ruby","token_array_rules")))@@ -807,7 +807,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_3_nested") =   (((parseRules ("Ruby","token_array_rules")))@@ -816,7 +816,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_4") =   (((parseRules ("Ruby","token_array_rules")))@@ -827,7 +827,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_4_nested") =   (((parseRules ("Ruby","token_array_rules")))@@ -836,7 +836,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_token_array_5") =   (((parseRules ("Ruby","token_array_rules")))@@ -845,12 +845,12 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_token_array_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_token_array_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","token_array_rules") =   (((pString False "\\\\" >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","token_array_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","token_array_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","token_array_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_1") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -861,7 +861,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_1_nested") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -870,7 +870,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_2") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -881,7 +881,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_apostrophed_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_2_nested") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -890,7 +890,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_3") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -901,7 +901,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_3_nested") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -910,7 +910,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_4") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -921,7 +921,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_4_nested") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -930,7 +930,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_apostrophed_5") =   (((parseRules ("Ruby","apostrophed_rules")))@@ -939,12 +939,12 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_apostrophed_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_apostrophed_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","apostrophed_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","apostrophed_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","apostrophed_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_1") =   (((parseRules ("Ruby","shell_command_rules")))@@ -955,7 +955,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_1")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_1_nested") =   (((parseRules ("Ruby","shell_command_rules")))@@ -964,7 +964,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_1_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_2") =   (((parseRules ("Ruby","shell_command_rules")))@@ -975,7 +975,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute StringTok) >>~ pushContext ("Ruby","gdl_shell_command_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_2")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_2_nested") =   (((parseRules ("Ruby","shell_command_rules")))@@ -984,7 +984,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_2_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_3") =   (((parseRules ("Ruby","shell_command_rules")))@@ -995,7 +995,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_3")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_3_nested") =   (((parseRules ("Ruby","shell_command_rules")))@@ -1004,7 +1004,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_3_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_4") =   (((parseRules ("Ruby","shell_command_rules")))@@ -1015,7 +1015,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_4")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_4_nested") =   (((parseRules ("Ruby","shell_command_rules")))@@ -1024,7 +1024,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_4_nested")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_shell_command_5") =   (((parseRules ("Ruby","shell_command_rules")))@@ -1033,7 +1033,7 @@    <|>    ((pRegExprDynamic "\\s*%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_shell_command_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_shell_command_5")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","shell_command_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute StringTok))@@ -1042,7 +1042,7 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","shell_command_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","shell_command_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","shell_command_rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Ruby","gdl_regexpr_1") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1053,7 +1053,7 @@    <|>    ((pRegExpr regex_'5c'29'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_1")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_1_nested") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1062,7 +1062,7 @@    <|>    ((pDetectChar False ')' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_1_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_1_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_1_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_2") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1073,7 +1073,7 @@    <|>    ((pDetectChar False '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby","gdl_regexpr_2_nested"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_2")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_2_nested") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1082,7 +1082,7 @@    <|>    ((pDetectChar False '}' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_2_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_2_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_2_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_3") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1093,7 +1093,7 @@    <|>    ((pRegExpr regex_'5c'5d'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_3")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_3_nested") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1102,7 +1102,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_3_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_3_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_3_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_4") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1113,7 +1113,7 @@    <|>    ((pRegExpr regex_'3e'5buiomxn'5d'2a >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_4")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_4_nested") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1122,7 +1122,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_4_nested")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_4_nested") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_4_nested")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","gdl_regexpr_5") =   (((parseRules ("Ruby","regexpr_rules")))@@ -1131,7 +1131,7 @@    <|>    ((pRegExprDynamic "\\s*%1[uiomxn]*" >>= withAttribute OtherTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","gdl_regexpr_5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","gdl_regexpr_5")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","regexpr_rules") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute OtherTok))@@ -1140,10 +1140,10 @@    <|>    ((pDetect2Chars False '#' '{' >>= withAttribute OtherTok) >>~ pushContext ("Ruby","Subst"))    <|>-   (currentContext >>= \x -> guard (x == ("Ruby","regexpr_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","regexpr_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Ruby","regexpr_rules")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Ruby","DATA") =-  (currentContext >>= \x -> guard (x == ("Ruby","DATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Ruby","DATA") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Ruby","DATA")) >> pDefault >>= withAttribute NormalTok)  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Scala.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,15 +42,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Scala","Normal") -> return ()-    ("Scala","String") -> (popContext) >> pEndLine-    ("Scala","Printf") -> (popContext) >> pEndLine-    ("Scala","PrintfString") -> (popContext) >> pEndLine-    ("Scala","Member") -> (popContext) >> pEndLine-    ("Scala","Commentar 1") -> (popContext) >> pEndLine-    ("Scala","Commentar 2") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Scala","Normal") -> return ()+      ("Scala","String") -> (popContext) >> pEndLine+      ("Scala","Printf") -> (popContext) >> pEndLine+      ("Scala","PrintfString") -> (popContext) >> pEndLine+      ("Scala","Member") -> (popContext) >> pEndLine+      ("Scala","Commentar 1") -> (popContext) >> pEndLine+      ("Scala","Commentar 2") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -74,8 +76,6 @@ regex_'25'28'25'7cn'29 = compileRegex "%(%|n)" regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 = compileRegex "\\b[_a-zA-Z]\\w*(?=[\\s]*)" -defaultAttributes = [(("Scala","Normal"),NormalTok),(("Scala","String"),StringTok),(("Scala","Printf"),NormalTok),(("Scala","PrintfString"),StringTok),(("Scala","Member"),NormalTok),(("Scala","Commentar 1"),CommentTok),(("Scala","Commentar 2"),CommentTok)]- parseRules ("Scala","Normal") =   (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))    <|>@@ -133,7 +133,7 @@    <|>    ((pAnyChar ":!%&()+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("Scala","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scala","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scala","String") =   (((pLineContinue >>= withAttribute StringTok))@@ -142,14 +142,14 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Scala","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scala","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Scala","Printf") =   (((pDetectChar False ';' >>= withAttribute NormalTok) >>~ (popContext))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Scala","PrintfString"))    <|>-   (currentContext >>= \x -> guard (x == ("Scala","Printf")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","Printf") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scala","Printf")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scala","PrintfString") =   (((pLineContinue >>= withAttribute StringTok))@@ -164,7 +164,7 @@    <|>    ((pRegExpr regex_'25'28'25'7cn'29 >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("Scala","PrintfString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","PrintfString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scala","PrintfString")) >> pDefault >>= withAttribute StringTok))  parseRules ("Scala","Member") =   (((pRegExpr regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 >>= withAttribute FunctionTok) >>~ (popContext))@@ -172,12 +172,12 @@    ((popContext) >> currentContext >>= parseRules))  parseRules ("Scala","Commentar 1") =-  (currentContext >>= \x -> guard (x == ("Scala","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","Commentar 1") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Scala","Commentar 1")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Scala","Commentar 2") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Scala","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scala","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scala","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression 
Text/Highlighting/Kate/Syntax/Scheme.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,20 +41,23 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Scheme","Level0") -> return ()-    ("Scheme","Default") -> return ()-    ("Scheme","MultiLineComment") -> return ()-    ("Scheme","SpecialNumber") -> (popContext) >> pEndLine-    ("Scheme","String") -> return ()-    ("Scheme","function_decl") -> return ()-    ("Scheme","Level1") -> return ()-    ("Scheme","Level2") -> return ()-    ("Scheme","Level3") -> return ()-    ("Scheme","Level4") -> return ()-    ("Scheme","Level5") -> return ()-    ("Scheme","Level6") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Scheme","Level0") -> return ()+      ("Scheme","Default") -> return ()+      ("Scheme","MultiLineComment") -> return ()+      ("Scheme","SpecialNumber") -> (popContext) >> pEndLine+      ("Scheme","String") -> return ()+      ("Scheme","function_decl") -> return ()+      ("Scheme","Level1") -> return ()+      ("Scheme","Level2") -> return ()+      ("Scheme","Level3") -> return ()+      ("Scheme","Level4") -> return ()+      ("Scheme","Level5") -> return ()+      ("Scheme","Level6") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -78,14 +80,12 @@ regex_'5cd'2a'28'5c'2e'5cd'2b'29'3f = compileRegex "\\d*(\\.\\d+)?" regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a = compileRegex "\\s*[A-Za-z0-9-+\\<\\>//\\*]*\\s*" -defaultAttributes = [(("Scheme","Level0"),NormalTok),(("Scheme","Default"),NormalTok),(("Scheme","MultiLineComment"),CommentTok),(("Scheme","SpecialNumber"),NormalTok),(("Scheme","String"),StringTok),(("Scheme","function_decl"),FunctionTok),(("Scheme","Level1"),NormalTok),(("Scheme","Level2"),NormalTok),(("Scheme","Level3"),NormalTok),(("Scheme","Level4"),NormalTok),(("Scheme","Level5"),NormalTok),(("Scheme","Level6"),NormalTok)]- parseRules ("Scheme","Level0") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level1"))    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level0")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level0") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level0")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Default") =   (((pRegExpr regex_'3b'2b'5cs'2aBEGIN'2e'2a'24 >>= withAttribute RegionMarkerTok))@@ -118,12 +118,12 @@    <|>    ((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level1"))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Default")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Default") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Default")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","MultiLineComment") =   (((pColumn 0 >> pRegExpr regex_'21'23'5cs'2a'24 >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Scheme","SpecialNumber") =   (((pRegExpr regex_'5cd'2a'28'5c'2e'5cd'2b'29'3f >>= withAttribute DecValTok) >>~ (popContext))@@ -141,12 +141,12 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Scheme","function_decl") =   (((pRegExpr regex_'5cs'2a'5bA'2dZa'2dz0'2d9'2d'2b'5c'3c'5c'3e'2f'2f'5c'2a'5d'2a'5cs'2a >>= withAttribute FunctionTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","function_decl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","function_decl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","function_decl")) >> pDefault >>= withAttribute FunctionTok))  parseRules ("Scheme","Level1") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level2"))@@ -155,7 +155,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Level2") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level3"))@@ -164,7 +164,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Level3") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level4"))@@ -173,7 +173,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level3")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level3") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level3")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Level4") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level5"))@@ -182,7 +182,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level4")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level4") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level4")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Level5") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level6"))@@ -191,7 +191,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level5")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level5") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level5")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Scheme","Level6") =   (((pDetectChar False '(' >>= withAttribute NormalTok) >>~ pushContext ("Scheme","Level1"))@@ -200,7 +200,7 @@    <|>    ((parseRules ("Scheme","Default")))    <|>-   (currentContext >>= \x -> guard (x == ("Scheme","Level6")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Scheme","Level6") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Scheme","Level6")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Scheme","Level0") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Sci.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,9 +41,12 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("scilab","main") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("scilab","main") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -61,8 +63,6 @@  regex_'2f'2f'2e'2a'24 = compileRegex "//.*$" -defaultAttributes = [(("scilab","main"),NormalTok)]- parseRules ("scilab","main") =   (((pKeyword " \n\t.():!+,-<=>&*/;?[]^{|}~\\" list_Structure'2dkeywords >>= withAttribute NormalTok))    <|>@@ -84,7 +84,7 @@    <|>    ((pRangeDetect '"' '"' >>= withAttribute StringTok))    <|>-   (currentContext >>= \x -> guard (x == ("scilab","main")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("scilab","main") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("scilab","main")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("scilab","main") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Sed.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,36 +40,39 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("sed","BeginningOfLine") -> return ()-    ("sed","FirstAddressRegex") -> pushContext ("sed","Error") >> return ()-    ("sed","AfterFirstAddress") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","AfterFirstAddress2") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","SecondAddress") -> pushContext ("sed","Error") >> return ()-    ("sed","SecondAddressRegex") -> pushContext ("sed","Error") >> return ()-    ("sed","AfterSecondAddress") -> pushContext ("sed","Error") >> return ()-    ("sed","Step") -> pushContext ("sed","Error") >> return ()-    ("sed","Command") -> pushContext ("sed","Error") >> return ()-    ("sed","SCommand") -> pushContext ("sed","Error") >> return ()-    ("sed","SRegex") -> pushContext ("sed","Error") >> return ()-    ("sed","SReplacement") -> pushContext ("sed","Error") >> return ()-    ("sed","SFlags") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","WFlag") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","YCommand") -> pushContext ("sed","Error") >> return ()-    ("sed","YSourceList") -> pushContext ("sed","Error") >> return ()-    ("sed","YDestList") -> pushContext ("sed","Error") >> return ()-    ("sed","AICCommand") -> pushContext ("sed","Error") >> return ()-    ("sed","LiteralText") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","BTCommand") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","WRCommand") -> pushContext ("sed","Error") >> return ()-    ("sed","LCommand") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","QCommand") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","Label") -> pushContext ("sed","Error") >> return ()-    ("sed","AfterCommand") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","Regex") -> pushContext ("sed","Error") >> return ()-    ("sed","Comment") -> pushContext ("sed","BeginningOfLine") >> return ()-    ("sed","Error") -> pushContext ("sed","BeginningOfLine") >> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("sed","BeginningOfLine") -> return ()+      ("sed","FirstAddressRegex") -> pushContext ("sed","Error") >> return ()+      ("sed","AfterFirstAddress") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","AfterFirstAddress2") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","SecondAddress") -> pushContext ("sed","Error") >> return ()+      ("sed","SecondAddressRegex") -> pushContext ("sed","Error") >> return ()+      ("sed","AfterSecondAddress") -> pushContext ("sed","Error") >> return ()+      ("sed","Step") -> pushContext ("sed","Error") >> return ()+      ("sed","Command") -> pushContext ("sed","Error") >> return ()+      ("sed","SCommand") -> pushContext ("sed","Error") >> return ()+      ("sed","SRegex") -> pushContext ("sed","Error") >> return ()+      ("sed","SReplacement") -> pushContext ("sed","Error") >> return ()+      ("sed","SFlags") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","WFlag") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","YCommand") -> pushContext ("sed","Error") >> return ()+      ("sed","YSourceList") -> pushContext ("sed","Error") >> return ()+      ("sed","YDestList") -> pushContext ("sed","Error") >> return ()+      ("sed","AICCommand") -> pushContext ("sed","Error") >> return ()+      ("sed","LiteralText") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","BTCommand") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","WRCommand") -> pushContext ("sed","Error") >> return ()+      ("sed","LCommand") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","QCommand") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","Label") -> pushContext ("sed","Error") >> return ()+      ("sed","AfterCommand") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","Regex") -> pushContext ("sed","Error") >> return ()+      ("sed","Comment") -> pushContext ("sed","BeginningOfLine") >> return ()+      ("sed","Error") -> pushContext ("sed","BeginningOfLine") >> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -87,8 +89,6 @@ regex_'5cS'2b = compileRegex "\\S+" regex_'5cw'2b = compileRegex "\\w+" -defaultAttributes = [(("sed","BeginningOfLine"),NormalTok),(("sed","FirstAddressRegex"),StringTok),(("sed","AfterFirstAddress"),NormalTok),(("sed","AfterFirstAddress2"),NormalTok),(("sed","SecondAddress"),NormalTok),(("sed","SecondAddressRegex"),StringTok),(("sed","AfterSecondAddress"),NormalTok),(("sed","Step"),NormalTok),(("sed","Command"),NormalTok),(("sed","SCommand"),NormalTok),(("sed","SRegex"),StringTok),(("sed","SReplacement"),StringTok),(("sed","SFlags"),NormalTok),(("sed","WFlag"),NormalTok),(("sed","YCommand"),NormalTok),(("sed","YSourceList"),StringTok),(("sed","YDestList"),StringTok),(("sed","AICCommand"),NormalTok),(("sed","LiteralText"),OtherTok),(("sed","BTCommand"),NormalTok),(("sed","WRCommand"),NormalTok),(("sed","LCommand"),NormalTok),(("sed","QCommand"),NormalTok),(("sed","Label"),NormalTok),(("sed","AfterCommand"),NormalTok),(("sed","Regex"),StringTok),(("sed","Comment"),CommentTok),(("sed","Error"),ErrorTok)]- parseRules ("sed","BeginningOfLine") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -112,7 +112,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","BeginningOfLine")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","BeginningOfLine") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","BeginningOfLine")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","FirstAddressRegex") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -123,7 +123,7 @@    <|>    ((parseRules ("sed","Regex")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","FirstAddressRegex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","FirstAddressRegex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","FirstAddressRegex")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","AfterFirstAddress") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -134,7 +134,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","AfterFirstAddress")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","AfterFirstAddress") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","AfterFirstAddress")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","AfterFirstAddress2") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -147,7 +147,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","AfterFirstAddress2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","AfterFirstAddress2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","AfterFirstAddress2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","SecondAddress") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -162,7 +162,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SecondAddress")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SecondAddress") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SecondAddress")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","SecondAddressRegex") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -173,7 +173,7 @@    <|>    ((parseRules ("sed","Regex")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SecondAddressRegex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SecondAddressRegex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SecondAddressRegex")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","AfterSecondAddress") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -184,7 +184,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","AfterSecondAddress")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","AfterSecondAddress") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","AfterSecondAddress")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","Step") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -193,7 +193,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","Step")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Step") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","Step")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","Command") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -218,14 +218,14 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","Command")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Command") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","Command")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","SCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'28'5cS'29 >>= withAttribute StringTok) >>~ pushContext ("sed","SRegex"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","SRegex") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -236,7 +236,7 @@    <|>    ((parseRules ("sed","Regex")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SRegex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SRegex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SRegex")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","SReplacement") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -249,7 +249,7 @@    <|>    ((pDetectChar False '&' >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SReplacement")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SReplacement") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SReplacement")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","SFlags") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -262,21 +262,21 @@    <|>    ((parseRules ("sed","AfterCommand")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","SFlags")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","SFlags") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","SFlags")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","WFlag") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'5cS'2b >>= withAttribute BaseNTok) >>~ pushContext ("sed","SFlags"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","WFlag")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","WFlag") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","WFlag")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","YCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'28'5cS'29 >>= withAttribute StringTok) >>~ pushContext ("sed","YSourceList"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","YCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","YCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","YCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","YSourceList") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -289,7 +289,7 @@    <|>    ((pDetect2Chars False '\\' '\\' >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("sed","YSourceList")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","YSourceList") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","YSourceList")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","YDestList") =   (((pDetectSpaces >>= withAttribute StringTok))@@ -302,7 +302,7 @@    <|>    ((pDetect2Chars False '\\' '\\' >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("sed","YDestList")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","YDestList") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","YDestList")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","AICCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -311,7 +311,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","AICCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","AICCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","AICCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","LiteralText") =   (((pDetect2Chars False '\\' '\\' >>= withAttribute OtherTok) >>~ pushContext ("sed","LiteralText"))@@ -320,7 +320,7 @@    <|>    ((pDetectChar False '\\' >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","LiteralText")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","LiteralText") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","LiteralText")) >> pDefault >>= withAttribute OtherTok))  parseRules ("sed","BTCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -329,14 +329,14 @@    <|>    ((parseRules ("sed","AfterCommand")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","BTCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","BTCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","BTCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","WRCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>    ((pRegExpr regex_'5cS'2b >>= withAttribute BaseNTok) >>~ pushContext ("sed","AfterCommand"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","WRCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","WRCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","WRCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","LCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -345,7 +345,7 @@    <|>    ((parseRules ("sed","AfterCommand")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","LCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","LCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","LCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","QCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -354,7 +354,7 @@    <|>    ((parseRules ("sed","AfterCommand")))    <|>-   (currentContext >>= \x -> guard (x == ("sed","QCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","QCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","QCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","Label") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -363,7 +363,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","Label")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Label") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","Label")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","AfterCommand") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -376,7 +376,7 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok) >>~ pushContext ("sed","Error"))    <|>-   (currentContext >>= \x -> guard (x == ("sed","AfterCommand")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","AfterCommand") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","AfterCommand")) >> pDefault >>= withAttribute NormalTok))  parseRules ("sed","Regex") =   (((pDetect2Chars False '\\' '(' >>= withAttribute CharTok))@@ -443,13 +443,13 @@    <|>    ((pDetectChar False ']' >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("sed","Regex")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Regex") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("sed","Regex")) >> pDefault >>= withAttribute StringTok))  parseRules ("sed","Comment") =-  (currentContext >>= \x -> guard (x == ("sed","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("sed","Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("sed","Error") =-  (currentContext >>= \x -> guard (x == ("sed","Error")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("sed","Error") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("sed","Error")) >> pDefault >>= withAttribute ErrorTok)   parseRules x = parseRules ("sed","BeginningOfLine") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Sgml.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,13 +40,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("SGML","Normal Text") -> return ()-    ("SGML","Attribute") -> return ()-    ("SGML","Value") -> return ()-    ("SGML","Value 2") -> return ()-    ("SGML","Comment") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("SGML","Normal Text") -> return ()+      ("SGML","Attribute") -> return ()+      ("SGML","Value") -> return ()+      ("SGML","Value 2") -> return ()+      ("SGML","Comment") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -59,14 +61,12 @@ regex_'3c'5cs'2a'5c'2f'3f'5cs'2a'5ba'2dzA'2dZ'5f'3a'5d'5ba'2dzA'2dZ0'2d9'2e'5f'3a'2d'5d'2a = compileRegex "<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" regex_'5cs'2a'3d'5cs'2a = compileRegex "\\s*=\\s*" -defaultAttributes = [(("SGML","Normal Text"),NormalTok),(("SGML","Attribute"),OtherTok),(("SGML","Value"),DataTypeTok),(("SGML","Value 2"),DataTypeTok),(("SGML","Comment"),CommentTok)]- parseRules ("SGML","Normal Text") =   (((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("SGML","Comment"))    <|>    ((pRegExpr regex_'3c'5cs'2a'5c'2f'3f'5cs'2a'5ba'2dzA'2dZ'5f'3a'5d'5ba'2dzA'2dZ0'2d9'2e'5f'3a'2d'5d'2a >>= withAttribute KeywordTok) >>~ pushContext ("SGML","Attribute"))    <|>-   (currentContext >>= \x -> guard (x == ("SGML","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SGML","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SGML","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SGML","Attribute") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -75,7 +75,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("SGML","Value"))    <|>-   (currentContext >>= \x -> guard (x == ("SGML","Attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SGML","Attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SGML","Attribute")) >> pDefault >>= withAttribute OtherTok))  parseRules ("SGML","Value") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -84,17 +84,17 @@    <|>    ((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ pushContext ("SGML","Value 2"))    <|>-   (currentContext >>= \x -> guard (x == ("SGML","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SGML","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SGML","Value")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("SGML","Value 2") =   (((pDetectChar False '"' >>= withAttribute DataTypeTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SGML","Value 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SGML","Value 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SGML","Value 2")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("SGML","Comment") =   (((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SGML","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SGML","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SGML","Comment")) >> pDefault >>= withAttribute CommentTok))   parseRules x = parseRules ("SGML","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Sql.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,15 +41,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("SQL","Normal") -> return ()-    ("SQL","String literal") -> return ()-    ("SQL","Singleline PL/SQL-style comment") -> (popContext) >> pEndLine-    ("SQL","Multiline C-style comment") -> return ()-    ("SQL","SQL*Plus remark directive") -> (popContext) >> pEndLine-    ("SQL","User-defined identifier") -> (popContext) >> pEndLine-    ("SQL","SQL*Plus directive to include file") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("SQL","Normal") -> return ()+      ("SQL","String literal") -> return ()+      ("SQL","Singleline PL/SQL-style comment") -> (popContext) >> pEndLine+      ("SQL","Multiline C-style comment") -> return ()+      ("SQL","SQL*Plus remark directive") -> (popContext) >> pEndLine+      ("SQL","User-defined identifier") -> (popContext) >> pEndLine+      ("SQL","SQL*Plus directive to include file") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -70,8 +72,6 @@ regex_'40'40'3f'5b'5e'40_'5ct'5cr'5cn'5d = compileRegex "@@?[^@ \\t\\r\\n]" regex_'26'26'3f'5cw'2b = compileRegex "&&?\\w+" -defaultAttributes = [(("SQL","Normal"),NormalTok),(("SQL","String literal"),StringTok),(("SQL","Singleline PL/SQL-style comment"),CommentTok),(("SQL","Multiline C-style comment"),CommentTok),(("SQL","SQL*Plus remark directive"),CommentTok),(("SQL","User-defined identifier"),OtherTok),(("SQL","SQL*Plus directive to include file"),OtherTok)]- parseRules ("SQL","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -109,7 +109,7 @@    <|>    ((pColumn 0 >> pRegExpr regex_'40'40'3f'5b'5e'40_'5ct'5cr'5cn'5d >>= withAttribute OtherTok) >>~ pushContext ("SQL","SQL*Plus directive to include file"))    <|>-   (currentContext >>= \x -> guard (x == ("SQL","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SQL","String literal") =   (((pDetect2Chars False '\\' '\'' >>= withAttribute StringTok) >>~ (popContext))@@ -122,26 +122,26 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL","String literal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","String literal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL","String literal")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL","Singleline PL/SQL-style comment") =-  (currentContext >>= \x -> guard (x == ("SQL","Singleline PL/SQL-style comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","Singleline PL/SQL-style comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL","Singleline PL/SQL-style comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("SQL","Multiline C-style comment") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL","Multiline C-style comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","Multiline C-style comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL","Multiline C-style comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("SQL","SQL*Plus remark directive") =-  (currentContext >>= \x -> guard (x == ("SQL","SQL*Plus remark directive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","SQL*Plus remark directive") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL","SQL*Plus remark directive")) >> pDefault >>= withAttribute CommentTok)  parseRules ("SQL","User-defined identifier") =   (((pDetectChar False '"' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL","User-defined identifier")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","User-defined identifier") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL","User-defined identifier")) >> pDefault >>= withAttribute OtherTok))  parseRules ("SQL","SQL*Plus directive to include file") =-  (currentContext >>= \x -> guard (x == ("SQL","SQL*Plus directive to include file")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL","SQL*Plus directive to include file") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL","SQL*Plus directive to include file")) >> pDefault >>= withAttribute OtherTok)   parseRules x = parseRules ("SQL","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/SqlMysql.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,15 +41,18 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("SQL (MySQL)","Normal") -> return ()-    ("SQL (MySQL)","String") -> return ()-    ("SQL (MySQL)","String2") -> return ()-    ("SQL (MySQL)","Name") -> return ()-    ("SQL (MySQL)","SingleLineComment") -> (popContext) >> pEndLine-    ("SQL (MySQL)","MultiLineComment") -> return ()-    ("SQL (MySQL)","Preprocessor") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("SQL (MySQL)","Normal") -> return ()+      ("SQL (MySQL)","String") -> return ()+      ("SQL (MySQL)","String2") -> return ()+      ("SQL (MySQL)","Name") -> return ()+      ("SQL (MySQL)","SingleLineComment") -> (popContext) >> pEndLine+      ("SQL (MySQL)","MultiLineComment") -> return ()+      ("SQL (MySQL)","Preprocessor") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -70,8 +72,6 @@ regex_'2f'24 = compileRegex "/$" regex_'40'40'3f'5b'5e'40_'5ct'5cr'5cn'5d = compileRegex "@@?[^@ \\t\\r\\n]" -defaultAttributes = [(("SQL (MySQL)","Normal"),NormalTok),(("SQL (MySQL)","String"),StringTok),(("SQL (MySQL)","String2"),StringTok),(("SQL (MySQL)","Name"),StringTok),(("SQL (MySQL)","SingleLineComment"),CommentTok),(("SQL (MySQL)","MultiLineComment"),CommentTok),(("SQL (MySQL)","Preprocessor"),OtherTok)]- parseRules ("SQL (MySQL)","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -119,7 +119,7 @@    <|>    ((pDetectChar False '.' >>= withAttribute CharTok))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SQL (MySQL)","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -130,7 +130,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL (MySQL)","String2") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -141,7 +141,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","String2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","String2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","String2")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL (MySQL)","Name") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -150,20 +150,20 @@    <|>    ((pDetectChar False '`' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Name")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","Name") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Name")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL (MySQL)","SingleLineComment") =-  (currentContext >>= \x -> guard (x == ("SQL (MySQL)","SingleLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","SingleLineComment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL (MySQL)","SingleLineComment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("SQL (MySQL)","MultiLineComment") =   (((pLineContinue >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (MySQL)","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("SQL (MySQL)","Preprocessor") =-  (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (MySQL)","Preprocessor") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL (MySQL)","Preprocessor")) >> pDefault >>= withAttribute OtherTok)   parseRules x = parseRules ("SQL (MySQL)","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/SqlPostgresql.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,17 +41,20 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("SQL (PostgreSQL)","Normal") -> return ()-    ("SQL (PostgreSQL)","CreateFunction") -> return ()-    ("SQL (PostgreSQL)","FunctionBody") -> return ()-    ("SQL (PostgreSQL)","MultiLineString") -> return ()-    ("SQL (PostgreSQL)","String") -> return ()-    ("SQL (PostgreSQL)","SingleLineComment") -> (popContext) >> pEndLine-    ("SQL (PostgreSQL)","MultiLineComment") -> return ()-    ("SQL (PostgreSQL)","Identifier") -> (popContext) >> pEndLine-    ("SQL (PostgreSQL)","Preprocessor") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("SQL (PostgreSQL)","Normal") -> return ()+      ("SQL (PostgreSQL)","CreateFunction") -> return ()+      ("SQL (PostgreSQL)","FunctionBody") -> return ()+      ("SQL (PostgreSQL)","MultiLineString") -> return ()+      ("SQL (PostgreSQL)","String") -> return ()+      ("SQL (PostgreSQL)","SingleLineComment") -> (popContext) >> pEndLine+      ("SQL (PostgreSQL)","MultiLineComment") -> return ()+      ("SQL (PostgreSQL)","Identifier") -> (popContext) >> pEndLine+      ("SQL (PostgreSQL)","Preprocessor") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -77,8 +79,6 @@ regex_'2f'24 = compileRegex "/$" regex_'40'40'3f'5b'5e'40_'5ct'5cr'5cn'5d = compileRegex "@@?[^@ \\t\\r\\n]" -defaultAttributes = [(("SQL (PostgreSQL)","Normal"),NormalTok),(("SQL (PostgreSQL)","CreateFunction"),NormalTok),(("SQL (PostgreSQL)","FunctionBody"),NormalTok),(("SQL (PostgreSQL)","MultiLineString"),StringTok),(("SQL (PostgreSQL)","String"),StringTok),(("SQL (PostgreSQL)","SingleLineComment"),CommentTok),(("SQL (PostgreSQL)","MultiLineComment"),CommentTok),(("SQL (PostgreSQL)","Identifier"),OtherTok),(("SQL (PostgreSQL)","Preprocessor"),OtherTok)]- parseRules ("SQL (PostgreSQL)","Normal") =   (((pString False "CREATE FUNCTION" >>= withAttribute KeywordTok) >>~ pushContext ("SQL (PostgreSQL)","CreateFunction"))    <|>@@ -130,26 +130,26 @@    <|>    ((pRegExprDynamic "\\$([^\\$\\n\\r]*)\\$" >>= withAttribute NormalTok) >>~ pushContext ("SQL (PostgreSQL)","MultiLineString"))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SQL (PostgreSQL)","CreateFunction") =   (((pRegExprDynamic "\\$([^\\$\\n\\r]*)\\$" >>= withAttribute FunctionTok) >>~ pushContext ("SQL (PostgreSQL)","FunctionBody"))    <|>    ((parseRules ("SQL (PostgreSQL)","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","CreateFunction")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","CreateFunction") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","CreateFunction")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SQL (PostgreSQL)","FunctionBody") =   (((pRegExprDynamic "\\$%1\\$" >>= withAttribute FunctionTok) >>~ (popContext >> popContext))    <|>    ((parseRules ("SQL (PostgreSQL)","Normal")))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","FunctionBody")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","FunctionBody") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","FunctionBody")) >> pDefault >>= withAttribute NormalTok))  parseRules ("SQL (PostgreSQL)","MultiLineString") =   (((pRegExprDynamic "\\$%1\\$" >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","MultiLineString")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","MultiLineString") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","MultiLineString")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL (PostgreSQL)","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ (popContext))@@ -160,25 +160,25 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("SQL (PostgreSQL)","SingleLineComment") =-  (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","SingleLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","SingleLineComment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","SingleLineComment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("SQL (PostgreSQL)","MultiLineComment") =   (((pLineContinue >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","MultiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","MultiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","MultiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("SQL (PostgreSQL)","Identifier") =   (((pDetectChar False '"' >>= withAttribute OtherTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Identifier")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","Identifier") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Identifier")) >> pDefault >>= withAttribute OtherTok))  parseRules ("SQL (PostgreSQL)","Preprocessor") =-  (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("SQL (PostgreSQL)","Preprocessor") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("SQL (PostgreSQL)","Preprocessor")) >> pDefault >>= withAttribute OtherTok)   parseRules x = parseRules ("SQL (PostgreSQL)","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Tcl.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,12 +41,15 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Tcl/Tk","Base") -> return ()-    ("Tcl/Tk","String") -> return ()-    ("Tcl/Tk","Comment") -> (popContext) >> pEndLine-    ("Tcl/Tk","New command line") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Tcl/Tk","Base") -> return ()+      ("Tcl/Tk","String") -> return ()+      ("Tcl/Tk","Comment") -> (popContext) >> pEndLine+      ("Tcl/Tk","New command line") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -69,8 +71,6 @@ regex_'5cs'2a'23 = compileRegex "\\s*#" regex_'2e = compileRegex "." -defaultAttributes = [(("Tcl/Tk","Base"),NormalTok),(("Tcl/Tk","String"),StringTok),(("Tcl/Tk","Comment"),CommentTok),(("Tcl/Tk","New command line"),NormalTok)]- parseRules ("Tcl/Tk","Base") =   (((pFirstNonSpace >> pRegExpr regex_'23'5cs'2aBEGIN'2e'2a'24 >>= withAttribute RegionMarkerTok))    <|>@@ -108,7 +108,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("Tcl/Tk","Base")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Tcl/Tk","Base") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Tcl/Tk","Base")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Tcl/Tk","String") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute CharTok))@@ -117,17 +117,17 @@    <|>    ((pDetectChar False '$' >>= withAttribute DataTypeTok))    <|>-   (currentContext >>= \x -> guard (x == ("Tcl/Tk","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Tcl/Tk","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Tcl/Tk","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Tcl/Tk","Comment") =-  (currentContext >>= \x -> guard (x == ("Tcl/Tk","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Tcl/Tk","Comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Tcl/Tk","Comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("Tcl/Tk","New command line") =   (((pRegExpr regex_'5cs'2a'23 >>= withAttribute CommentTok) >>~ pushContext ("Tcl/Tk","Comment"))    <|>    ((lookAhead (pRegExpr regex_'2e) >> (popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("Tcl/Tk","New command line")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Tcl/Tk","New command line") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Tcl/Tk","New command line")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("Tcl/Tk","Base") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Texinfo.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,13 +41,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Texinfo","Normal Text") -> return ()-    ("Texinfo","singleLineComment") -> (popContext) >> pEndLine-    ("Texinfo","multiLineComment") -> return ()-    ("Texinfo","nodeFolding") -> return ()-    ("Texinfo","folding") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Texinfo","Normal Text") -> return ()+      ("Texinfo","singleLineComment") -> (popContext) >> pEndLine+      ("Texinfo","multiLineComment") -> return ()+      ("Texinfo","nodeFolding") -> return ()+      ("Texinfo","folding") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -64,8 +66,6 @@ regex_'40'5b'5cw'5d'2b'28'5c'7b'28'5b'5cw'5d'2b'5b'5cs'5d'2a'29'2b'5c'7d'29'3f = compileRegex "@[\\w]+(\\{([\\w]+[\\s]*)+\\})?" regex_'40end_'28menu'7csmallexample'7ctable'7cmultitable'29'5cb = compileRegex "@end (menu|smallexample|table|multitable)\\b" -defaultAttributes = [(("Texinfo","Normal Text"),NormalTok),(("Texinfo","singleLineComment"),CommentTok),(("Texinfo","multiLineComment"),CommentTok),(("Texinfo","nodeFolding"),NormalTok),(("Texinfo","folding"),NormalTok)]- parseRules ("Texinfo","Normal Text") =   (((pRegExpr regex_'40c'28omment'29'3f'5cb >>= withAttribute CommentTok) >>~ pushContext ("Texinfo","singleLineComment"))    <|>@@ -77,33 +77,33 @@    <|>    ((pRegExpr regex_'40'5b'5cw'5d'2b'28'5c'7b'28'5b'5cw'5d'2b'5b'5cs'5d'2a'29'2b'5c'7d'29'3f >>= withAttribute FunctionTok))    <|>-   (currentContext >>= \x -> guard (x == ("Texinfo","Normal Text")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Texinfo","Normal Text") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Texinfo","Normal Text")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Texinfo","singleLineComment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Texinfo","singleLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Texinfo","singleLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Texinfo","singleLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Texinfo","multiLineComment") =   (((pString False "@end ignore" >>= withAttribute CommentTok) >>~ (popContext))    <|>    ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Texinfo","multiLineComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Texinfo","multiLineComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Texinfo","multiLineComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Texinfo","nodeFolding") =   (((lookAhead (pRegExpr regex_'40node'5cb) >> (popContext) >> currentContext >>= parseRules))    <|>    ((parseRules ("Texinfo","Normal Text")))    <|>-   (currentContext >>= \x -> guard (x == ("Texinfo","nodeFolding")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Texinfo","nodeFolding") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Texinfo","nodeFolding")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Texinfo","folding") =   (((pRegExpr regex_'40end_'28menu'7csmallexample'7ctable'7cmultitable'29'5cb >>= withAttribute FunctionTok) >>~ (popContext))    <|>    ((parseRules ("Texinfo","Normal Text")))    <|>-   (currentContext >>= \x -> guard (x == ("Texinfo","folding")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Texinfo","folding") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Texinfo","folding")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Verilog.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,18 +42,21 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Verilog","Normal") -> return ()-    ("Verilog","String") -> (popContext) >> pEndLine-    ("Verilog","Commentar 1") -> (popContext) >> pEndLine-    ("Verilog","Commentar 2") -> return ()-    ("Verilog","Preprocessor") -> (popContext) >> pEndLine-    ("Verilog","Commentar/Preprocessor") -> return ()-    ("Verilog","Some Context") -> (popContext) >> pEndLine-    ("Verilog","Some Context2") -> return ()-    ("Verilog","Block name") -> (popContext) >> pEndLine-    ("Verilog","Port") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Verilog","Normal") -> return ()+      ("Verilog","String") -> (popContext) >> pEndLine+      ("Verilog","Commentar 1") -> (popContext) >> pEndLine+      ("Verilog","Commentar 2") -> return ()+      ("Verilog","Preprocessor") -> (popContext) >> pEndLine+      ("Verilog","Commentar/Preprocessor") -> return ()+      ("Verilog","Some Context") -> (popContext) >> pEndLine+      ("Verilog","Some Context2") -> return ()+      ("Verilog","Block name") -> (popContext) >> pEndLine+      ("Verilog","Port") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -80,8 +82,6 @@ regex_'5c'24'5ba'2dzA'2dZ'5f'5d'2b'5cw'2a = compileRegex "\\$[a-zA-Z_]+\\w*" regex_'23'5b'5cd'5f'5d'2b = compileRegex "#[\\d_]+" -defaultAttributes = [(("Verilog","Normal"),NormalTok),(("Verilog","String"),StringTok),(("Verilog","Commentar 1"),CommentTok),(("Verilog","Commentar 2"),CommentTok),(("Verilog","Preprocessor"),OtherTok),(("Verilog","Commentar/Preprocessor"),CommentTok),(("Verilog","Some Context"),NormalTok),(("Verilog","Some Context2"),CommentTok),(("Verilog","Block name"),DataTypeTok),(("Verilog","Port"),NormalTok)]- parseRules ("Verilog","Normal") =   (((pDetectSpaces >>= withAttribute NormalTok))    <|>@@ -131,7 +131,7 @@    <|>    ((pRegExpr regex_'23'5b'5cd'5f'5d'2b >>= withAttribute BaseNTok))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Verilog","String") =   (((pLineContinue >>= withAttribute StringTok) >>~ pushContext ("Verilog","Some Context"))@@ -140,19 +140,19 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Verilog","Commentar 1") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Commentar 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Commentar 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Commentar 1")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Verilog","Commentar 2") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Commentar 2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Commentar 2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Commentar 2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Verilog","Preprocessor") =   (((pLineContinue >>= withAttribute OtherTok) >>~ pushContext ("Verilog","Some Context"))@@ -165,32 +165,32 @@    <|>    ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Verilog","Commentar/Preprocessor"))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Preprocessor")) >> pDefault >>= withAttribute OtherTok))  parseRules ("Verilog","Commentar/Preprocessor") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Commentar/Preprocessor")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Commentar/Preprocessor") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Commentar/Preprocessor")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Verilog","Some Context") =-  (currentContext >>= \x -> guard (x == ("Verilog","Some Context")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Some Context") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("Verilog","Some Context")) >> pDefault >>= withAttribute NormalTok)  parseRules ("Verilog","Some Context2") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pFirstNonSpace >> pString False "#endif" >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Some Context2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Some Context2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Some Context2")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Verilog","Block name") =   (((pDetectIdentifier >>= withAttribute DataTypeTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Block name")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Block name") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Block name")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Verilog","Port") =   (((pDetectIdentifier >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Verilog","Port")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Verilog","Port") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Verilog","Port")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Vhdl.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,34 +41,37 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("VHDL","start") -> return ()-    ("VHDL","package") -> return ()-    ("VHDL","packagebody") -> return ()-    ("VHDL","architecture_main") -> return ()-    ("VHDL","arch_decl") -> return ()-    ("VHDL","detect_arch_parts") -> return ()-    ("VHDL","generate1") -> return ()-    ("VHDL","generate2") -> return ()-    ("VHDL","process1") -> return ()-    ("VHDL","proc_rules") -> return ()-    ("VHDL","instance") -> return ()-    ("VHDL","forOrWhile") -> return ()-    ("VHDL","if_start") -> return ()-    ("VHDL","if") -> return ()-    ("VHDL","case1") -> return ()-    ("VHDL","case2") -> return ()-    ("VHDL","caseWhen") -> return ()-    ("VHDL","entity") -> return ()-    ("VHDL","entity_main") -> return ()-    ("VHDL","preDetection") -> return ()-    ("VHDL","generalDetection") -> return ()-    ("VHDL","comment") -> (popContext) >> pEndLine-    ("VHDL","string") -> return ()-    ("VHDL","attribute") -> (popContext) >> pEndLine-    ("VHDL","quot in att") -> return ()-    ("VHDL","signal") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("VHDL","start") -> return ()+      ("VHDL","package") -> return ()+      ("VHDL","packagebody") -> return ()+      ("VHDL","architecture_main") -> return ()+      ("VHDL","arch_decl") -> return ()+      ("VHDL","detect_arch_parts") -> return ()+      ("VHDL","generate1") -> return ()+      ("VHDL","generate2") -> return ()+      ("VHDL","process1") -> return ()+      ("VHDL","proc_rules") -> return ()+      ("VHDL","instance") -> return ()+      ("VHDL","forOrWhile") -> return ()+      ("VHDL","if_start") -> return ()+      ("VHDL","if") -> return ()+      ("VHDL","case1") -> return ()+      ("VHDL","case2") -> return ()+      ("VHDL","caseWhen") -> return ()+      ("VHDL","entity") -> return ()+      ("VHDL","entity_main") -> return ()+      ("VHDL","preDetection") -> return ()+      ("VHDL","generalDetection") -> return ()+      ("VHDL","comment") -> (popContext) >> pEndLine+      ("VHDL","string") -> return ()+      ("VHDL","attribute") -> (popContext) >> pEndLine+      ("VHDL","quot in att") -> return ()+      ("VHDL","signal") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -103,8 +105,6 @@ regex_generic = compileRegex "generic" regex_port = compileRegex "port" -defaultAttributes = [(("VHDL","start"),NormalTok),(("VHDL","package"),NormalTok),(("VHDL","packagebody"),NormalTok),(("VHDL","architecture_main"),NormalTok),(("VHDL","arch_decl"),NormalTok),(("VHDL","detect_arch_parts"),NormalTok),(("VHDL","generate1"),NormalTok),(("VHDL","generate2"),NormalTok),(("VHDL","process1"),NormalTok),(("VHDL","proc_rules"),NormalTok),(("VHDL","instance"),NormalTok),(("VHDL","forOrWhile"),NormalTok),(("VHDL","if_start"),NormalTok),(("VHDL","if"),NormalTok),(("VHDL","case1"),NormalTok),(("VHDL","case2"),NormalTok),(("VHDL","caseWhen"),NormalTok),(("VHDL","entity"),NormalTok),(("VHDL","entity_main"),NormalTok),(("VHDL","preDetection"),NormalTok),(("VHDL","generalDetection"),NormalTok),(("VHDL","comment"),CommentTok),(("VHDL","string"),StringTok),(("VHDL","attribute"),BaseNTok),(("VHDL","quot in att"),BaseNTok),(("VHDL","signal"),NormalTok)]- parseRules ("VHDL","start") =   (((parseRules ("VHDL","preDetection")))    <|>@@ -118,7 +118,7 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywordsToplevel >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","package") =   (((pString True "%2" >>= withAttribute KeywordTok))@@ -131,7 +131,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","package")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","package") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","package")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","packagebody") =   (((pString True "%2" >>= withAttribute KeywordTok))@@ -144,7 +144,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","packagebody")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","packagebody") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","packagebody")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","architecture_main") =   (((parseRules ("VHDL","preDetection")))@@ -157,7 +157,7 @@    <|>    ((parseRules ("VHDL","detect_arch_parts")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","architecture_main")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","architecture_main") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","architecture_main")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","arch_decl") =   (((parseRules ("VHDL","preDetection")))@@ -170,7 +170,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","arch_decl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","arch_decl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","arch_decl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","detect_arch_parts") =   (((lookAhead (pRegExprDynamic "(\\b)((\\b(?!(?:process|constant|signal|variable))([A-Za-z_][A-Za-z0-9_]*)\\b)\\s*:\\s*)(if|for).*\\s+generate\\b") >> pushContext ("VHDL","generate1") >> currentContext >>= parseRules))@@ -181,7 +181,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","detect_arch_parts")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","detect_arch_parts") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","detect_arch_parts")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","generate1") =   (((parseRules ("VHDL","preDetection")))@@ -196,7 +196,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","generate1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","generate1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","generate1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","generate2") =   (((parseRules ("VHDL","preDetection")))@@ -207,7 +207,7 @@    <|>    ((parseRules ("VHDL","detect_arch_parts")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","generate2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","generate2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","generate2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","process1") =   (((parseRules ("VHDL","preDetection")))@@ -222,7 +222,7 @@    <|>    ((parseRules ("VHDL","proc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","process1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","process1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","process1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","proc_rules") =   (((pRegExpr regex_'28'5cb'29'5cb'28'3f'21'28'3f'3aprocess'7cconstant'7csignal'7cvariable'29'29'28'5bA'2dZa'2dz'5f'5d'5bA'2dZa'2dz0'2d9'5f'5d'2a'29'5cb'28'3f'3d'5cs'2a'3a'28'3f'21'3d'29'29 >>= withAttribute KeywordTok))@@ -235,7 +235,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","proc_rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","proc_rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","proc_rules")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","instance") =   (((parseRules ("VHDL","preDetection")))@@ -248,7 +248,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","instance")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","instance") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","instance")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","forOrWhile") =   (((pRegExpr regex_'28'5cb'29end'5cs'2bloop'28'5cs'2b'5cb'28'3f'21'28'3f'3aprocess'7cconstant'7csignal'7cvariable'29'29'28'5bA'2dZa'2dz'5f'5d'5bA'2dZa'2dz0'2d9'5f'5d'2a'29'5cb'29'3f'5cs'2a'3b >>= withAttribute KeywordTok) >>~ (popContext))@@ -257,7 +257,7 @@    <|>    ((parseRules ("VHDL","proc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","forOrWhile")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","forOrWhile") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","forOrWhile")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","if_start") =   (((parseRules ("VHDL","preDetection")))@@ -266,7 +266,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","if_start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","if_start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","if_start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","if") =   (((parseRules ("VHDL","preDetection")))@@ -277,7 +277,7 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_if >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","if")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","if") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","if")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","case1") =   (((parseRules ("VHDL","preDetection")))@@ -286,7 +286,7 @@    <|>    ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_case >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","case1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","case1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","case1")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","case2") =   (((parseRules ("VHDL","preDetection")))@@ -297,7 +297,7 @@    <|>    ((parseRules ("VHDL","proc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","case2")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","case2") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","case2")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","caseWhen") =   (((parseRules ("VHDL","preDetection")))@@ -308,7 +308,7 @@    <|>    ((parseRules ("VHDL","proc_rules")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","caseWhen")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","caseWhen") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","caseWhen")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","entity") =   (((parseRules ("VHDL","preDetection")))@@ -317,7 +317,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","entity")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","entity") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","entity")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","entity_main") =   (((parseRules ("VHDL","preDetection")))@@ -332,7 +332,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","entity_main")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","entity_main") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","entity_main")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","preDetection") =   (((pDetect2Chars False '-' '-' >>= withAttribute CommentTok) >>~ pushContext ("VHDL","comment"))@@ -343,7 +343,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute BaseNTok) >>~ pushContext ("VHDL","attribute"))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","preDetection")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","preDetection") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","preDetection")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","generalDetection") =   (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_types >>= withAttribute DataTypeTok))@@ -360,15 +360,15 @@    <|>    ((pDetectSpaces >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","generalDetection")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","generalDetection") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","generalDetection")) >> pDefault >>= withAttribute NormalTok))  parseRules ("VHDL","comment") =-  (currentContext >>= \x -> guard (x == ("VHDL","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("VHDL","comment")) >> pDefault >>= withAttribute CommentTok)  parseRules ("VHDL","string") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("VHDL","attribute") =   (((pDetectChar False '"' >>= withAttribute BaseNTok) >>~ pushContext ("VHDL","quot in att"))@@ -379,12 +379,12 @@    <|>    ((pAnyChar "()=<>" >>= withAttribute BaseNTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","attribute")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("VHDL","quot in att") =   (((pDetectChar False '"' >>= withAttribute BaseNTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","quot in att")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","quot in att") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","quot in att")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("VHDL","signal") =   (((parseRules ("VHDL","preDetection")))@@ -393,7 +393,7 @@    <|>    ((parseRules ("VHDL","generalDetection")))    <|>-   (currentContext >>= \x -> guard (x == ("VHDL","signal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("VHDL","signal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("VHDL","signal")) >> pDefault >>= withAttribute NormalTok))   parseRules x = parseRules ("VHDL","start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Xml.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,27 +41,30 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("XML","Start") -> return ()-    ("XML","FindXML") -> return ()-    ("XML","FindEntityRefs") -> return ()-    ("XML","FindPEntityRefs") -> return ()-    ("XML","Comment") -> return ()-    ("XML","CDATA") -> return ()-    ("XML","PI") -> return ()-    ("XML","Doctype") -> return ()-    ("XML","Doctype Internal Subset") -> return ()-    ("XML","Doctype Markupdecl") -> return ()-    ("XML","Doctype Markupdecl DQ") -> return ()-    ("XML","Doctype Markupdecl SQ") -> return ()-    ("XML","Element") -> return ()-    ("XML","El Content") -> return ()-    ("XML","El End") -> return ()-    ("XML","Attribute") -> return ()-    ("XML","Value") -> return ()-    ("XML","Value DQ") -> return ()-    ("XML","Value SQ") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("XML","Start") -> return ()+      ("XML","FindXML") -> return ()+      ("XML","FindEntityRefs") -> return ()+      ("XML","FindPEntityRefs") -> return ()+      ("XML","Comment") -> return ()+      ("XML","CDATA") -> return ()+      ("XML","PI") -> return ()+      ("XML","Doctype") -> return ()+      ("XML","Doctype Internal Subset") -> return ()+      ("XML","Doctype Markupdecl") -> return ()+      ("XML","Doctype Markupdecl DQ") -> return ()+      ("XML","Doctype Markupdecl SQ") -> return ()+      ("XML","Element") -> return ()+      ("XML","El Content") -> return ()+      ("XML","El End") -> return ()+      ("XML","Attribute") -> return ()+      ("XML","Value") -> return ()+      ("XML","Value DQ") -> return ()+      ("XML","Value SQ") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -83,12 +85,10 @@ regex_'5cS = compileRegex "\\S" regex_'3c'2f'28'3f'21'5b0'2d9'5d'29'5b'5cw'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a = compileRegex "</(?![0-9])[\\w_:][\\w.:_-]*" -defaultAttributes = [(("XML","Start"),NormalTok),(("XML","FindXML"),NormalTok),(("XML","FindEntityRefs"),NormalTok),(("XML","FindPEntityRefs"),NormalTok),(("XML","Comment"),CommentTok),(("XML","CDATA"),NormalTok),(("XML","PI"),NormalTok),(("XML","Doctype"),NormalTok),(("XML","Doctype Internal Subset"),NormalTok),(("XML","Doctype Markupdecl"),NormalTok),(("XML","Doctype Markupdecl DQ"),StringTok),(("XML","Doctype Markupdecl SQ"),StringTok),(("XML","Element"),NormalTok),(("XML","El Content"),NormalTok),(("XML","El End"),NormalTok),(("XML","Attribute"),NormalTok),(("XML","Value"),NormalTok),(("XML","Value DQ"),StringTok),(("XML","Value SQ"),StringTok)]- parseRules ("XML","Start") =   (((parseRules ("XML","FindXML")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","FindXML") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -107,14 +107,14 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","FindXML")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","FindXML") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","FindXML")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","FindEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'28'3f'21'5b0'2d9'5d'29'5b'5cw'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>    ((pAnyChar "&<" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","FindEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","FindEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","FindEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'28'3f'21'5b0'2d9'5d'29'5b'5cw'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -123,7 +123,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -136,7 +136,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("XML","CDATA") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -147,19 +147,19 @@    <|>    ((pString False "]]&gt;" >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XML","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("XML","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -172,7 +172,7 @@    <|>    ((parseRules ("XML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -181,21 +181,21 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("XML","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Doctype Markupdecl DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("XML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XML","Doctype Markupdecl SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("XML","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XML","Element") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -208,28 +208,28 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Element")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Element") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Element")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","El Content") =   (((pRegExpr regex_'3c'2f'28'3f'21'5b0'2d9'5d'29'5b'5cw'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a >>= withAttribute KeywordTok) >>~ pushContext ("XML","El End"))    <|>    ((parseRules ("XML","FindXML")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","El Content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","El Content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","El Content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","El End") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","El End")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","El End") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","El End")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Attribute") =   (((pDetectChar False '=' >>= withAttribute OtherTok) >>~ pushContext ("XML","Value"))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Attribute")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("XML","Value DQ"))@@ -238,21 +238,21 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Value")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XML","Value DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext >> popContext >> popContext))    <|>    ((parseRules ("XML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Value DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Value DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Value DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XML","Value SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext >> popContext))    <|>    ((parseRules ("XML","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XML","Value SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XML","Value SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XML","Value SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Xorg.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,13 +41,16 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("x.org Configuration","xorg") -> return ()-    ("x.org Configuration","Section") -> return ()-    ("x.org Configuration","Section Content") -> return ()-    ("x.org Configuration","Keyword") -> (popContext) >> pEndLine-    ("x.org Configuration","Comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("x.org Configuration","xorg") -> return ()+      ("x.org Configuration","Section") -> return ()+      ("x.org Configuration","Section Content") -> return ()+      ("x.org Configuration","Keyword") -> (popContext) >> pEndLine+      ("x.org Configuration","Comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -60,14 +62,12 @@ regex_'5cb'5cw'2b'5cb = compileRegex "\\b\\w+\\b" regex_'5b'5cw'5cd'5d'2b = compileRegex "[\\w\\d]+" -defaultAttributes = [(("x.org Configuration","xorg"),NormalTok),(("x.org Configuration","Section"),NormalTok),(("x.org Configuration","Section Content"),NormalTok),(("x.org Configuration","Keyword"),KeywordTok),(("x.org Configuration","Comment"),CommentTok)]- parseRules ("x.org Configuration","xorg") =   (((pString False "Section" >>= withAttribute FunctionTok) >>~ pushContext ("x.org Configuration","Section"))    <|>    ((pDetectChar False '#' >>= withAttribute NormalTok) >>~ pushContext ("x.org Configuration","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("x.org Configuration","xorg")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("x.org Configuration","xorg") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("x.org Configuration","xorg")) >> pDefault >>= withAttribute NormalTok))  parseRules ("x.org Configuration","Section") =   (((pRangeDetect '"' '"' >>= withAttribute StringTok) >>~ pushContext ("x.org Configuration","Section Content"))@@ -78,7 +78,7 @@    <|>    ((pDetectChar False '#' >>= withAttribute NormalTok) >>~ pushContext ("x.org Configuration","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("x.org Configuration","Section")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("x.org Configuration","Section") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("x.org Configuration","Section")) >> pDefault >>= withAttribute NormalTok))  parseRules ("x.org Configuration","Section Content") =   (((pString False "EndSection" >>= withAttribute FunctionTok) >>~ (popContext >> popContext))@@ -91,7 +91,7 @@    <|>    ((pDetectChar False '#' >>= withAttribute NormalTok) >>~ pushContext ("x.org Configuration","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("x.org Configuration","Section Content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("x.org Configuration","Section Content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("x.org Configuration","Section Content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("x.org Configuration","Keyword") =   (((pRangeDetect '"' '"' >>= withAttribute DataTypeTok))@@ -106,7 +106,7 @@    <|>    ((pDetectChar False '#' >>= withAttribute KeywordTok) >>~ pushContext ("x.org Configuration","Comment"))    <|>-   (currentContext >>= \x -> guard (x == ("x.org Configuration","Keyword")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("x.org Configuration","Keyword") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("x.org Configuration","Keyword")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("x.org Configuration","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -115,7 +115,7 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("x.org Configuration","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("x.org Configuration","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("x.org Configuration","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Xslt.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -42,30 +41,33 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("xslt","normalText") -> return ()-    ("xslt","CDATA") -> return ()-    ("xslt","PI") -> return ()-    ("xslt","Doctype") -> return ()-    ("xslt","Doctype Internal Subset") -> return ()-    ("xslt","Doctype Markupdecl") -> return ()-    ("xslt","Doctype Markupdecl DQ") -> return ()-    ("xslt","Doctype Markupdecl SQ") -> return ()-    ("xslt","detectEntRef") -> return ()-    ("xslt","FindPEntityRefs") -> return ()-    ("xslt","tagname") -> return ()-    ("xslt","attributes") -> return ()-    ("xslt","attrValue") -> return ()-    ("xslt","xattributes") -> return ()-    ("xslt","xattrValue") -> return ()-    ("xslt","string") -> return ()-    ("xslt","sqstring") -> return ()-    ("xslt","comment") -> return ()-    ("xslt","xpath") -> return ()-    ("xslt","sqxpath") -> return ()-    ("xslt","sqxpathstring") -> return ()-    ("xslt","xpathstring") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("xslt","normalText") -> return ()+      ("xslt","CDATA") -> return ()+      ("xslt","PI") -> return ()+      ("xslt","Doctype") -> return ()+      ("xslt","Doctype Internal Subset") -> return ()+      ("xslt","Doctype Markupdecl") -> return ()+      ("xslt","Doctype Markupdecl DQ") -> return ()+      ("xslt","Doctype Markupdecl SQ") -> return ()+      ("xslt","detectEntRef") -> return ()+      ("xslt","FindPEntityRefs") -> return ()+      ("xslt","tagname") -> return ()+      ("xslt","attributes") -> return ()+      ("xslt","attrValue") -> return ()+      ("xslt","xattributes") -> return ()+      ("xslt","xattrValue") -> return ()+      ("xslt","string") -> return ()+      ("xslt","sqstring") -> return ()+      ("xslt","comment") -> return ()+      ("xslt","xpath") -> return ()+      ("xslt","sqxpath") -> return ()+      ("xslt","sqxpathstring") -> return ()+      ("xslt","xpathstring") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -95,8 +97,6 @@ regex_'5c'24'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a = compileRegex "\\$[A-Za-z_:][\\w.:_-]*" regex_'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a = compileRegex "[A-Za-z_:][\\w.:_-]*" -defaultAttributes = [(("xslt","normalText"),NormalTok),(("xslt","CDATA"),NormalTok),(("xslt","PI"),NormalTok),(("xslt","Doctype"),NormalTok),(("xslt","Doctype Internal Subset"),NormalTok),(("xslt","Doctype Markupdecl"),NormalTok),(("xslt","Doctype Markupdecl DQ"),NormalTok),(("xslt","Doctype Markupdecl SQ"),NormalTok),(("xslt","detectEntRef"),NormalTok),(("xslt","FindPEntityRefs"),NormalTok),(("xslt","tagname"),KeywordTok),(("xslt","attributes"),OtherTok),(("xslt","attrValue"),ErrorTok),(("xslt","xattributes"),OtherTok),(("xslt","xattrValue"),ErrorTok),(("xslt","string"),StringTok),(("xslt","sqstring"),StringTok),(("xslt","comment"),CommentTok),(("xslt","xpath"),OtherTok),(("xslt","sqxpath"),OtherTok),(("xslt","sqxpathstring"),StringTok),(("xslt","xpathstring"),StringTok)]- parseRules ("xslt","normalText") =   (((pString False "<!--" >>= withAttribute CommentTok) >>~ pushContext ("xslt","comment"))    <|>@@ -110,7 +110,7 @@    <|>    ((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","normalText")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","normalText") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","normalText")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","CDATA") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -121,19 +121,19 @@    <|>    ((pString False "]]&gt;" >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("xslt","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -146,7 +146,7 @@    <|>    ((parseRules ("xslt","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -155,26 +155,26 @@    <|>    ((pDetectChar False '\'' >>= withAttribute NormalTok) >>~ pushContext ("xslt","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","Doctype Markupdecl DQ") =   (((pDetectChar False '"' >>= withAttribute NormalTok) >>~ (popContext))    <|>    ((parseRules ("xslt","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","Doctype Markupdecl SQ") =   (((pDetectChar False '\'' >>= withAttribute NormalTok) >>~ (popContext))    <|>    ((parseRules ("xslt","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","detectEntRef") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","detectEntRef")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","detectEntRef") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","detectEntRef")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -183,7 +183,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("xslt","tagname") =   (((pKeyword " \n\t.()!+,<=>%&*/;?[]^{|}~\\\"{}" list_keytags >>= withAttribute KeywordTok) >>~ pushContext ("xslt","xattributes"))@@ -194,7 +194,7 @@    <|>    ((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","tagname")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","tagname") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","tagname")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("xslt","attributes") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -203,7 +203,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute NormalTok) >>~ pushContext ("xslt","attrValue"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","attributes")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","attributes") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","attributes")) >> pDefault >>= withAttribute OtherTok))  parseRules ("xslt","attrValue") =   (((pDetect2Chars False '/' '>' >>= withAttribute ErrorTok) >>~ (popContext >> popContext >> popContext))@@ -214,7 +214,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("xslt","sqstring"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","attrValue")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","attrValue") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","attrValue")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("xslt","xattributes") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -229,7 +229,7 @@    <|>    ((pRegExpr regex_'5cs'2a'3d'5cs'2a >>= withAttribute OtherTok) >>~ pushContext ("xslt","attrValue"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","xattributes")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","xattributes") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","xattributes")) >> pDefault >>= withAttribute OtherTok))  parseRules ("xslt","xattrValue") =   (((pDetect2Chars False '/' '>' >>= withAttribute ErrorTok) >>~ (popContext >> popContext >> popContext))@@ -240,7 +240,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute OtherTok) >>~ pushContext ("xslt","sqxpath"))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","xattrValue")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","xattrValue") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","xattrValue")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("xslt","string") =   (((pDetectChar False '{' >>= withAttribute OtherTok) >>~ pushContext ("xslt","xpath"))@@ -249,7 +249,7 @@    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","string")) >> pDefault >>= withAttribute StringTok))  parseRules ("xslt","sqstring") =   (((pDetectChar False '{' >>= withAttribute OtherTok) >>~ pushContext ("xslt","sqxpath"))@@ -258,7 +258,7 @@    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","sqstring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","sqstring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","sqstring")) >> pDefault >>= withAttribute StringTok))  parseRules ("xslt","comment") =   (((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext))@@ -267,7 +267,7 @@    <|>    ((pRegExpr regex_'28FIXME'7cTODO'7cHACK'29 >>= withAttribute AlertTok))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("xslt","xpath") =   (((pKeyword " \n\t.()!+,<=>%&*/;?[]^{|}~\\\"{}" list_functions >>= withAttribute KeywordTok))@@ -292,7 +292,7 @@    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","xpath")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","xpath") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","xpath")) >> pDefault >>= withAttribute OtherTok))  parseRules ("xslt","sqxpath") =   (((pKeyword " \n\t.()!+,<=>%&*/;?[]^{|}~\\\"{}" list_functions >>= withAttribute KeywordTok))@@ -317,21 +317,21 @@    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","sqxpath")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","sqxpath") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","sqxpath")) >> pDefault >>= withAttribute OtherTok))  parseRules ("xslt","sqxpathstring") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","sqxpathstring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","sqxpathstring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","sqxpathstring")) >> pDefault >>= withAttribute StringTok))  parseRules ("xslt","xpathstring") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("xslt","detectEntRef")))    <|>-   (currentContext >>= \x -> guard (x == ("xslt","xpathstring")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("xslt","xpathstring") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("xslt","xpathstring")) >> pDefault >>= withAttribute StringTok))   parseRules x = parseRules ("xslt","normalText") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Xul.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe) import qualified Data.Set as Set  -- | Full name of language.@@ -43,37 +42,40 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("XUL","Start") -> return ()-    ("XUL","FindXML") -> return ()-    ("XUL","FindEntityRefs") -> return ()-    ("XUL","FindPEntityRefs") -> return ()-    ("XUL","Comment") -> return ()-    ("XUL","PI") -> return ()-    ("XUL","Doctype") -> return ()-    ("XUL","Doctype Internal Subset") -> return ()-    ("XUL","Doctype Markupdecl") -> return ()-    ("XUL","Doctype Markupdecl DQ") -> return ()-    ("XUL","Doctype Markupdecl SQ") -> return ()-    ("XUL","Element") -> return ()-    ("XUL","El Content") -> return ()-    ("XUL","El End") -> return ()-    ("XUL","Attribute") -> return ()-    ("XUL","Value") -> return ()-    ("XUL","Value DQ") -> return ()-    ("XUL","Value SQ") -> return ()-    ("XUL","CDATA") -> return ()-    ("XUL","String") -> (popContext) >> pEndLine-    ("XUL","String 1") -> (popContext) >> pEndLine-    ("XUL","JSComment") -> (popContext) >> pEndLine-    ("XUL","Multi/inline Comment") -> return ()-    ("XUL","Regular Expression") -> return ()-    ("XUL","(Internal regex catch)") -> return ()-    ("XUL","Regular Expression Character Class") -> return ()-    ("XUL","(regex caret first check)") -> (popContext) >> pEndLine-    ("XUL","(charclass caret first check)") -> (popContext) >> pEndLine-    ("XUL","region_marker") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("XUL","Start") -> return ()+      ("XUL","FindXML") -> return ()+      ("XUL","FindEntityRefs") -> return ()+      ("XUL","FindPEntityRefs") -> return ()+      ("XUL","Comment") -> return ()+      ("XUL","PI") -> return ()+      ("XUL","Doctype") -> return ()+      ("XUL","Doctype Internal Subset") -> return ()+      ("XUL","Doctype Markupdecl") -> return ()+      ("XUL","Doctype Markupdecl DQ") -> return ()+      ("XUL","Doctype Markupdecl SQ") -> return ()+      ("XUL","Element") -> return ()+      ("XUL","El Content") -> return ()+      ("XUL","El End") -> return ()+      ("XUL","Attribute") -> return ()+      ("XUL","Value") -> return ()+      ("XUL","Value DQ") -> return ()+      ("XUL","Value SQ") -> return ()+      ("XUL","CDATA") -> return ()+      ("XUL","String") -> (popContext) >> pEndLine+      ("XUL","String 1") -> (popContext) >> pEndLine+      ("XUL","JSComment") -> (popContext) >> pEndLine+      ("XUL","Multi/inline Comment") -> return ()+      ("XUL","Regular Expression") -> return ()+      ("XUL","(Internal regex catch)") -> return ()+      ("XUL","Regular Expression Character Class") -> return ()+      ("XUL","(regex caret first check)") -> (popContext) >> pEndLine+      ("XUL","(charclass caret first check)") -> (popContext) >> pEndLine+      ("XUL","region_marker") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -111,12 +113,10 @@ regex_'2f'2f'28'3f'3d'3b'29 = compileRegex "//(?=;)" regex_'5c'5c'5b'5c'5b'5c'5d'5d = compileRegex "\\\\[\\[\\]]" -defaultAttributes = [(("XUL","Start"),NormalTok),(("XUL","FindXML"),NormalTok),(("XUL","FindEntityRefs"),NormalTok),(("XUL","FindPEntityRefs"),NormalTok),(("XUL","Comment"),CommentTok),(("XUL","PI"),NormalTok),(("XUL","Doctype"),NormalTok),(("XUL","Doctype Internal Subset"),NormalTok),(("XUL","Doctype Markupdecl"),NormalTok),(("XUL","Doctype Markupdecl DQ"),StringTok),(("XUL","Doctype Markupdecl SQ"),StringTok),(("XUL","Element"),NormalTok),(("XUL","El Content"),NormalTok),(("XUL","El End"),NormalTok),(("XUL","Attribute"),NormalTok),(("XUL","Value"),NormalTok),(("XUL","Value DQ"),StringTok),(("XUL","Value SQ"),StringTok),(("XUL","CDATA"),NormalTok),(("XUL","String"),StringTok),(("XUL","String 1"),CharTok),(("XUL","JSComment"),CommentTok),(("XUL","Multi/inline Comment"),CommentTok),(("XUL","Regular Expression"),OtherTok),(("XUL","(Internal regex catch)"),NormalTok),(("XUL","Regular Expression Character Class"),BaseNTok),(("XUL","(regex caret first check)"),FloatTok),(("XUL","(charclass caret first check)"),FloatTok),(("XUL","region_marker"),RegionMarkerTok)]- parseRules ("XUL","Start") =   (((parseRules ("XUL","FindXML")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","FindXML") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -135,14 +135,14 @@    <|>    ((pDetectIdentifier >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","FindXML")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","FindXML") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","FindXML")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","FindEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))    <|>    ((pAnyChar "&<" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","FindEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","FindEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","FindEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","FindPEntityRefs") =   (((pRegExpr regex_'26'28'23'5b0'2d9'5d'2b'7c'23'5bxX'5d'5b0'2d9A'2dFa'2df'5d'2b'7c'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a'29'3b >>= withAttribute DecValTok))@@ -151,7 +151,7 @@    <|>    ((pAnyChar "&%" >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","FindPEntityRefs")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","FindPEntityRefs") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","FindPEntityRefs")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Comment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -164,19 +164,19 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("XUL","PI") =   (((pDetect2Chars False '?' '>' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","PI")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","PI") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","PI")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Doctype") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>    ((pDetectChar False '[' >>= withAttribute DataTypeTok) >>~ pushContext ("XUL","Doctype Internal Subset"))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Doctype")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Doctype") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Doctype")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Doctype Internal Subset") =   (((pDetectChar False ']' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -189,7 +189,7 @@    <|>    ((parseRules ("XUL","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Doctype Internal Subset")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Doctype Internal Subset") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Doctype Internal Subset")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Doctype Markupdecl") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))@@ -198,21 +198,21 @@    <|>    ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("XUL","Doctype Markupdecl SQ"))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Doctype Markupdecl") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Doctype Markupdecl DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("XUL","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Doctype Markupdecl DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XUL","Doctype Markupdecl SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext))    <|>    ((parseRules ("XUL","FindPEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Doctype Markupdecl SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Doctype Markupdecl SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XUL","Element") =   (((pDetect2Chars False '/' '>' >>= withAttribute KeywordTok) >>~ (popContext))@@ -225,28 +225,28 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Element")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Element") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Element")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","El Content") =   (((pRegExpr regex_'3c'2f'5bA'2dZa'2dz'5f'3a'5d'5b'5cw'2e'3a'5f'2d'5d'2a >>= withAttribute KeywordTok) >>~ pushContext ("XUL","El End"))    <|>    ((parseRules ("XUL","FindXML")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","El Content")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","El Content") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","El Content")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","El End") =   (((pDetectChar False '>' >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","El End")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","El End") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","El End")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Attribute") =   (((pDetectChar False '=' >>= withAttribute OtherTok) >>~ pushContext ("XUL","Value"))    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Attribute")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Value") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("XUL","Value DQ"))@@ -255,21 +255,21 @@    <|>    ((pRegExpr regex_'5cS >>= withAttribute ErrorTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Value")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Value") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Value")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","Value DQ") =   (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext >> popContext >> popContext))    <|>    ((parseRules ("XUL","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Value DQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Value DQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Value DQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XUL","Value SQ") =   (((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext >> popContext))    <|>    ((parseRules ("XUL","FindEntityRefs")))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Value SQ")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Value SQ") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Value SQ")) >> pDefault >>= withAttribute StringTok))  parseRules ("XUL","CDATA") =   (((pString False "]]>" >>= withAttribute BaseNTok) >>~ (popContext))@@ -318,7 +318,7 @@    <|>    ((pAnyChar ":!%&+,-/.*<=>?[]|~^;" >>= withAttribute NormalTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","CDATA")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","CDATA") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","CDATA")) >> pDefault >>= withAttribute NormalTok))  parseRules ("XUL","String") =   (((pDetectIdentifier >>= withAttribute StringTok))@@ -327,7 +327,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("XUL","String 1") =   (((pDetectIdentifier >>= withAttribute CharTok))@@ -336,7 +336,7 @@    <|>    ((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","String 1")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","String 1") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","String 1")) >> pDefault >>= withAttribute CharTok))  parseRules ("XUL","JSComment") =   (((pDetectSpaces >>= withAttribute CommentTok))@@ -345,14 +345,14 @@    <|>    ((pDetectIdentifier >>= withAttribute CommentTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","JSComment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","JSComment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","JSComment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("XUL","Multi/inline Comment") =   (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))    <|>    ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Multi/inline Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Multi/inline Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Multi/inline Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("XUL","Regular Expression") =   (((pRegExpr regex_'2f'5big'5d'7b0'2c2'7d >>= withAttribute OtherTok) >>~ (popContext >> popContext >> popContext))@@ -371,7 +371,7 @@    <|>    ((pAnyChar "?+*()|" >>= withAttribute FloatTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Regular Expression")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Regular Expression") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Regular Expression")) >> pDefault >>= withAttribute OtherTok))  parseRules ("XUL","(Internal regex catch)") =   (((pRegExpr regex_'5cs'2a >>= withAttribute NormalTok))@@ -391,7 +391,7 @@    <|>    ((pDetectChar False ']' >>= withAttribute BaseNTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","Regular Expression Character Class")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","Regular Expression Character Class") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","Regular Expression Character Class")) >> pDefault >>= withAttribute BaseNTok))  parseRules ("XUL","(regex caret first check)") =   (((pDetectChar False '^' >>= withAttribute FloatTok) >>~ pushContext ("XUL","Regular Expression"))@@ -408,7 +408,7 @@    <|>    ((pDetectSpaces >>= withAttribute RegionMarkerTok))    <|>-   (currentContext >>= \x -> guard (x == ("XUL","region_marker")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("XUL","region_marker") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("XUL","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok))  parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression 
Text/Highlighting/Kate/Syntax/Yacc.hs view
@@ -10,7 +10,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -42,29 +41,32 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("Yacc/Bison","Pre Start") -> return ()-    ("Yacc/Bison","C Declarations") -> return ()-    ("Yacc/Bison","Declarations") -> return ()-    ("Yacc/Bison","Union Start") -> return ()-    ("Yacc/Bison","Union In") -> return ()-    ("Yacc/Bison","Union InIn") -> return ()-    ("Yacc/Bison","Rules") -> return ()-    ("Yacc/Bison","Rule In") -> return ()-    ("Yacc/Bison","User Code") -> return ()-    ("Yacc/Bison","Percent Command") -> (popContext) >> pEndLine-    ("Yacc/Bison","Percent Command In") -> (popContext >> popContext) >> pEndLine-    ("Yacc/Bison","PC type") -> (popContext >> popContext >> popContext) >> pEndLine-    ("Yacc/Bison","Comment") -> return ()-    ("Yacc/Bison","CommentStar") -> return ()-    ("Yacc/Bison","CommentSlash") -> return ()-    ("Yacc/Bison","StringOrChar") -> return ()-    ("Yacc/Bison","String") -> (popContext) >> pEndLine-    ("Yacc/Bison","Char") -> (popContext) >> pEndLine-    ("Yacc/Bison","Normal C Bloc") -> return ()-    ("Yacc/Bison","Dol") -> return ()-    ("Yacc/Bison","DolEnd") -> return ()-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("Yacc/Bison","Pre Start") -> return ()+      ("Yacc/Bison","C Declarations") -> return ()+      ("Yacc/Bison","Declarations") -> return ()+      ("Yacc/Bison","Union Start") -> return ()+      ("Yacc/Bison","Union In") -> return ()+      ("Yacc/Bison","Union InIn") -> return ()+      ("Yacc/Bison","Rules") -> return ()+      ("Yacc/Bison","Rule In") -> return ()+      ("Yacc/Bison","User Code") -> return ()+      ("Yacc/Bison","Percent Command") -> (popContext) >> pEndLine+      ("Yacc/Bison","Percent Command In") -> (popContext >> popContext) >> pEndLine+      ("Yacc/Bison","PC type") -> (popContext >> popContext >> popContext) >> pEndLine+      ("Yacc/Bison","Comment") -> return ()+      ("Yacc/Bison","CommentStar") -> return ()+      ("Yacc/Bison","CommentSlash") -> return ()+      ("Yacc/Bison","StringOrChar") -> return ()+      ("Yacc/Bison","String") -> (popContext) >> pEndLine+      ("Yacc/Bison","Char") -> (popContext) >> pEndLine+      ("Yacc/Bison","Normal C Bloc") -> return ()+      ("Yacc/Bison","Dol") -> return ()+      ("Yacc/Bison","DolEnd") -> return ()+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -80,8 +82,6 @@ regex_'3c'5b'5e'3e'5d'2b'3e = compileRegex "<[^>]+>" regex_'5cd'2b = compileRegex "\\d+" -defaultAttributes = [(("Yacc/Bison","Pre Start"),NormalTok),(("Yacc/Bison","C Declarations"),NormalTok),(("Yacc/Bison","Declarations"),NormalTok),(("Yacc/Bison","Union Start"),NormalTok),(("Yacc/Bison","Union In"),NormalTok),(("Yacc/Bison","Union InIn"),NormalTok),(("Yacc/Bison","Rules"),StringTok),(("Yacc/Bison","Rule In"),NormalTok),(("Yacc/Bison","User Code"),NormalTok),(("Yacc/Bison","Percent Command"),KeywordTok),(("Yacc/Bison","Percent Command In"),NormalTok),(("Yacc/Bison","PC type"),DataTypeTok),(("Yacc/Bison","Comment"),CommentTok),(("Yacc/Bison","CommentStar"),CommentTok),(("Yacc/Bison","CommentSlash"),CommentTok),(("Yacc/Bison","StringOrChar"),NormalTok),(("Yacc/Bison","String"),StringTok),(("Yacc/Bison","Char"),CharTok),(("Yacc/Bison","Normal C Bloc"),NormalTok),(("Yacc/Bison","Dol"),NormalTok),(("Yacc/Bison","DolEnd"),NormalTok)]- parseRules ("Yacc/Bison","Pre Start") =   (((parseRules ("Yacc/Bison","Comment")))    <|>@@ -91,7 +91,7 @@    <|>    ((lookAhead (pRegExpr regex_'2e) >> pushContext ("Yacc/Bison","Declarations") >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Pre Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Pre Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Pre Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","C Declarations") =   (((parseRules ("Yacc/Bison","Comment")))@@ -100,7 +100,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","C Declarations")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","C Declarations") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","C Declarations")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Declarations") =   (((parseRules ("Yacc/Bison","Comment")))@@ -113,7 +113,7 @@    <|>    ((pDetectChar False '%' >>= withAttribute KeywordTok) >>~ pushContext ("Yacc/Bison","Percent Command"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Declarations")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Declarations") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Declarations")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Union Start") =   (((parseRules ("Yacc/Bison","Comment")))@@ -124,7 +124,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute AlertTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union Start")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Union Start") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union Start")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Union In") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("Yacc/Bison","Union InIn"))@@ -133,7 +133,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union In")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Union In") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union In")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Union InIn") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("Yacc/Bison","Union InIn"))@@ -142,7 +142,7 @@    <|>    ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union InIn")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Union InIn") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union InIn")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Rules") =   (((parseRules ("Yacc/Bison","Comment")))@@ -151,7 +151,7 @@    <|>    ((pDetectChar False ':' >>= withAttribute NormalTok) >>~ pushContext ("Yacc/Bison","Rule In"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Rules")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Rules") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Rules")) >> pDefault >>= withAttribute StringTok))  parseRules ("Yacc/Bison","Rule In") =   (((parseRules ("Yacc/Bison","Comment")))@@ -164,69 +164,69 @@    <|>    ((parseRules ("Yacc/Bison","StringOrChar")))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Rule In")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Rule In") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Rule In")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","User Code") =   (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","User Code")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","User Code") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","User Code")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Percent Command") =   (((parseRules ("Yacc/Bison","Comment")))    <|>    ((lookAhead (pRegExpr regex_'5cW) >> pushContext ("Yacc/Bison","Percent Command In") >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Percent Command")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Percent Command") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Percent Command")) >> pDefault >>= withAttribute KeywordTok))  parseRules ("Yacc/Bison","Percent Command In") =   (((parseRules ("Yacc/Bison","StringOrChar")))    <|>    ((pDetectChar False '<' >>= withAttribute DataTypeTok) >>~ pushContext ("Yacc/Bison","PC type"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Percent Command In")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Percent Command In") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Percent Command In")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","PC type") =   (((pDetectChar False '>' >>= withAttribute DataTypeTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","PC type")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","PC type") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","PC type")) >> pDefault >>= withAttribute DataTypeTok))  parseRules ("Yacc/Bison","Comment") =   (((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("Yacc/Bison","CommentStar"))    <|>    ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Yacc/Bison","CommentSlash"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Comment") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Comment")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Yacc/Bison","CommentStar") =   (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","CommentStar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","CommentStar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","CommentStar")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Yacc/Bison","CommentSlash") =   (((pRegExpr regex_'5b'5e'5c'5c'5d'24 >>= withAttribute CommentTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","CommentSlash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","CommentSlash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","CommentSlash")) >> pDefault >>= withAttribute CommentTok))  parseRules ("Yacc/Bison","StringOrChar") =   (((pDetectChar False '\'' >>= withAttribute CharTok) >>~ pushContext ("Yacc/Bison","Char"))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Yacc/Bison","String"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","StringOrChar")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","StringOrChar") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","StringOrChar")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","String") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))    <|>    ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","String")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","String") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","String")) >> pDefault >>= withAttribute StringTok))  parseRules ("Yacc/Bison","Char") =   (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))    <|>    ((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Char")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Char") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Char")) >> pDefault >>= withAttribute CharTok))  parseRules ("Yacc/Bison","Normal C Bloc") =   (((pDetectChar False '{' >>= withAttribute NormalTok) >>~ pushContext ("Yacc/Bison","Normal C Bloc"))@@ -237,7 +237,7 @@    <|>    ((pDetectChar False '$' >>= withAttribute KeywordTok) >>~ pushContext ("Yacc/Bison","Dol"))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Normal C Bloc")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","Normal C Bloc") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","Normal C Bloc")) >> pDefault >>= withAttribute NormalTok))  parseRules ("Yacc/Bison","Dol") =   (((pRegExpr regex_'3c'5b'5e'3e'5d'2b'3e >>= withAttribute DataTypeTok) >>~ pushContext ("Yacc/Bison","DolEnd"))@@ -249,7 +249,7 @@    <|>    ((pDetectChar False '$' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("Yacc/Bison","DolEnd")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("Yacc/Bison","DolEnd") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("Yacc/Bison","DolEnd")) >> pDefault >>= withAttribute NormalTok))  parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression 
Text/Highlighting/Kate/Syntax/Yaml.hs view
@@ -9,7 +9,6 @@ import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)-import Data.Maybe (fromMaybe)  -- | Full name of language. syntaxName :: String@@ -41,28 +40,31 @@ pEndLine = do   updateState $ \st -> st{ synStPrevNonspace = False }   context <- currentContext-  case context of-    ("YAML","normal") -> return ()-    ("YAML","dash") -> (popContext) >> pEndLine-    ("YAML","header") -> (popContext) >> pEndLine-    ("YAML","EOD") -> return ()-    ("YAML","directive") -> (popContext) >> pEndLine-    ("YAML","attribute") -> (popContext >> popContext) >> pEndLine-    ("YAML","attribute-inline") -> return ()-    ("YAML","attribute-pre") -> (popContext) >> pEndLine-    ("YAML","attribute-pre-inline") -> (popContext) >> pEndLine-    ("YAML","list") -> return ()-    ("YAML","hash") -> return ()-    ("YAML","attribute-string") -> return ()-    ("YAML","attribute-stringx") -> return ()-    ("YAML","attribute-string-inline") -> return ()-    ("YAML","attribute-stringx-inline") -> return ()-    ("YAML","attribute-end") -> (popContext >> popContext >> popContext) >> pEndLine-    ("YAML","attribute-end-inline") -> (popContext >> popContext >> popContext) >> pEndLine-    ("YAML","string") -> return ()-    ("YAML","stringx") -> return ()-    ("YAML","comment") -> (popContext) >> pEndLine-    _ -> return ()+  contexts <- synStContexts `fmap` getState+  if length contexts >= 2+    then case context of+      ("YAML","normal") -> return ()+      ("YAML","dash") -> (popContext) >> pEndLine+      ("YAML","header") -> (popContext) >> pEndLine+      ("YAML","EOD") -> return ()+      ("YAML","directive") -> (popContext) >> pEndLine+      ("YAML","attribute") -> (popContext >> popContext) >> pEndLine+      ("YAML","attribute-inline") -> return ()+      ("YAML","attribute-pre") -> (popContext) >> pEndLine+      ("YAML","attribute-pre-inline") -> (popContext) >> pEndLine+      ("YAML","list") -> return ()+      ("YAML","hash") -> return ()+      ("YAML","attribute-string") -> return ()+      ("YAML","attribute-stringx") -> return ()+      ("YAML","attribute-string-inline") -> return ()+      ("YAML","attribute-stringx-inline") -> return ()+      ("YAML","attribute-end") -> (popContext >> popContext >> popContext) >> pEndLine+      ("YAML","attribute-end-inline") -> (popContext >> popContext >> popContext) >> pEndLine+      ("YAML","string") -> return ()+      ("YAML","stringx") -> return ()+      ("YAML","comment") -> (popContext) >> pEndLine+      _ -> return ()+    else return ()  withAttribute attr txt = do   when (null txt) $ fail "Parser matched no text"@@ -85,8 +87,6 @@ regex_'5cs'2a = compileRegex "\\s*" regex_'2c'5cs = compileRegex ",\\s" -defaultAttributes = [(("YAML","normal"),NormalTok),(("YAML","dash"),NormalTok),(("YAML","header"),OtherTok),(("YAML","EOD"),CommentTok),(("YAML","directive"),OtherTok),(("YAML","attribute"),NormalTok),(("YAML","attribute-inline"),NormalTok),(("YAML","attribute-pre"),NormalTok),(("YAML","attribute-pre-inline"),NormalTok),(("YAML","list"),NormalTok),(("YAML","hash"),NormalTok),(("YAML","attribute-string"),NormalTok),(("YAML","attribute-stringx"),NormalTok),(("YAML","attribute-string-inline"),NormalTok),(("YAML","attribute-stringx-inline"),NormalTok),(("YAML","attribute-end"),ErrorTok),(("YAML","attribute-end-inline"),ErrorTok),(("YAML","string"),NormalTok),(("YAML","stringx"),NormalTok),(("YAML","comment"),CommentTok)]- parseRules ("YAML","normal") =   (((pColumn 0 >> pRegExpr regex_'2d'2d'2d >>= withAttribute OtherTok) >>~ pushContext ("YAML","header"))    <|>@@ -120,7 +120,7 @@    <|>    ((pDetectChar False '"' >>= withAttribute NormalTok) >>~ pushContext ("YAML","stringx"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","normal")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","normal") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","normal")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","dash") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -137,23 +137,23 @@    <|>    ((lookAhead (pRegExpr regex_'2e) >> (popContext) >> currentContext >>= parseRules))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","dash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","dash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","dash")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","header") =   (((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","header")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","header") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","header")) >> pDefault >>= withAttribute OtherTok))  parseRules ("YAML","EOD") =-  (currentContext >>= \x -> guard (x == ("YAML","EOD")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","EOD") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("YAML","EOD")) >> pDefault >>= withAttribute CommentTok)  parseRules ("YAML","directive") =-  (currentContext >>= \x -> guard (x == ("YAML","directive")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","directive") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("YAML","directive")) >> pDefault >>= withAttribute OtherTok)  parseRules ("YAML","attribute") =   (((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-inline") =   (((pDetectChar False ',' >>= withAttribute KeywordTok) >>~ (popContext >> popContext))@@ -162,7 +162,7 @@    <|>    ((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-inline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-inline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-inline")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-pre") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -187,7 +187,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-pre")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-pre") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-pre")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-pre-inline") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -216,7 +216,7 @@    <|>    ((pRegExpr regex_'2e >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute-inline"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-pre-inline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-pre-inline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-pre-inline")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","list") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -249,7 +249,7 @@    <|>    ((pDetectChar False ',' >>= withAttribute KeywordTok))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","list")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","list") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","list")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","hash") =   (((pDetectSpaces >>= withAttribute NormalTok))@@ -264,38 +264,38 @@    <|>    ((pDetectChar False '}' >>= withAttribute KeywordTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","hash")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","hash") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","hash")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-string") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '\'' >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute-end"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-string")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-stringx") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '"' >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute-end"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-stringx")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-stringx") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-stringx")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-string-inline") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '\'' >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute-end-inline"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-string-inline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-string-inline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-string-inline")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-stringx-inline") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '"' >>= withAttribute NormalTok) >>~ pushContext ("YAML","attribute-end-inline"))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-stringx-inline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-stringx-inline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-stringx-inline")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","attribute-end") =-  (currentContext >>= \x -> guard (x == ("YAML","attribute-end")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-end") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("YAML","attribute-end")) >> pDefault >>= withAttribute ErrorTok)  parseRules ("YAML","attribute-end-inline") =   (((pRegExpr regex_'5cs'2a >>= withAttribute NormalTok))@@ -304,24 +304,24 @@    <|>    ((pRegExpr regex_'2c'5cs >>= withAttribute KeywordTok) >>~ (popContext >> popContext >> popContext))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","attribute-end-inline")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","attribute-end-inline") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","attribute-end-inline")) >> pDefault >>= withAttribute ErrorTok))  parseRules ("YAML","string") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '\'' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","string")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","string") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","string")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","stringx") =   (((pDetectIdentifier >>= withAttribute NormalTok))    <|>    ((pDetectChar False '"' >>= withAttribute NormalTok) >>~ (popContext))    <|>-   (currentContext >>= \x -> guard (x == ("YAML","stringx")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","stringx") defaultAttributes)))+   (currentContext >>= \x -> guard (x == ("YAML","stringx")) >> pDefault >>= withAttribute NormalTok))  parseRules ("YAML","comment") =-  (currentContext >>= \x -> guard (x == ("YAML","comment")) >> pDefault >>= withAttribute (fromMaybe NormalTok $ lookup ("YAML","comment") defaultAttributes))+  (currentContext >>= \x -> guard (x == ("YAML","comment")) >> pDefault >>= withAttribute CommentTok)   parseRules x = parseRules ("YAML","normal") <|> fail ("Unknown context" ++ show x)
changelog view
@@ -1,8 +1,32 @@+highlighting-kate 0.5.3.4 (04 Jan 2013)++  * Don't pop context on line end if we're already at root context.+    This helps with the erlang.xml file, which has some odd+    `#pop`s in it. Closes #26.++  * Avoid superfluous table lookup.  We find the default attribute+    in ParseSyntaxFiles and embed it directly in the parser, rather+    than looking it up at runtime.  This simplifies the parsers+    and should boost performance.++  * Don't pop last context in context stack.  This helps with the+    erlang.xml file, which has some odd `#pop`s.++  * Changed cabal file so library need not be recompiled for executable.+    Moved Highlight.hs to extra/ directory.++  * Fixed alignment of line numbers with lines.++  * Make sure we parse the whole line when an error occurs.+    This fixes a problem wherein ends of lines were dropped+    after errors.+ highlighting-kate 0.5.3.3 (12 Oct 2012) -  * Use \char13 and \char18 for ' and ` in LaTeX output.-    Otherwise these appear as curly quotes (unless a package-    like upquote is used).+  * LaTeX output:  Use \char13 and \char18 for ' and `.+    Reason:  Otherwise these appear as curly quotes.+    The upquote package can alternatively be used, but it seems better to+    make it unnecessary to use it.    * Make line number anchors into clickable links.     This makes it easier to obtain the URL for a specific line
+ extra/Highlight.hs view
@@ -0,0 +1,160 @@+{-# LANGUAGE CPP, OverloadedStrings #-}+module Main where+import Text.Highlighting.Kate+import System.IO (hPutStrLn, stderr)+import System.Environment+import System.Console.GetOpt+import System.Exit+import System.FilePath (takeFileName)+import Data.Maybe (listToMaybe)+import Data.Char (toLower)+#if MIN_VERSION_blaze_html(0,5,0)+import Text.Blaze.Html+import Text.Blaze.Html.Renderer.String+#else+import Text.Blaze+import Text.Blaze.Renderer.String+#endif+import qualified Text.Blaze.Html5 as H+import qualified Text.Blaze.Html5.Attributes as A++data Flag = Sty String+          | Format String+          | Help+          | Fragment+          | List+          | NumberLines+          | Syntax String+          | TitleAttributes+          | Version+          deriving (Eq, Show)++options :: [OptDescr Flag]+options =+  [ Option ['S'] ["style"] (ReqArg Sty "STYLE") "specify style"+  , Option ['F'] ["format"] (ReqArg Format "FORMAT")  "output format (html|latex)"+  , Option ['f'] ["fragment"] (NoArg Fragment)  "fragment, without document header"+  , Option ['h'] ["help"] (NoArg Help)   "show usage message"+  , Option ['l'] ["list"] (NoArg List)   "list available language syntaxes"+  , Option ['n'] ["number-lines"] (NoArg NumberLines)  "number lines"+  , Option ['s'] ["syntax"] (ReqArg Syntax "SYNTAX")  "specify language syntax to use"+  , Option ['t'] ["title-attributes"] (NoArg TitleAttributes)  "include structure in title attributes"+  , Option ['v'] ["version"] (NoArg Version)   "print version"+  ]++syntaxOf :: [Flag] -> Maybe String+syntaxOf [] = Nothing+syntaxOf (Syntax s : _) = Just s+syntaxOf (_:xs) = syntaxOf xs++styleOf :: [Flag] -> Maybe Style+styleOf [] = Nothing+styleOf (Sty s : _) = case map toLower s of+                            "pygments"   -> Just pygments+                            "espresso"   -> Just espresso+                            "kate"       -> Just kate+                            "tango"      -> Just tango+                            "haddock"    -> Just haddock+                            "monochrome" -> Just monochrome+                            _            -> error $ "Unknown style: " ++ s+styleOf (_ : xs) = styleOf xs++formatOf :: [Flag] -> String+formatOf [] = "html" -- default+formatOf (Format s : _) = case map toLower s of+                            "html"   -> "html"+                            "latex"  -> "latex"+                            _        -> error $ "Unknown format: " ++ s+formatOf (_ : xs) = formatOf xs++filterNewlines :: String -> String+filterNewlines ('\r':'\n':xs) = '\n' : filterNewlines xs+filterNewlines ('\r':xs) = '\n' : filterNewlines xs+filterNewlines (x:xs) = x : filterNewlines xs+filterNewlines [] = []++main = do+  (opts, fnames, errs) <- getArgs >>= return . getOpt Permute options+  prg <- getProgName+  let usageHeader = prg ++ " [options] [files...]"+  if not (null errs)+     then ioError (userError $ concat errs ++ usageInfo usageHeader options)+     else return ()+  if List `elem` opts+     then putStrLn (unwords languages) >> exitWith ExitSuccess+     else return ()+  if Help `elem` opts+     then hPutStrLn stderr (usageInfo usageHeader options) >> +          exitWith (ExitFailure 1)+     else return ()+  if Version `elem` opts+     then putStrLn (prg ++ " " ++ highlightingKateVersion ++ " - (c) 2008 John MacFarlane") >> +          exitWith ExitSuccess+     else return ()+  code <- if null fnames+             then getContents >>= return . filterNewlines+             else mapM readFile fnames >>= return . filterNewlines . concat+  let lang' = case syntaxOf opts of+                    Just e   -> Just e+                    Nothing  -> case fnames of+                                     []     -> Nothing+                                     (x:_)  -> listToMaybe $ languagesByFilename $ takeFileName x+  lang <- if lang' == Nothing+             then hPutStrLn stderr "No syntax specified." >>+                  hPutStrLn stderr (usageInfo usageHeader options) >>+                  exitWith (ExitFailure 5)+             else do let (Just l) = lang'+                     return (map toLower l)+  if not (lang `elem` (map (map toLower) languages))+     then hPutStrLn stderr ("Unknown syntax: " ++ lang) >> exitWith (ExitFailure 4)+     else return ()+  let highlightOpts = defaultFormatOpts{ titleAttributes = TitleAttributes `elem` opts+                                       , numberLines = NumberLines `elem` opts+                                       , lineAnchors = NumberLines `elem` opts+                                       }+  let fragment = Fragment `elem` opts+  let fname = case fnames of+                    []    -> ""+                    (x:_) -> x+  case formatOf opts of+       "html"  -> hlHtml fragment fname highlightOpts (maybe pygments id $ styleOf opts)+                       lang code+       "latex" -> hlLaTeX fragment fname highlightOpts (maybe pygments id $ styleOf opts) lang code+       x       -> error $ "Uknown format " ++  x++hlHtml :: Bool               -- ^ Fragment+      -> FilePath            -- ^ Filename+      -> FormatOptions+      -> Style+      -> String              -- ^ language+      -> String              -- ^ code+      -> IO ()+hlHtml frag fname opts sty lang code =+ if frag+    then putStrLn $ renderHtml fragment+    else putStrLn $ renderHtml $ H.head (pageTitle >> metadata >> css) >> H.body (toHtml fragment)+  where fragment = formatHtmlBlock opts $ highlightAs lang code+        css = H.style ! A.type_ "text/css" $ toHtml $ styleToCss sty+        pageTitle = H.title $ toHtml fname+        metadata = H.meta ! A.httpEquiv "Content-Type" ! A.content "text/html; charset=UTF-8" >>+                    H.meta ! A.name "generator" ! A.content "highlight-kate"++hlLaTeX :: Bool               -- ^ Fragment+        -> FilePath            -- ^ Filename+        -> FormatOptions+        -> Style+        -> String              -- ^ language+        -> String              -- ^ code+        -> IO ()+hlLaTeX frag fname opts sty lang code =+ if frag+    then putStrLn fragment+    else putStrLn $ "\\documentclass{article}\n\\usepackage[margin=1in]{geometry}\n" +++                    macros ++ pageTitle +++                    "\n\\begin{document}\n\\maketitle\n" ++  fragment ++ "\n\\end{document}"+  where fragment = formatLaTeXBlock opts $ highlightAs lang code+        macros = styleToLaTeX sty+        pageTitle = "\\title{" ++ fname ++ "}\n"+++
highlighting-kate.cabal view
@@ -1,6 +1,6 @@ Name:                highlighting-kate-Version:             0.5.3.3-Cabal-Version:       >= 1.6+Version:             0.5.3.4+Cabal-Version:       >= 1.10 Build-Type:          Simple Category:            Text Synopsis:            Syntax highlighting@@ -247,6 +247,7 @@                      Text.Highlighting.Kate.Syntax.Yaml   -- disable optimizations; it doesn't hurt performance much and   -- massively improves compilation speed and memory usage+  Default-Language:    Haskell98   Ghc-Options:       -W -O0   Ghc-Prof-Options:  -auto-all -caf-all   -- the following line is needed to prevent gcc from consuming huge amounts of@@ -255,7 +256,10 @@  Executable Highlight   Main-Is:          Highlight.hs-  Build-Depends:    base, containers, blaze-html >= 0.4.2 && < 0.6, filepath+  Build-Depends:    base, containers, blaze-html >= 0.4.2 && < 0.6, filepath,+                    highlighting-kate+  Hs-Source-Dirs:   extra+  Default-Language:    Haskell98   if flag(pcre-light)     cpp-options:     -D_PCRE_LIGHT   Ghc-Options:      -W -O0 -rtsopts