highlighting-kate 0.2 → 0.2.1
raw patch · 19 files changed
+65/−50 lines, 19 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ParseSyntaxFiles.hs +7/−4
- Text/Highlighting/Kate.hs +1/−1
- Text/Highlighting/Kate/Syntax/Bash.hs +9/−9
- Text/Highlighting/Kate/Syntax/C.hs +1/−1
- Text/Highlighting/Kate/Syntax/Cpp.hs +1/−1
- Text/Highlighting/Kate/Syntax/Djangotemplate.hs +3/−3
- Text/Highlighting/Kate/Syntax/Doxygen.hs +12/−12
- Text/Highlighting/Kate/Syntax/Erlang.hs +1/−1
- Text/Highlighting/Kate/Syntax/Json.hs +2/−2
- Text/Highlighting/Kate/Syntax/Latex.hs +3/−3
- Text/Highlighting/Kate/Syntax/Lex.hs +1/−1
- Text/Highlighting/Kate/Syntax/Mediawiki.hs +1/−1
- Text/Highlighting/Kate/Syntax/Perl.hs +4/−4
- Text/Highlighting/Kate/Syntax/Php.hs +2/−2
- Text/Highlighting/Kate/Syntax/Tcl.hs +1/−1
- Text/Highlighting/Kate/Syntax/Texinfo.hs +1/−1
- Text/Highlighting/Kate/Syntax/Yacc.hs +2/−2
- changelog +10/−0
- highlighting-kate.cabal +3/−1
ParseSyntaxFiles.hs view
@@ -303,10 +303,13 @@ else empty) <> if parserType parser == "IncludeRules" then mainParser <> char ')'- else mainParser <> text " >>= withAttribute " <> - text (if null (parserAttribute parser)- then show (contAttribute context)- else show (parserAttribute parser)) <> char ')' <>+ else (if parserLookAhead parser+ then text "lookAhead (" <> mainParser <> text ") >> return ([],\"\") " + else mainParser <> text " >>= withAttribute " <> + text (if null (parserAttribute parser)+ then show (contAttribute context)+ else show (parserAttribute parser))) <> + char ')' <> (if parserContext parser `elem` ["", "#stay"] then empty else text " >>~ " <> switchContext (parserContext parser))
Text/Highlighting/Kate.hs view
@@ -35,4 +35,4 @@ import Text.Highlighting.Kate.Syntax ( highlightAs, languages, languagesByExtension ) import Text.Highlighting.Kate.Definitions ( SourceLine, LabeledSource ) -highlightingKateVersion = "0.2"+highlightingKateVersion = "0.2.1"
Text/Highlighting/Kate/Syntax/Bash.hs view
@@ -230,7 +230,7 @@ <|> ((pRegExpr (compileRegex "\\d*<<<") >>= withAttribute "Redirection")) <|>- ((pString False "<<" >>= withAttribute "Redirection") >>~ pushContext "HereDoc")+ ((lookAhead (pString False "<<") >> return ([],"") ) >>~ pushContext "HereDoc") <|> ((pRegExpr (compileRegex "[<>]\\(") >>= withAttribute "Redirection") >>~ pushContext "ProcessSubst") <|>@@ -598,21 +598,21 @@ return (attr, result) parseRules "HereDoc" = - do (attr, result) <- (((pRegExpr (compileRegex "(<<-\\s*\"([^|&;()<>\\s]+)\")") >>= withAttribute "Redirection") >>~ pushContext "HereDocIQ")+ do (attr, result) <- (((lookAhead (pRegExpr (compileRegex "(<<-\\s*\"([^|&;()<>\\s]+)\")")) >> return ([],"") ) >>~ pushContext "HereDocIQ") <|>- ((pRegExpr (compileRegex "(<<-\\s*'([^|&;()<>\\s]+)')") >>= withAttribute "Redirection") >>~ pushContext "HereDocIQ")+ ((lookAhead (pRegExpr (compileRegex "(<<-\\s*'([^|&;()<>\\s]+)')")) >> return ([],"") ) >>~ pushContext "HereDocIQ") <|>- ((pRegExpr (compileRegex "(<<-\\s*\\\\([^|&;()<>\\s]+))") >>= withAttribute "Redirection") >>~ pushContext "HereDocIQ")+ ((lookAhead (pRegExpr (compileRegex "(<<-\\s*\\\\([^|&;()<>\\s]+))")) >> return ([],"") ) >>~ pushContext "HereDocIQ") <|>- ((pRegExpr (compileRegex "(<<-\\s*([^|&;()<>\\s]+))") >>= withAttribute "Redirection") >>~ pushContext "HereDocINQ")+ ((lookAhead (pRegExpr (compileRegex "(<<-\\s*([^|&;()<>\\s]+))")) >> return ([],"") ) >>~ pushContext "HereDocINQ") <|>- ((pRegExpr (compileRegex "(<<\\s*\"([^|&;()<>\\s]+)\")") >>= withAttribute "Redirection") >>~ pushContext "HereDocQ")+ ((lookAhead (pRegExpr (compileRegex "(<<\\s*\"([^|&;()<>\\s]+)\")")) >> return ([],"") ) >>~ pushContext "HereDocQ") <|>- ((pRegExpr (compileRegex "(<<\\s*'([^|&;()<>\\s]+)')") >>= withAttribute "Redirection") >>~ pushContext "HereDocQ")+ ((lookAhead (pRegExpr (compileRegex "(<<\\s*'([^|&;()<>\\s]+)')")) >> return ([],"") ) >>~ pushContext "HereDocQ") <|>- ((pRegExpr (compileRegex "(<<\\s*\\\\([^|&;()<>\\s]+))") >>= withAttribute "Redirection") >>~ pushContext "HereDocQ")+ ((lookAhead (pRegExpr (compileRegex "(<<\\s*\\\\([^|&;()<>\\s]+))")) >> return ([],"") ) >>~ pushContext "HereDocQ") <|>- ((pRegExpr (compileRegex "(<<\\s*([^|&;()<>\\s]+))") >>= withAttribute "Redirection") >>~ pushContext "HereDocNQ")+ ((lookAhead (pRegExpr (compileRegex "(<<\\s*([^|&;()<>\\s]+))")) >> return ([],"") ) >>~ pushContext "HereDocNQ") <|> ((pString False "<<" >>= withAttribute "Redirection") >>~ (popContext >> return ()))) return (attr, result)
Text/Highlighting/Kate/Syntax/C.hs view
@@ -89,7 +89,7 @@ <|> ((pFirstNonSpace >> pRegExpr (compileRegex "#\\s*if\\s+0") >>= withAttribute "Preprocessor") >>~ pushContext "Outscoped") <|>- ((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute "Normal Text") >>~ pushContext "AfterHash")+ ((pFirstNonSpace >> lookAhead (pDetectChar False '#') >> return ([],"") ) >>~ pushContext "AfterHash") <|> ((pFirstNonSpace >> pString False "//BEGIN" >>= withAttribute "Region Marker") >>~ pushContext "Region Marker") <|>
Text/Highlighting/Kate/Syntax/Cpp.hs view
@@ -89,7 +89,7 @@ <|> ((pFirstNonSpace >> pRegExpr (compileRegex "#\\s*if\\s+0") >>= withAttribute "Preprocessor") >>~ pushContext "Outscoped") <|>- ((pFirstNonSpace >> pDetectChar False '#' >>= withAttribute "Normal Text") >>~ pushContext "AfterHash")+ ((pFirstNonSpace >> lookAhead (pDetectChar False '#') >> return ([],"") ) >>~ pushContext "AfterHash") <|> ((pFirstNonSpace >> pString False "//BEGIN" >>= withAttribute "Region Marker") >>~ pushContext "Region Marker") <|>
Text/Highlighting/Kate/Syntax/Djangotemplate.hs view
@@ -122,7 +122,7 @@ return (attr, result) parseRules "In Block" = - do (attr, result) <- (((pRegExpr (compileRegex "\\{%\\s*end[a-z]+\\s*%\\}") >>= withAttribute "Normal Text") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pRegExpr (compileRegex "\\{%\\s*end[a-z]+\\s*%\\}")) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "FindTemplate")) <|>@@ -168,7 +168,7 @@ return (attr, result) parseRules "Template Tag" = - do (attr, result) <- (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" ["for","block","if","ifequal","ifnotequal","ifchanged","blocktrans","spaceless"] >>= withAttribute "Template Tag") >>~ pushContext "Found Block Tag")+ do (attr, result) <- (((lookAhead (pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" ["for","block","if","ifequal","ifnotequal","ifchanged","blocktrans","spaceless"]) >> return ([],"") ) >>~ pushContext "Found Block Tag") <|> ((pDetectIdentifier >>= withAttribute "Template Tag") >>~ pushContext "In Template Tag")) return (attr, result)@@ -180,7 +180,7 @@ parseRules "In Block Tag" = do (attr, result) <- (((pRegExprDynamic "\\{%\\s*end%1\\s*%\\}" >>= withAttribute "Template Tag") >>~ (popContext >> popContext >> popContext >> return ())) <|>- ((pRegExpr (compileRegex "\\{%\\s*end[a-z]+\\s*%\\}") >>= withAttribute "Template Tag Argument") >>~ pushContext "Non Matching Tag")+ ((lookAhead (pRegExpr (compileRegex "\\{%\\s*end[a-z]+\\s*%\\}")) >> return ([],"") ) >>~ pushContext "Non Matching Tag") <|> ((pDetect2Chars False '%' '}' >>= withAttribute "Template Tag") >>~ pushContext "In Block") <|>
Text/Highlighting/Kate/Syntax/Doxygen.hs view
@@ -172,13 +172,13 @@ return (attr, result) parseRules "ML_TagWord" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "SL_TagWord"))) return (attr, result) parseRules "ML_TagParam" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectSpaces >>= withAttribute "Comment")) <|>@@ -194,7 +194,7 @@ return (attr, result) parseRules "ML_TagWordWord" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectSpaces >>= withAttribute "Comment")) <|>@@ -204,7 +204,7 @@ return (attr, result) parseRules "ML_Tag2ndWord" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> popContext >> return ())) <|> ((parseRules "SL_Tag2ndWord"))) return (attr, result)@@ -212,7 +212,7 @@ parseRules "ML_TagString" = do (attr, result) <- (((pDetectSpaces >>= withAttribute "Comment")) <|>- ((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ ((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pString False "<!--" >>= withAttribute "HTML Comment") >>~ pushContext "ML_htmlcomment") <|>@@ -224,13 +224,13 @@ return (attr, result) parseRules "ML_TagWordString" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "SL_TagWordString"))) return (attr, result) parseRules "ML_htmltag" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetect2Chars False '/' '>' >>= withAttribute "HTML Tag") >>~ (popContext >> return ())) <|>@@ -240,7 +240,7 @@ return (attr, result) parseRules "ML_htmlcomment" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute "") . snd))) <|>@@ -248,7 +248,7 @@ return (attr, result) parseRules "ML_identifiers" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pRegExpr (compileRegex "\\s*#?[a-zA-Z0-9]*") >>= withAttribute "String") >>~ (popContext >> return ())) <|>@@ -258,13 +258,13 @@ return (attr, result) parseRules "ML_types1" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectChar False '\'' >>= withAttribute "Types") >>~ (popContext >> popContext >> return ()))) return (attr, result) parseRules "ML_types2" = - do (attr, result) <- (((pDetect2Chars False '*' '/' >>= withAttribute "Comment") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pDetect2Chars False '*' '/') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectChar False '"' >>= withAttribute "Types") >>~ (popContext >> popContext >> return ()))) return (attr, result)@@ -272,7 +272,7 @@ parseRules "SL_TagWord" = do (attr, result) <- (((pDetectSpaces >>= withAttribute "Comment")) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}" ["\\addtogroup","\\a","\\anchor","\\b","\\c","\\class","\\cond","\\copydoc","\\def","\\dontinclude","\\dotfile","\\e","\\elseif","\\em","\\enum","\\example","\\exception","\\exceptions","\\file","\\htmlinclude","\\if","\\ifnot","\\include","\\link","\\namespace","\\p","\\package","\\ref","\\relatesalso","\\relates","\\retval","\\throw","\\throws","\\verbinclude","\\version","\\xrefitem","@addtogroup","@a","@anchor","@b","@c","@class","@cond","@copydoc","@def","@dontinclude","@dotfile","@e","@elseif","@em","@enum","@example","@exception","@exceptions","@file","@htmlinclude","@if","@ifnot","@include","@link","@namespace","@p","@package","@ref","@relatesalso","@relates","@retval","@throw","@throws","@verbinclude","@version","@xrefitem"] >>= withAttribute "Tags") >>~ (popContext >> return ()))+ ((lookAhead (pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}" ["\\addtogroup","\\a","\\anchor","\\b","\\c","\\class","\\cond","\\copydoc","\\def","\\dontinclude","\\dotfile","\\e","\\elseif","\\em","\\enum","\\example","\\exception","\\exceptions","\\file","\\htmlinclude","\\if","\\ifnot","\\include","\\link","\\namespace","\\p","\\package","\\ref","\\relatesalso","\\relates","\\retval","\\throw","\\throws","\\verbinclude","\\version","\\xrefitem","@addtogroup","@a","@anchor","@b","@c","@class","@cond","@copydoc","@def","@dontinclude","@dotfile","@e","@elseif","@em","@enum","@example","@exception","@exceptions","@file","@htmlinclude","@if","@ifnot","@include","@link","@namespace","@p","@package","@ref","@relatesalso","@relates","@retval","@throw","@throws","@verbinclude","@version","@xrefitem"]) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pRegExpr (compileRegex "\\S(?=([][,?;()]|\\.$|\\.?\\s))") >>= withAttribute "Word") >>~ (popContext >> return ())) <|>
Text/Highlighting/Kate/Syntax/Erlang.hs view
@@ -96,7 +96,7 @@ <|> ((pRegExpr (compileRegex "\\b[a-z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$):\\b[a-z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)") >>= withAttribute "Function") >>~ (popContext >> return ())) <|>- ((pRegExpr (compileRegex "\\b[a-z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)\\(") >>= withAttribute "Functon") >>~ pushContext "isfunction")+ ((lookAhead (pRegExpr (compileRegex "\\b[a-z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)\\(")) >> return ([],"") ) >>~ pushContext "isfunction") <|> ((pRegExpr (compileRegex "\\b[_A-Z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)") >>= withAttribute "Variable") >>~ (popContext >> return ())) <|>
Text/Highlighting/Kate/Syntax/Json.hs view
@@ -106,9 +106,9 @@ <|> ((pDetectChar False '[' >>= withAttribute "Style_Seperator_Array") >>~ pushContext "Array") <|>- ((pDetectChar False '}' >>= withAttribute "Style_Error") >>~ (popContext >> return ()))+ ((lookAhead (pDetectChar False '}') >> return ([],"") ) >>~ (popContext >> return ())) <|>- ((pDetectChar False ',' >>= withAttribute "Style_Error") >>~ (popContext >> return ()))+ ((lookAhead (pDetectChar False ',') >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectSpaces >>= withAttribute "Style_Normal")) <|>
Text/Highlighting/Kate/Syntax/Latex.hs view
@@ -331,7 +331,7 @@ parseRules "VerbatimEnv" = do (attr, result) <- (((pDetectChar False '}' >>= withAttribute "Normal Text") >>~ pushContext "Verbatim") <|>- ((pRegExpr (compileRegex "[a-zA-Z]") >>= withAttribute "Environment") >>~ (popContext >> return ()))+ ((lookAhead (pRegExpr (compileRegex "[a-zA-Z]")) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "EnvCommon")) <|>@@ -365,7 +365,7 @@ parseRules "MathEnv" = do (attr, result) <- (((pDetectChar False '}' >>= withAttribute "Normal Text") >>~ pushContext "MathModeEnv") <|>- ((pRegExpr (compileRegex "[a-zA-Z]") >>= withAttribute "Environment") >>~ (popContext >> return ()))+ ((lookAhead (pRegExpr (compileRegex "[a-zA-Z]")) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "EnvCommon"))) return (attr, result)@@ -375,7 +375,7 @@ <|> ((pDetectChar False '}' >>= withAttribute "Normal Text") >>~ pushContext "MathModeEnv") <|>- ((pRegExpr (compileRegex "[a-zA-Z]") >>= withAttribute "Environment") >>~ (popContext >> return ()))+ ((lookAhead (pRegExpr (compileRegex "[a-zA-Z]")) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "EnvCommon"))) return (attr, result)
Text/Highlighting/Kate/Syntax/Lex.hs view
@@ -94,7 +94,7 @@ defaultAttributes = [("Pre Start","Normal Text"),("Definitions","Normal Text"),("Rules","Normal Text"),("User Code","Normal Text"),("Percent Command","Directive"),("Comment","Comment"),("Definition RegExpr","RegExpr"),("Rule RegExpr","RegExpr"),("RegExpr (","RegExpr"),("RegExpr [","RegExpr"),("RegExpr {","RegExpr"),("RegExpr Q","RegExpr"),("RegExpr Base","RegExpr"),("Start Conditions Scope","Normal Text"),("Action","Normal Text"),("Detect C","Normal Text"),("Indented C","Normal Text"),("Lex C Bloc","Normal Text"),("Lex Rule C Bloc","Normal Text"),("Normal C Bloc","Normal Text"),("Action C","Normal Text")] parseRules "Pre Start" = - do (attr, result) <- ((pRegExpr (compileRegex ".") >>= withAttribute "Normal Text") >>~ pushContext "Definitions")+ do (attr, result) <- ((lookAhead (pRegExpr (compileRegex ".")) >> return ([],"") ) >>~ pushContext "Definitions") return (attr, result) parseRules "Definitions" =
Text/Highlighting/Kate/Syntax/Mediawiki.hs view
@@ -172,7 +172,7 @@ return (attr, result) parseRules "WikiLinkDescription" = - do (attr, result) <- ((pDetect2Chars False ']' ']' >>= withAttribute "Wiki-Tag") >>~ (popContext >> return ()))+ do (attr, result) <- ((lookAhead (pDetect2Chars False ']' ']') >> return ([],"") ) >>~ (popContext >> return ())) return (attr, result) parseRules "Link" =
Text/Highlighting/Kate/Syntax/Perl.hs view
@@ -178,7 +178,7 @@ <|> ((pDetectChar False '`' >>= withAttribute "Operator") >>~ pushContext "Backticked") <|>- ((pRegExpr (compileRegex "(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])") >>= withAttribute "Normal Text") >>~ pushContext "find_variable")+ ((lookAhead (pRegExpr (compileRegex "(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])")) >> return ([],"") ) >>~ pushContext "find_variable") <|> ((pRegExpr (compileRegex "<[A-Z0-9_]+>") >>= withAttribute "Keyword")) <|>@@ -266,7 +266,7 @@ <|> ((pRegExpr (compileRegex "\\\\.") >>= withAttribute "String (interpolated)")) <|>- ((pRegExpr (compileRegex "(?:[\\$@]\\S|%[\\w{])") >>= withAttribute "Normal Text") >>~ pushContext "find_variable_unsafe"))+ ((lookAhead (pRegExpr (compileRegex "(?:[\\$@]\\S|%[\\w{])")) >> return ([],"") ) >>~ pushContext "find_variable_unsafe")) return (attr, result) parseRules "ip_string" = @@ -590,7 +590,7 @@ parseRules "regex_pattern_internal_ip" = do (attr, result) <- (((parseRules "regex_pattern_internal_rules_1")) <|>- ((pRegExpr (compileRegex "[$@][^\\]\\s{}()|>']") >>= withAttribute "Data Type") >>~ pushContext "find_variable_unsafe")+ ((lookAhead (pRegExpr (compileRegex "[$@][^\\]\\s{}()|>']")) >> return ([],"") ) >>~ pushContext "find_variable_unsafe") <|> ((parseRules "regex_pattern_internal_rules_2"))) return (attr, result)@@ -802,7 +802,7 @@ parseRules "sub_name_def" = do (attr, result) <- (((pRegExpr (compileRegex "\\w+") >>= withAttribute "Function")) <|>- ((pRegExpr (compileRegex "\\$\\S") >>= withAttribute "Normal Text") >>~ pushContext "find_variable")+ ((lookAhead (pRegExpr (compileRegex "\\$\\S")) >> return ([],"") ) >>~ pushContext "find_variable") <|> ((pRegExpr (compileRegex "\\s*\\(") >>= withAttribute "Normal Text") >>~ pushContext "sub_arg_definition") <|>
Text/Highlighting/Kate/Syntax/Php.hs view
@@ -97,7 +97,7 @@ parseRules "phpsource" = do (attr, result) <- (((pDetectSpaces >>= withAttribute "PHP Text")) <|>- ((pString False "?>" >>= withAttribute "Keyword") >>~ (popContext >> return ()))+ ((lookAhead (pString False "?>") >> return ([],"") ) >>~ (popContext >> return ())) <|> ((pDetectChar False '#' >>= withAttribute "Comment") >>~ pushContext "onelinecomment") <|>@@ -143,7 +143,7 @@ return (attr, result) parseRules "onelinecomment" = - do (attr, result) <- ((pString False "?>" >>= withAttribute "Keyword") >>~ (popContext >> return ()))+ do (attr, result) <- ((lookAhead (pString False "?>") >> return ([],"") ) >>~ (popContext >> return ())) return (attr, result) parseRules "twolinecomment" =
Text/Highlighting/Kate/Syntax/Tcl.hs view
@@ -127,7 +127,7 @@ parseRules "New command line" = do (attr, result) <- (((pRegExpr (compileRegex "\\s*#") >>= withAttribute "Comment") >>~ pushContext "Comment") <|>- ((pRegExpr (compileRegex ".") >>= withAttribute "Normal Text") >>~ (popContext >> return ())))+ ((lookAhead (pRegExpr (compileRegex ".")) >> return ([],"") ) >>~ (popContext >> return ()))) return (attr, result) parseRules x = fail $ "Unknown context" ++ x
Text/Highlighting/Kate/Syntax/Texinfo.hs view
@@ -100,7 +100,7 @@ return (attr, result) parseRules "nodeFolding" = - do (attr, result) <- (((pRegExpr (compileRegex "@node\\b") >>= withAttribute "Command") >>~ (popContext >> return ()))+ do (attr, result) <- (((lookAhead (pRegExpr (compileRegex "@node\\b")) >> return ([],"") ) >>~ (popContext >> return ())) <|> ((parseRules "Normal Text"))) return (attr, result)
Text/Highlighting/Kate/Syntax/Yacc.hs view
@@ -100,7 +100,7 @@ <|> ((pColumn 0 >> pDetect2Chars False '%' '{' >>= withAttribute "Content-Type Delimiter") >>~ pushContext "C Declarations") <|>- ((pRegExpr (compileRegex ".") >>= withAttribute "Normal Text") >>~ pushContext "Declarations"))+ ((lookAhead (pRegExpr (compileRegex ".")) >> return ([],"") ) >>~ pushContext "Declarations")) return (attr, result) parseRules "C Declarations" = @@ -176,7 +176,7 @@ parseRules "Percent Command" = do (attr, result) <- (((parseRules "Comment")) <|>- ((pRegExpr (compileRegex "\\W") >>= withAttribute "Normal Text") >>~ pushContext "Percent Command In"))+ ((lookAhead (pRegExpr (compileRegex "\\W")) >> return ([],"") ) >>~ pushContext "Percent Command In")) return (attr, result) parseRules "Percent Command In" =
+ changelog view
@@ -0,0 +1,10 @@+highlighting-kate (0.2.1)++ * Implemented lookAhead in parsers, which fixed bugs in perl, bash,+ and other parsers.++highlighting-kate 0.2++ * Initial release+ + -- John MacFarlane <jgm@berkeley.edu> 10 Feb 2008
highlighting-kate.cabal view
@@ -1,5 +1,5 @@ Name: highlighting-kate-Version: 0.2+Version: 0.2.1 Cabal-Version: >= 1.2 Build-Type: Simple Category: Text@@ -27,8 +27,10 @@ License-file: LICENSE Author: John MacFarlane Maintainer: jgm@berkeley.edu+Homepage: http://johnmacfarlane.net/highlighting-kate Extra-Source-Files: README BUGS+ changelog Highlight.hs ParseSyntaxFiles.hs css/hk-espresso.css