highlighting-kate 0.5.4 → 0.5.5
raw patch · 101 files changed
+1331/−622 lines, 101 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ParseSyntaxFiles.hs +35/−21
- Text/Highlighting/Kate/Syntax.hs +5/−3
- Text/Highlighting/Kate/Syntax/Actionscript.hs +7/−6
- Text/Highlighting/Kate/Syntax/Ada.hs +5/−4
- Text/Highlighting/Kate/Syntax/Alert.hs +5/−4
- Text/Highlighting/Kate/Syntax/Alert_indent.hs +5/−4
- Text/Highlighting/Kate/Syntax/Apache.hs +7/−6
- Text/Highlighting/Kate/Syntax/Asn1.hs +5/−4
- Text/Highlighting/Kate/Syntax/Asp.hs +5/−4
- Text/Highlighting/Kate/Syntax/Awk.hs +7/−6
- Text/Highlighting/Kate/Syntax/Bash.hs +9/−8
- Text/Highlighting/Kate/Syntax/Bibtex.hs +5/−4
- Text/Highlighting/Kate/Syntax/Boo.hs +5/−4
- Text/Highlighting/Kate/Syntax/C.hs +15/−14
- Text/Highlighting/Kate/Syntax/Changelog.hs +5/−4
- Text/Highlighting/Kate/Syntax/Clojure.hs +5/−4
- Text/Highlighting/Kate/Syntax/Cmake.hs +7/−6
- Text/Highlighting/Kate/Syntax/Coffee.hs +10/−9
- Text/Highlighting/Kate/Syntax/Coldfusion.hs +5/−4
- Text/Highlighting/Kate/Syntax/Commonlisp.hs +5/−4
- Text/Highlighting/Kate/Syntax/Cpp.hs +15/−14
- Text/Highlighting/Kate/Syntax/Cs.hs +7/−6
- Text/Highlighting/Kate/Syntax/Css.hs +7/−6
- Text/Highlighting/Kate/Syntax/Curry.hs +108/−14
- Text/Highlighting/Kate/Syntax/D.hs +15/−14
- Text/Highlighting/Kate/Syntax/Diff.hs +5/−4
- Text/Highlighting/Kate/Syntax/Djangotemplate.hs +12/−11
- Text/Highlighting/Kate/Syntax/Doxygen.hs +10/−9
- Text/Highlighting/Kate/Syntax/Doxygenlua.hs +10/−9
- Text/Highlighting/Kate/Syntax/Dtd.hs +8/−7
- Text/Highlighting/Kate/Syntax/Eiffel.hs +5/−4
- Text/Highlighting/Kate/Syntax/Email.hs +5/−4
- Text/Highlighting/Kate/Syntax/Erlang.hs +7/−6
- Text/Highlighting/Kate/Syntax/Fortran.hs +5/−4
- Text/Highlighting/Kate/Syntax/Fsharp.hs +5/−4
- Text/Highlighting/Kate/Syntax/Gnuassembler.hs +8/−7
- Text/Highlighting/Kate/Syntax/Go.hs +8/−7
- Text/Highlighting/Kate/Syntax/Haskell.hs +9/−8
- Text/Highlighting/Kate/Syntax/Haxe.hs +5/−4
- Text/Highlighting/Kate/Syntax/Html.hs +12/−11
- Text/Highlighting/Kate/Syntax/Ini.hs +7/−6
- Text/Highlighting/Kate/Syntax/Java.hs +7/−6
- Text/Highlighting/Kate/Syntax/Javadoc.hs +10/−9
- Text/Highlighting/Kate/Syntax/Javascript.hs +10/−9
- Text/Highlighting/Kate/Syntax/Json.hs +5/−4
- Text/Highlighting/Kate/Syntax/Jsp.hs +5/−4
- Text/Highlighting/Kate/Syntax/Julia.hs +5/−4
- Text/Highlighting/Kate/Syntax/Latex.hs +9/−8
- Text/Highlighting/Kate/Syntax/Lex.hs +12/−11
- Text/Highlighting/Kate/Syntax/LiterateCurry.hs +9/−8
- Text/Highlighting/Kate/Syntax/LiterateHaskell.hs +8/−7
- Text/Highlighting/Kate/Syntax/Lua.hs +7/−6
- Text/Highlighting/Kate/Syntax/Makefile.hs +5/−4
- Text/Highlighting/Kate/Syntax/Mandoc.hs +11/−8
- Text/Highlighting/Kate/Syntax/Matlab.hs +5/−4
- Text/Highlighting/Kate/Syntax/Maxima.hs +5/−4
- Text/Highlighting/Kate/Syntax/Metafont.hs +5/−4
- Text/Highlighting/Kate/Syntax/Mips.hs +5/−4
- Text/Highlighting/Kate/Syntax/Modula2.hs +5/−4
- Text/Highlighting/Kate/Syntax/Modula3.hs +5/−4
- Text/Highlighting/Kate/Syntax/Monobasic.hs +5/−4
- Text/Highlighting/Kate/Syntax/Nasm.hs +5/−4
- Text/Highlighting/Kate/Syntax/Noweb.hs +10/−9
- Text/Highlighting/Kate/Syntax/Objectivec.hs +7/−6
- Text/Highlighting/Kate/Syntax/Objectivecpp.hs +16/−15
- Text/Highlighting/Kate/Syntax/Ocaml.hs +5/−4
- Text/Highlighting/Kate/Syntax/Octave.hs +5/−4
- Text/Highlighting/Kate/Syntax/Pascal.hs +5/−4
- Text/Highlighting/Kate/Syntax/Perl.hs +7/−6
- Text/Highlighting/Kate/Syntax/Php.hs +18/−17
- Text/Highlighting/Kate/Syntax/Pike.hs +5/−4
- Text/Highlighting/Kate/Syntax/Postscript.hs +5/−4
- Text/Highlighting/Kate/Syntax/Prolog.hs +8/−7
- Text/Highlighting/Kate/Syntax/Python.hs +11/−10
- Text/Highlighting/Kate/Syntax/R.hs +5/−4
- Text/Highlighting/Kate/Syntax/Relaxngcompact.hs +5/−4
- Text/Highlighting/Kate/Syntax/Rhtml.hs +12/−11
- Text/Highlighting/Kate/Syntax/Roff.hs +304/−0
- Text/Highlighting/Kate/Syntax/Ruby.hs +9/−8
- Text/Highlighting/Kate/Syntax/Rust.hs +5/−4
- Text/Highlighting/Kate/Syntax/Scala.hs +7/−6
- Text/Highlighting/Kate/Syntax/Scheme.hs +5/−4
- Text/Highlighting/Kate/Syntax/Sci.hs +5/−4
- Text/Highlighting/Kate/Syntax/Sed.hs +5/−4
- Text/Highlighting/Kate/Syntax/Sgml.hs +5/−4
- Text/Highlighting/Kate/Syntax/Sql.hs +5/−4
- Text/Highlighting/Kate/Syntax/SqlMysql.hs +5/−4
- Text/Highlighting/Kate/Syntax/SqlPostgresql.hs +5/−4
- Text/Highlighting/Kate/Syntax/Tcl.hs +5/−4
- Text/Highlighting/Kate/Syntax/Texinfo.hs +8/−7
- Text/Highlighting/Kate/Syntax/Verilog.hs +9/−8
- Text/Highlighting/Kate/Syntax/Vhdl.hs +5/−4
- Text/Highlighting/Kate/Syntax/Xml.hs +7/−6
- Text/Highlighting/Kate/Syntax/Xorg.hs +7/−6
- Text/Highlighting/Kate/Syntax/Xslt.hs +5/−4
- Text/Highlighting/Kate/Syntax/Xul.hs +9/−8
- Text/Highlighting/Kate/Syntax/Yacc.hs +11/−10
- Text/Highlighting/Kate/Syntax/Yaml.hs +5/−4
- highlighting-kate.cabal +3/−1
- xml/haskell.xml +3/−3
- xml/roff.xml +197/−0
ParseSyntaxFiles.hs view
@@ -144,17 +144,29 @@ putStrLn "Modified highlighting-kate.cabal." putStrLn "Backed up original as highlighting-kate.cabal.orig." +isIncludeRules :: SyntaxParser -> Bool+isIncludeRules p =+ parserType p == "IncludeRules" && "##" `isInfixOf` parserContext p++includeLangs :: SyntaxDefinition -> [String]+includeLangs syntax =+ nub $ map (takeLang . parserContext) $+ filter isIncludeRules $ concatMap contParsers $ synContexts syntax++takeLang :: String -> String+takeLang [] = []+takeLang ('#':'#':xs) = xs+takeLang (_:xs) = takeLang xs+ processOneFile :: FilePath -> IO () processOneFile src = do [syntax] <- runX $ application src let name = nameFromPath src let outFile = joinPath [libraryPath, "Syntax", addExtension name "hs"]- let isIncludeRules p = parserType p == "IncludeRules" && "##" `isPrefixOf`- parserContext p- let includeLangs = nub $ filter (/= name) $ map (drop 2 . parserContext) $- filter isIncludeRules $ concatMap contParsers $ synContexts syntax+ -- let includeLangs = nub $ filter (/= name) $ map (drop 2 . parserContext) $+ -- filter isIncludeRules $ concatMap contParsers $ synContexts syntax let includeImports = map (("import qualified " ++) . langNameToModule)- includeLangs+ (filter (/= name) $ includeLangs syntax) putStrLn $ "Writing " ++ outFile B.writeFile outFile $ fromString $ "{- This module was generated from data in the Kate syntax\n\@@ -206,9 +218,10 @@ text " , synStPrevNonspace = synStPrevNonspace st || not (all isSpace txt) }" $$ text "return (attr, txt)") parseExpression = text "-- | Parse an expression using appropriate local context." $$- text "parseExpression :: KateParser Token" $$- text "parseExpression = do" $$ (nest 2 $- text "(lang,cont) <- currentContext" $$+ text "parseExpression :: Maybe (String,String)" $$+ text " -> KateParser Token" $$+ text "parseExpression mbcontext = do" $$ (nest 2 $+ text "(lang,cont) <- maybe currentContext return mbcontext" $$ text ("result <- parseRules (lang,cont)") $$ text "optional $ do eof" $$ text " updateState $ \\st -> st{ synStPrevChar = '\\n' }" $$@@ -220,12 +233,10 @@ -- text $ "lineBeginContexts = " ++ (show $ map (\cont -> (contName cont, contLineBeginContext cont)) $ synContexts syntax) startingContext = head (synContexts syntax) -- contextNull = text $ "parseRules \"\" = parseRules " ++ show (synLanguage syntax, contName startingContext)- isIncludeRules p = parserType p == "IncludeRules" && "##" `isPrefixOf`- parserContext p- includeLangs = nub $ map (drop 2 . parserContext) $- filter isIncludeRules $- concatMap contParsers $ synContexts syntax- foreignContexts = vcat $ map (\l -> text ("parseRules (" ++ show l ++ ", _) = " ++ langNameToModule l ++ ".parseExpression")) includeLangs+ -- includeLangs = nub $ map (drop 2 . parserContext) $+ -- filter isIncludeRules $+ -- concatMap contParsers $ synContexts syntax+ foreignContexts = vcat $ map (\l -> text ("parseRules (" ++ show l ++ ", _) = " ++ langNameToModule l ++ ".parseExpression Nothing")) (includeLangs syntax) contextCatchAll = text $ "parseRules x = parseRules " ++ show (synLanguage syntax, contName startingContext) ++ " <|> fail (\"Unknown context\" ++ show x)" contexts = map (mkRules syntax) $ synContexts syntax initialContextStack = [(synLanguage syntax, contName startingContext)]@@ -241,7 +252,7 @@ \highlight :: String -> [SourceLine]\n\ \highlight input = evalState (mapM parseSourceLine $ lines input) startingState" lineParser = text $ "parseSourceLine :: String -> State SyntaxState SourceLine\n\- \parseSourceLine = mkParseSourceLine parseExpression"+ \parseSourceLine = mkParseSourceLine (parseExpression Nothing)" endLineParser = text "pEndLine = do" $$ (nest 2 $ text "updateState $ \\st -> st{ synStPrevNonspace = False }" $$ text "context <- currentContext" $$@@ -315,12 +326,15 @@ "HlCChar" -> "pHlCChar" "RangeDetect" -> "pRangeDetect " ++ show (parserChar parser) ++ " " ++ show (parserChar1 parser) "LineContinue" -> "pLineContinue"- "IncludeRules" -> case parserContext parser of- ('#':'#':xs) -> langNameToModule xs ++ ".parseExpression" ++- if parserIncludeAttrib parser || attr' == NormalTok- then ""- else " >>= ((withAttribute " ++ show attr' ++ ") . snd)"- xs -> "parseRules " ++ show (synLanguage syntax, xs)+ "IncludeRules" ->+ case break (=='#') $ parserContext parser of+ (cont,'#':'#':lang) ->+ langNameToModule lang ++ ".parseExpression (" +++ show (Just (lang, cont)) +++ if parserIncludeAttrib parser || attr' == NormalTok+ then ")"+ else ") >>= ((withAttribute " ++ show attr' ++ ") . snd)"+ (cont,_) -> "parseRules " ++ show (synLanguage syntax, cont) "DetectSpaces" -> "pDetectSpaces" "DetectIdentifier" -> "pDetectIdentifier" _ -> "pUnimplemented"
Text/Highlighting/Kate/Syntax.hs view
@@ -90,6 +90,7 @@ import qualified Text.Highlighting.Kate.Syntax.R as R import qualified Text.Highlighting.Kate.Syntax.Relaxngcompact as Relaxngcompact import qualified Text.Highlighting.Kate.Syntax.Rhtml as Rhtml+import qualified Text.Highlighting.Kate.Syntax.Roff as Roff import qualified Text.Highlighting.Kate.Syntax.Ruby as Ruby import qualified Text.Highlighting.Kate.Syntax.Rust as Rust import qualified Text.Highlighting.Kate.Syntax.Scala as Scala@@ -113,11 +114,11 @@ -- | List of supported languages. languages :: [String]-languages = ["Actionscript","Ada","Alert","Alert_indent","Apache","Asn1","Asp","Awk","Bash","Bibtex","Boo","C","Changelog","Clojure","Cmake","Coffee","Coldfusion","Commonlisp","Cpp","Cs","Css","Curry","D","Diff","Djangotemplate","Doxygen","Doxygenlua","Dtd","Eiffel","Email","Erlang","Fortran","Fsharp","Gnuassembler","Go","Haskell","Haxe","Html","Ini","Java","Javadoc","Javascript","Json","Jsp","Julia","Latex","Lex","LiterateCurry","LiterateHaskell","Lua","Makefile","Mandoc","Matlab","Maxima","Metafont","Mips","Modula2","Modula3","Monobasic","Nasm","Noweb","Objectivec","Objectivecpp","Ocaml","Octave","Pascal","Perl","Php","Pike","Postscript","Prolog","Python","R","Relaxngcompact","Rhtml","Ruby","Rust","Scala","Scheme","Sci","Sed","Sgml","Sql","SqlMysql","SqlPostgresql","Tcl","Texinfo","Verilog","Vhdl","Xml","Xorg","Xslt","Xul","Yacc","Yaml"]+languages = ["Actionscript","Ada","Alert","Alert_indent","Apache","Asn1","Asp","Awk","Bash","Bibtex","Boo","C","Changelog","Clojure","Cmake","Coffee","Coldfusion","Commonlisp","Cpp","Cs","Css","Curry","D","Diff","Djangotemplate","Doxygen","Doxygenlua","Dtd","Eiffel","Email","Erlang","Fortran","Fsharp","Gnuassembler","Go","Haskell","Haxe","Html","Ini","Java","Javadoc","Javascript","Json","Jsp","Julia","Latex","Lex","LiterateCurry","LiterateHaskell","Lua","Makefile","Mandoc","Matlab","Maxima","Metafont","Mips","Modula2","Modula3","Monobasic","Nasm","Noweb","Objectivec","Objectivecpp","Ocaml","Octave","Pascal","Perl","Php","Pike","Postscript","Prolog","Python","R","Relaxngcompact","Rhtml","Roff","Ruby","Rust","Scala","Scheme","Sci","Sed","Sgml","Sql","SqlMysql","SqlPostgresql","Tcl","Texinfo","Verilog","Vhdl","Xml","Xorg","Xslt","Xul","Yacc","Yaml"] -- | List of language extensions. languageExtensions :: [(String, String)]-languageExtensions = [("Actionscript", Actionscript.syntaxExtensions), ("Ada", Ada.syntaxExtensions), ("Alert", Alert.syntaxExtensions), ("Alert_indent", Alert_indent.syntaxExtensions), ("Apache", Apache.syntaxExtensions), ("Asn1", Asn1.syntaxExtensions), ("Asp", Asp.syntaxExtensions), ("Awk", Awk.syntaxExtensions), ("Bash", Bash.syntaxExtensions), ("Bibtex", Bibtex.syntaxExtensions), ("Boo", Boo.syntaxExtensions), ("C", C.syntaxExtensions), ("Changelog", Changelog.syntaxExtensions), ("Clojure", Clojure.syntaxExtensions), ("Cmake", Cmake.syntaxExtensions), ("Coffee", Coffee.syntaxExtensions), ("Coldfusion", Coldfusion.syntaxExtensions), ("Commonlisp", Commonlisp.syntaxExtensions), ("Cpp", Cpp.syntaxExtensions), ("Cs", Cs.syntaxExtensions), ("Css", Css.syntaxExtensions), ("Curry", Curry.syntaxExtensions), ("D", D.syntaxExtensions), ("Diff", Diff.syntaxExtensions), ("Djangotemplate", Djangotemplate.syntaxExtensions), ("Doxygen", Doxygen.syntaxExtensions), ("Doxygenlua", Doxygenlua.syntaxExtensions), ("Dtd", Dtd.syntaxExtensions), ("Eiffel", Eiffel.syntaxExtensions), ("Email", Email.syntaxExtensions), ("Erlang", Erlang.syntaxExtensions), ("Fortran", Fortran.syntaxExtensions), ("Fsharp", Fsharp.syntaxExtensions), ("Gnuassembler", Gnuassembler.syntaxExtensions), ("Go", Go.syntaxExtensions), ("Haskell", Haskell.syntaxExtensions), ("Haxe", Haxe.syntaxExtensions), ("Html", Html.syntaxExtensions), ("Ini", Ini.syntaxExtensions), ("Java", Java.syntaxExtensions), ("Javadoc", Javadoc.syntaxExtensions), ("Javascript", Javascript.syntaxExtensions), ("Json", Json.syntaxExtensions), ("Jsp", Jsp.syntaxExtensions), ("Julia", Julia.syntaxExtensions), ("Latex", Latex.syntaxExtensions), ("Lex", Lex.syntaxExtensions), ("LiterateCurry", LiterateCurry.syntaxExtensions), ("LiterateHaskell", LiterateHaskell.syntaxExtensions), ("Lua", Lua.syntaxExtensions), ("Makefile", Makefile.syntaxExtensions), ("Mandoc", Mandoc.syntaxExtensions), ("Matlab", Matlab.syntaxExtensions), ("Maxima", Maxima.syntaxExtensions), ("Metafont", Metafont.syntaxExtensions), ("Mips", Mips.syntaxExtensions), ("Modula2", Modula2.syntaxExtensions), ("Modula3", Modula3.syntaxExtensions), ("Monobasic", Monobasic.syntaxExtensions), ("Nasm", Nasm.syntaxExtensions), ("Noweb", Noweb.syntaxExtensions), ("Objectivec", Objectivec.syntaxExtensions), ("Objectivecpp", Objectivecpp.syntaxExtensions), ("Ocaml", Ocaml.syntaxExtensions), ("Octave", Octave.syntaxExtensions), ("Pascal", Pascal.syntaxExtensions), ("Perl", Perl.syntaxExtensions), ("Php", Php.syntaxExtensions), ("Pike", Pike.syntaxExtensions), ("Postscript", Postscript.syntaxExtensions), ("Prolog", Prolog.syntaxExtensions), ("Python", Python.syntaxExtensions), ("R", R.syntaxExtensions), ("Relaxngcompact", Relaxngcompact.syntaxExtensions), ("Rhtml", Rhtml.syntaxExtensions), ("Ruby", Ruby.syntaxExtensions), ("Rust", Rust.syntaxExtensions), ("Scala", Scala.syntaxExtensions), ("Scheme", Scheme.syntaxExtensions), ("Sci", Sci.syntaxExtensions), ("Sed", Sed.syntaxExtensions), ("Sgml", Sgml.syntaxExtensions), ("Sql", Sql.syntaxExtensions), ("SqlMysql", SqlMysql.syntaxExtensions), ("SqlPostgresql", SqlPostgresql.syntaxExtensions), ("Tcl", Tcl.syntaxExtensions), ("Texinfo", Texinfo.syntaxExtensions), ("Verilog", Verilog.syntaxExtensions), ("Vhdl", Vhdl.syntaxExtensions), ("Xml", Xml.syntaxExtensions), ("Xorg", Xorg.syntaxExtensions), ("Xslt", Xslt.syntaxExtensions), ("Xul", Xul.syntaxExtensions), ("Yacc", Yacc.syntaxExtensions), ("Yaml", Yaml.syntaxExtensions)]+languageExtensions = [("Actionscript", Actionscript.syntaxExtensions), ("Ada", Ada.syntaxExtensions), ("Alert", Alert.syntaxExtensions), ("Alert_indent", Alert_indent.syntaxExtensions), ("Apache", Apache.syntaxExtensions), ("Asn1", Asn1.syntaxExtensions), ("Asp", Asp.syntaxExtensions), ("Awk", Awk.syntaxExtensions), ("Bash", Bash.syntaxExtensions), ("Bibtex", Bibtex.syntaxExtensions), ("Boo", Boo.syntaxExtensions), ("C", C.syntaxExtensions), ("Changelog", Changelog.syntaxExtensions), ("Clojure", Clojure.syntaxExtensions), ("Cmake", Cmake.syntaxExtensions), ("Coffee", Coffee.syntaxExtensions), ("Coldfusion", Coldfusion.syntaxExtensions), ("Commonlisp", Commonlisp.syntaxExtensions), ("Cpp", Cpp.syntaxExtensions), ("Cs", Cs.syntaxExtensions), ("Css", Css.syntaxExtensions), ("Curry", Curry.syntaxExtensions), ("D", D.syntaxExtensions), ("Diff", Diff.syntaxExtensions), ("Djangotemplate", Djangotemplate.syntaxExtensions), ("Doxygen", Doxygen.syntaxExtensions), ("Doxygenlua", Doxygenlua.syntaxExtensions), ("Dtd", Dtd.syntaxExtensions), ("Eiffel", Eiffel.syntaxExtensions), ("Email", Email.syntaxExtensions), ("Erlang", Erlang.syntaxExtensions), ("Fortran", Fortran.syntaxExtensions), ("Fsharp", Fsharp.syntaxExtensions), ("Gnuassembler", Gnuassembler.syntaxExtensions), ("Go", Go.syntaxExtensions), ("Haskell", Haskell.syntaxExtensions), ("Haxe", Haxe.syntaxExtensions), ("Html", Html.syntaxExtensions), ("Ini", Ini.syntaxExtensions), ("Java", Java.syntaxExtensions), ("Javadoc", Javadoc.syntaxExtensions), ("Javascript", Javascript.syntaxExtensions), ("Json", Json.syntaxExtensions), ("Jsp", Jsp.syntaxExtensions), ("Julia", Julia.syntaxExtensions), ("Latex", Latex.syntaxExtensions), ("Lex", Lex.syntaxExtensions), ("LiterateCurry", LiterateCurry.syntaxExtensions), ("LiterateHaskell", LiterateHaskell.syntaxExtensions), ("Lua", Lua.syntaxExtensions), ("Makefile", Makefile.syntaxExtensions), ("Mandoc", Mandoc.syntaxExtensions), ("Matlab", Matlab.syntaxExtensions), ("Maxima", Maxima.syntaxExtensions), ("Metafont", Metafont.syntaxExtensions), ("Mips", Mips.syntaxExtensions), ("Modula2", Modula2.syntaxExtensions), ("Modula3", Modula3.syntaxExtensions), ("Monobasic", Monobasic.syntaxExtensions), ("Nasm", Nasm.syntaxExtensions), ("Noweb", Noweb.syntaxExtensions), ("Objectivec", Objectivec.syntaxExtensions), ("Objectivecpp", Objectivecpp.syntaxExtensions), ("Ocaml", Ocaml.syntaxExtensions), ("Octave", Octave.syntaxExtensions), ("Pascal", Pascal.syntaxExtensions), ("Perl", Perl.syntaxExtensions), ("Php", Php.syntaxExtensions), ("Pike", Pike.syntaxExtensions), ("Postscript", Postscript.syntaxExtensions), ("Prolog", Prolog.syntaxExtensions), ("Python", Python.syntaxExtensions), ("R", R.syntaxExtensions), ("Relaxngcompact", Relaxngcompact.syntaxExtensions), ("Rhtml", Rhtml.syntaxExtensions), ("Roff", Roff.syntaxExtensions), ("Ruby", Ruby.syntaxExtensions), ("Rust", Rust.syntaxExtensions), ("Scala", Scala.syntaxExtensions), ("Scheme", Scheme.syntaxExtensions), ("Sci", Sci.syntaxExtensions), ("Sed", Sed.syntaxExtensions), ("Sgml", Sgml.syntaxExtensions), ("Sql", Sql.syntaxExtensions), ("SqlMysql", SqlMysql.syntaxExtensions), ("SqlPostgresql", SqlPostgresql.syntaxExtensions), ("Tcl", Tcl.syntaxExtensions), ("Texinfo", Texinfo.syntaxExtensions), ("Verilog", Verilog.syntaxExtensions), ("Vhdl", Vhdl.syntaxExtensions), ("Xml", Xml.syntaxExtensions), ("Xorg", Xorg.syntaxExtensions), ("Xslt", Xslt.syntaxExtensions), ("Xul", Xul.syntaxExtensions), ("Yacc", Yacc.syntaxExtensions), ("Yaml", Yaml.syntaxExtensions)] -- | Returns a list of languages appropriate for the given file extension. languagesByExtension :: String -> [String]@@ -133,7 +134,7 @@ -- extension (if unique). -- The parsers read the input lazily and parse line by line; -- results are returned immediately.--- Supported languages: @actionscript@, @ada@, @alert@, @alert_indent@, @apache@, @asn1@, @asp@, @awk@, @bash@, @bibtex@, @boo@, @c@, @changelog@, @clojure@, @cmake@, @coffee@, @coldfusion@, @commonlisp@, @cpp@, @cs@, @css@, @curry@, @d@, @diff@, @djangotemplate@, @doxygen@, @doxygenlua@, @dtd@, @eiffel@, @email@, @erlang@, @fortran@, @fsharp@, @gnuassembler@, @go@, @haskell@, @haxe@, @html@, @ini@, @java@, @javadoc@, @javascript@, @json@, @jsp@, @julia@, @latex@, @lex@, @literatecurry@, @literatehaskell@, @lua@, @makefile@, @mandoc@, @matlab@, @maxima@, @metafont@, @mips@, @modula2@, @modula3@, @monobasic@, @nasm@, @noweb@, @objectivec@, @objectivecpp@, @ocaml@, @octave@, @pascal@, @perl@, @php@, @pike@, @postscript@, @prolog@, @python@, @r@, @relaxngcompact@, @rhtml@, @ruby@, @rust@, @scala@, @scheme@, @sci@, @sed@, @sgml@, @sql@, @sqlmysql@, @sqlpostgresql@, @tcl@, @texinfo@, @verilog@, @vhdl@, @xml@, @xorg@, @xslt@, @xul@, @yacc@, @yaml@.+-- Supported languages: @actionscript@, @ada@, @alert@, @alert_indent@, @apache@, @asn1@, @asp@, @awk@, @bash@, @bibtex@, @boo@, @c@, @changelog@, @clojure@, @cmake@, @coffee@, @coldfusion@, @commonlisp@, @cpp@, @cs@, @css@, @curry@, @d@, @diff@, @djangotemplate@, @doxygen@, @doxygenlua@, @dtd@, @eiffel@, @email@, @erlang@, @fortran@, @fsharp@, @gnuassembler@, @go@, @haskell@, @haxe@, @html@, @ini@, @java@, @javadoc@, @javascript@, @json@, @jsp@, @julia@, @latex@, @lex@, @literatecurry@, @literatehaskell@, @lua@, @makefile@, @mandoc@, @matlab@, @maxima@, @metafont@, @mips@, @modula2@, @modula3@, @monobasic@, @nasm@, @noweb@, @objectivec@, @objectivecpp@, @ocaml@, @octave@, @pascal@, @perl@, @php@, @pike@, @postscript@, @prolog@, @python@, @r@, @relaxngcompact@, @rhtml@, @roff@, @ruby@, @rust@, @scala@, @scheme@, @sci@, @sed@, @sgml@, @sql@, @sqlmysql@, @sqlpostgresql@, @tcl@, @texinfo@, @verilog@, @vhdl@, @xml@, @xorg@, @xslt@, @xul@, @yacc@, @yaml@. highlightAs :: String -- ^ Language syntax (e.g. "haskell") or extension (e.g. "hs"). -> String -- ^ Source code to highlight -> [SourceLine] -- ^ List of highlighted source lines@@ -220,6 +221,7 @@ "r" -> R.highlight "relaxngcompact" -> Relaxngcompact.highlight "rhtml" -> Rhtml.highlight+ "roff" -> Roff.highlight "ruby" -> Ruby.highlight "rust" -> Rust.highlight "scala" -> Scala.highlight
Text/Highlighting/Kate/Syntax/Actionscript.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -79,7 +80,7 @@ regex_'5cs'2a'2e'2a'24 = compileRegex "\\s*.*$" parseRules ("ActionScript 2.0","Normal") =- (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression (Just ("Javadoc","")))) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_properties >>= withAttribute NormalTok)) <|>@@ -177,6 +178,6 @@ <|> (currentContext >>= \x -> guard (x == ("ActionScript 2.0","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression+parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression Nothing parseRules x = parseRules ("ActionScript 2.0","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Ada.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Alert.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Alert_indent.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Apache.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -118,7 +119,7 @@ parseRules ("Apache Configuration","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -146,6 +147,6 @@ parseRules ("Apache Configuration","Alert") = (currentContext >>= \x -> guard (x == ("Apache Configuration","Alert")) >> pDefault >>= withAttribute ErrorTok) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Apache Configuration","apache") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Asn1.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Asp.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Awk.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -97,10 +98,10 @@ (currentContext >>= \x -> guard (x == ("AWK","String")) >> pDefault >>= withAttribute StringTok)) parseRules ("AWK","Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("AWK","Comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("AWK","Base") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Bash.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -227,7 +228,7 @@ (currentContext >>= \x -> guard (x == ("Bash","FindComments")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Bash","Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Bash","Comment")) >> pDefault >>= withAttribute CommentTok)) @@ -241,7 +242,7 @@ 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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Bash","CommentParen")) >> pDefault >>= withAttribute CommentTok)) @@ -255,7 +256,7 @@ 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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Bash","CommentBackq")) >> pDefault >>= withAttribute CommentTok)) @@ -837,6 +838,6 @@ <|> (currentContext >>= \x -> guard (x == ("Bash","HereDocINQ")) >> pDefault >>= withAttribute NormalTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Bash","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Bibtex.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Boo.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/C.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -125,7 +126,7 @@ <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("C","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C","Commentar 1")) <|>@@ -150,14 +151,14 @@ parseRules ("C","Commentar 1") = (((pLineContinue >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("C","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) @@ -181,7 +182,7 @@ <|> ((pRangeDetect '<' '>' >>= withAttribute OtherTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute OtherTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute OtherTok) . snd))) <|> ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("C","Commentar/Preprocessor")) <|>@@ -202,13 +203,13 @@ parseRules ("C","Outscoped") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("C","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C","Commentar 1")) <|>@@ -225,13 +226,13 @@ parseRules ("C","Outscoped intern") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("C","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C","Commentar 1")) <|>@@ -243,7 +244,7 @@ <|> (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+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("C","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Changelog.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Clojure.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Cmake.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -129,7 +130,7 @@ (currentContext >>= \x -> guard (x == ("CMake","Macro Args")) >> pDefault >>= withAttribute NormalTok)) parseRules ("CMake","Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("CMake","Comment")) >> pDefault >>= withAttribute CommentTok)) @@ -142,6 +143,6 @@ <|> (currentContext >>= \x -> guard (x == ("CMake","String")) >> pDefault >>= withAttribute StringTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("CMake","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Coffee.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -152,14 +153,14 @@ (currentContext >>= \x -> guard (x == ("CoffeeScript","Class")) >> pDefault >>= withAttribute NormalTok)) parseRules ("CoffeeScript","Comment") =- (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("CoffeeScript","Multiline Comment")) >> pDefault >>= withAttribute CommentTok)) @@ -203,11 +204,11 @@ parseRules ("CoffeeScript","Javascript") = (((pDetectChar False '`' >>= withAttribute AlertTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression (Just ("JavaScript","")))) <|> (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+parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression Nothing+parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression Nothing parseRules x = parseRules ("CoffeeScript","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Coldfusion.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Commonlisp.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Cpp.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -124,7 +125,7 @@ <|> ((pString False "L" >>= withAttribute DecValTok)))) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C++","Commentar 1")) <|>@@ -155,7 +156,7 @@ <|> ((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -166,7 +167,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -192,7 +193,7 @@ <|> ((pRangeDetect '<' '>' >>= withAttribute OtherTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute OtherTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute OtherTok) . snd))) <|> ((pDetect2Chars False '/' '*' >>= withAttribute CommentTok) >>~ pushContext ("C++","Commentar/Preprocessor")) <|>@@ -217,11 +218,11 @@ parseRules ("C++","Outscoped") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C++","Commentar 1")) <|>@@ -238,13 +239,13 @@ parseRules ("C++","Outscoped intern") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("C++","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C++","Commentar 1")) <|>@@ -256,7 +257,7 @@ <|> (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+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("C++","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Cs.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -104,7 +105,7 @@ <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("C#","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("C#","Commentar 1")) <|>@@ -158,6 +159,6 @@ <|> (currentContext >>= \x -> guard (x == ("C#","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing parseRules x = parseRules ("C#","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Css.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -207,7 +208,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -297,6 +298,6 @@ <|> (currentContext >>= \x -> guard (x == ("CSS","InsideString")) >> pDefault >>= withAttribute StringTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("CSS","Base") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Curry.hs view
@@ -1,5 +1,5 @@ {- This module was generated from data in the Kate syntax- highlighting file curry.xml, version 0.1, by Björn Peemöller (bjp@informatik.uni-kiel.de) -}+ highlighting file curry.xml, version 0.2, by Björn Peemöller (bjp@informatik.uni-kiel.de) -} module Text.Highlighting.Kate.Syntax.Curry (highlight, parseExpression, syntaxName, syntaxExtensions)@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -50,8 +51,14 @@ ("Curry","Currydoc") -> (popContext) >> pEndLine ("Curry","Comment") -> (popContext) >> pEndLine ("Curry","Import") -> (popContext) >> pEndLine- ("Curry","Char") -> (popContext) >> pEndLine- ("Curry","String") -> return ()+ ("Curry","Char") -> pushContext ("Curry","CharSyntaxError") >> return ()+ ("Curry","CharEscape") -> (popContext) >> pEndLine+ ("Curry","CharEnd") -> (popContext) >> pEndLine+ ("Curry","CharSyntaxError") -> return ()+ ("Curry","String") -> pushContext ("Curry","StringSyntaxError") >> return ()+ ("Curry","StringEscape") -> pushContext ("Curry","StringGap") >> return ()+ ("Curry","StringGap") -> return ()+ ("Curry","StringSyntaxError") -> return () ("Curry","Infix") -> return () _ -> return () else return ()@@ -63,7 +70,7 @@ return (attr, txt) list_keywords = Set.fromList $ words $ "case data do else external fcase free if in infix infixl infixr let module of then type where"-list_Prelude_Fun = Set.fromList $ words $ "and all any appendFile best break browse browseList chr concat concatMap const curry div done doSolve drop dropWhile either elem ensureNotFree ensureSpine enumFrom enumFromThen enumFromTo enumFromThenTo error failed filter findall flip foldl foldl1 foldr foldr1 fst getChar getLine id if_then_else iterate head length lines lookup map mapIO mapIO_ max maybe min mod negate not notElem null once or ord otherwise print putChar putStr putStrLn readFile repeat replicate return reverse seq sequenceIO sequenceIO_ show snd solveAll span splitAt success tail take takeWhile try uncurry unknown unlines unpack until unwords unzip unzip3 writeFile words zip zip3 zipWith zipWith3"+list_Prelude_Func = Set.fromList $ words $ "and all any appendFile best break browse browseList chr concat concatMap const curry div done doSolve drop dropWhile either elem ensureNotFree ensureSpine enumFrom enumFromThen enumFromTo enumFromThenTo error failed filter findall flip foldl foldl1 foldr foldr1 fst getChar getLine id if_then_else iterate head length lines lookup map mapIO mapIO_ max maybe min mod negate not notElem null once or ord otherwise print putChar putStr putStrLn readFile repeat replicate return reverse seq sequenceIO sequenceIO_ show snd solveAll span splitAt success tail take takeWhile try uncurry unknown unlines unpack until unwords unzip unzip3 writeFile words zip zip3 zipWith zipWith3" list_Prelude_Type = Set.fromList $ words $ "Bool Char Either Float Int IO Maybe Ordering String Success" list_Prelude_Cons = Set.fromList $ words $ "False True Left Right Just Nothing EQ LT GT" @@ -75,7 +82,14 @@ regex_'28'5bA'2dZ'5d'5ba'2dzA'2dZ0'2d9'5f'27'5d'2a'5c'2e'29'2a'5b'7e'21'40'23'5c'24'25'5c'5e'26'5c'2a'5c'2b'5c'2d'3d'3c'3e'5c'3f'5c'2e'2f'5c'7c'5c'5c'3a'5d'2b = compileRegex "([A-Z][a-zA-Z0-9_']*\\.)*[~!@#\\$%\\^&\\*\\+\\-=<>\\?\\./\\|\\\\:]+" 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_'5cS'2b = compileRegex "\\S+"-regex_'5c'5c'2e = compileRegex "\\\\."+regex_'5b'5e'27'5c'5c'5d = compileRegex "[^'\\\\]"+regex_o'5b0'2d7'5d'2b = compileRegex "o[0-7]+"+regex_'5b0'2d9'5d'2b = compileRegex "[0-9]+"+regex_x'5b0'2d9a'2dfA'2dF'5d'2b = compileRegex "x[0-9a-fA-F]+"+regex_'5c'5e'5bA'2dZ'40'5c'5b'5c'5c'5c'5d'5c'5e'5f'5d = compileRegex "\\^[A-Z@\\[\\\\\\]\\^_]"+regex_NUL'7cSOH'7cSTX'7cETX'7cEOT'7cENQ'7cACK'7cBEL'7cBS'7cHT'7cLF'7cVT'7cFF'7cCR'7cSO'7cSI'7cDLE'7cDC1'7cDC2'7cDC3'7cDC4'7cNAK'7cSYN'7cETB'7cCAN'7cEM'7cSUB'7cESC'7cFS'7cGS'7cRS'7cUS'7cSP'7cDEL = compileRegex "NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL"+regex_'2e = compileRegex "."+regex_'5b'5e'22'5c'5c'5d'2a = compileRegex "[^\"\\\\]*" parseRules ("Curry","Normal") = (((pString False "{-#" >>= withAttribute OtherTok) >>~ pushContext ("Curry","Pragma"))@@ -88,7 +102,7 @@ <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok)) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_Prelude_Fun >>= withAttribute FunctionTok))+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_Prelude_Func >>= withAttribute FunctionTok)) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_Prelude_Type >>= withAttribute DataTypeTok)) <|>@@ -120,6 +134,18 @@ <|> ((pDetectChar False '`' >>= withAttribute OtherTok) >>~ pushContext ("Curry","Infix")) <|>+ ((pDetectChar False '(' >>= withAttribute NormalTok))+ <|>+ ((pDetectChar False ')' >>= withAttribute NormalTok))+ <|>+ ((pDetectChar False '[' >>= withAttribute NormalTok))+ <|>+ ((pDetectChar False ']' >>= withAttribute NormalTok))+ <|>+ ((pDetectChar False '{' >>= withAttribute NormalTok))+ <|>+ ((pDetectChar False '}' >>= withAttribute NormalTok))+ <|> (currentContext >>= \x -> guard (x == ("Curry","Normal")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Curry","Pragma") =@@ -152,18 +178,86 @@ (currentContext >>= \x -> guard (x == ("Curry","Import")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Curry","Char") =- (((pRegExpr regex_'5c'5c'2e >>= withAttribute CharTok))+ (((pDetectChar False '\'' >>= withAttribute ErrorTok) >>~ (popContext)) <|>- ((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext))+ ((pDetectChar False '\\' >>= withAttribute CharTok) >>~ pushContext ("Curry","CharEscape")) <|>+ ((pRegExpr regex_'5b'5e'27'5c'5c'5d >>= withAttribute CharTok) >>~ pushContext ("Curry","CharEnd"))+ <|> (currentContext >>= \x -> guard (x == ("Curry","Char")) >> pDefault >>= withAttribute CharTok)) +parseRules ("Curry","CharEscape") =+ (((pAnyChar "abfnrtv\\\"'" >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_o'5b0'2d7'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5b0'2d9'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_x'5b0'2d9a'2dfA'2dF'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5e'5bA'2dZ'40'5c'5b'5c'5c'5c'5d'5c'5e'5f'5d >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_NUL'7cSOH'7cSTX'7cETX'7cEOT'7cENQ'7cACK'7cBEL'7cBS'7cHT'7cLF'7cVT'7cFF'7cCR'7cSO'7cSI'7cDLE'7cDC1'7cDC2'7cDC3'7cDC4'7cNAK'7cSYN'7cETB'7cCAN'7cEM'7cSUB'7cESC'7cFS'7cGS'7cRS'7cUS'7cSP'7cDEL >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'2e >>= withAttribute ErrorTok) >>~ (popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","CharEscape")) >> pDefault >>= withAttribute CharTok))++parseRules ("Curry","CharEnd") =+ (((pDetectChar False '\'' >>= withAttribute CharTok) >>~ (popContext >> popContext))+ <|>+ ((pRegExpr regex_'2e >>= withAttribute ErrorTok))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","CharEnd")) >> pDefault >>= withAttribute CharTok))++parseRules ("Curry","CharSyntaxError") =+ (((pDetectChar False '\'' >>= withAttribute ErrorTok) >>~ (popContext >> popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","CharSyntaxError")) >> pDefault >>= withAttribute ErrorTok))+ parseRules ("Curry","String") =- (((pRegExpr regex_'5c'5c'2e >>= withAttribute StringTok))+ (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|>- ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))+ ((pDetectChar False '\\' >>= withAttribute CharTok) >>~ pushContext ("Curry","StringEscape")) <|>+ ((pRegExpr regex_'5b'5e'22'5c'5c'5d'2a >>= withAttribute StringTok))+ <|> (currentContext >>= \x -> guard (x == ("Curry","String")) >> pDefault >>= withAttribute StringTok))++parseRules ("Curry","StringEscape") =+ (((pAnyChar "abfnrtv\\\"'&" >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_o'5b0'2d7'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5b0'2d9'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_x'5b0'2d9a'2dfA'2dF'5d'2b >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5e'5bA'2dZ'40'5c'5b'5c'5c'5c'5d'5c'5e'5f'5d >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_NUL'7cSOH'7cSTX'7cETX'7cEOT'7cENQ'7cACK'7cBEL'7cBS'7cHT'7cLF'7cVT'7cFF'7cCR'7cSO'7cSI'7cDLE'7cDC1'7cDC2'7cDC3'7cDC4'7cNAK'7cSYN'7cETB'7cCAN'7cEM'7cSUB'7cESC'7cFS'7cGS'7cRS'7cUS'7cSP'7cDEL >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pDetectSpaces >>= withAttribute CharTok) >>~ pushContext ("Curry","StringGap"))+ <|>+ ((pRegExpr regex_'2e >>= withAttribute ErrorTok) >>~ (popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","StringEscape")) >> pDefault >>= withAttribute StringTok))++parseRules ("Curry","StringGap") =+ (((pDetectSpaces >>= withAttribute CharTok))+ <|>+ ((pDetectChar False '\\' >>= withAttribute CharTok) >>~ (popContext >> popContext >> popContext))+ <|>+ ((pDetectChar False '"' >>= withAttribute ErrorTok) >>~ (popContext >> popContext >> popContext))+ <|>+ ((pRegExpr regex_'2e >>= withAttribute ErrorTok))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","StringGap")) >> pDefault >>= withAttribute StringTok))++parseRules ("Curry","StringSyntaxError") =+ (((pDetectChar False '"' >>= withAttribute ErrorTok) >>~ (popContext >> popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Curry","StringSyntaxError")) >> pDefault >>= withAttribute ErrorTok)) parseRules ("Curry","Infix") = (((pDetectChar False '`' >>= withAttribute OtherTok) >>~ (popContext))
Text/Highlighting/Kate/Syntax/D.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -484,7 +485,7 @@ parseRules ("D","CommentLine") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("D","CommentLine")) >> pDefault >>= withAttribute CommentTok)) @@ -493,7 +494,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("D","CommentBlock")) >> pDefault >>= withAttribute CommentTok)) @@ -504,7 +505,7 @@ <|> ((pDetect2Chars False '+' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("D","CommentNested")) >> pDefault >>= withAttribute CommentTok)) @@ -526,7 +527,7 @@ <|> ((pRegExpr regex_'5b'5cw'5f'5d'2b'3a'28'24'7c'5cs'29 >>= withAttribute KeywordTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("D","DdocLine")) >> pDefault >>= withAttribute CommentTok)) @@ -543,7 +544,7 @@ <|> ((pRegExpr regex_'5b'5cw'5f'5d'2b'3a'28'24'7c'5cs'29 >>= withAttribute KeywordTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pRegExpr regex_'5b'5e'2d'5d'2d'7b3'2c'7d >>= withAttribute CommentTok)) <|>@@ -566,7 +567,7 @@ <|> ((pRegExpr regex_'5b'5cw'5f'5d'2b'3a'28'24'7c'5cs'29 >>= withAttribute KeywordTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pRegExpr regex_'5b'5e'2d'5d'2d'7b3'2c'7d >>= withAttribute CommentTok)) <|>@@ -630,7 +631,7 @@ <|> ((pRegExpr regex_'2d'7b3'2c'7d'28'24'7c'5cs'29 >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.D.parseExpression))+ ((Text.Highlighting.Kate.Syntax.D.parseExpression (Just ("D","")))) <|> (currentContext >>= \x -> guard (x == ("D","DdocBlockCode")) >> pDefault >>= withAttribute NormalTok)) @@ -645,11 +646,11 @@ <|> ((pRegExpr regex_'2d'7b3'2c'7d'28'24'7c'5cs'29 >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.D.parseExpression))+ ((Text.Highlighting.Kate.Syntax.D.parseExpression (Just ("D","")))) <|> (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+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing+parseRules ("D", _) = Text.Highlighting.Kate.Syntax.D.parseExpression Nothing parseRules x = parseRules ("D","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Diff.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Djangotemplate.hs view
@@ -27,12 +27,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -318,7 +319,7 @@ parseRules ("Django HTML Template","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((parseRules ("Django HTML Template","FindTemplate"))) <|>@@ -441,7 +442,7 @@ <|> ((parseRules ("Django HTML Template","FindTemplate"))) <|>- ((Text.Highlighting.Kate.Syntax.Css.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Css.parseExpression (Just ("CSS","")))) <|> (currentContext >>= \x -> guard (x == ("Django HTML Template","CSS content")) >> pDefault >>= withAttribute NormalTok)) @@ -465,7 +466,7 @@ <|> ((parseRules ("Django HTML Template","FindTemplate"))) <|>- ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression (Just ("JavaScript","")))) <|> (currentContext >>= \x -> guard (x == ("Django HTML Template","JS content")) >> pDefault >>= withAttribute NormalTok)) @@ -474,7 +475,7 @@ <|> ((parseRules ("Django HTML Template","FindTemplate"))) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Django HTML Template","JS comment close")) >> pDefault >>= withAttribute CommentTok)) @@ -516,8 +517,8 @@ <|> (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-parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing+parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression Nothing+parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression Nothing parseRules x = parseRules ("Django HTML Template","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Doxygen.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -143,7 +144,7 @@ <|> ((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((parseRules ("Doxygen","SL_DetectEnv"))) <|>@@ -176,7 +177,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '@' '{' >>= withAttribute RegionMarkerTok)) <|>@@ -288,7 +289,7 @@ parseRules ("Doxygen","ML_htmlcomment") = (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -395,7 +396,7 @@ (currentContext >>= \x -> guard (x == ("Doxygen","SL_htmltag")) >> pDefault >>= withAttribute OtherTok)) parseRules ("Doxygen","SL_htmlcomment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -487,6 +488,6 @@ <|> (currentContext >>= \x -> guard (x == ("Doxygen","Dot")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Doxygen","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Doxygenlua.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -104,7 +105,7 @@ parseRules ("DoxygenLua","LineComment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}" list_TagOnly >>= withAttribute KeywordTok)) <|>@@ -133,7 +134,7 @@ <|> ((pRegExprDynamic "\\]%1\\]" >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '@' '{' >>= withAttribute RegionMarkerTok)) <|>@@ -241,7 +242,7 @@ parseRules ("DoxygenLua","ML_htmlcomment") = (((lookAhead (pDetect2Chars False '*' '/') >> (popContext) >> currentContext >>= parseRules)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -348,7 +349,7 @@ (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_htmltag")) >> pDefault >>= withAttribute OtherTok)) parseRules ("DoxygenLua","SL_htmlcomment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -373,6 +374,6 @@ <|> (currentContext >>= \x -> guard (x == ("DoxygenLua","SL_types2")) >> pDefault >>= withAttribute DataTypeTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("DoxygenLua","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Dtd.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -93,7 +94,7 @@ <|> ((pString False "-->" >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -145,12 +146,12 @@ <|> ((pDetect2Chars False '-' '-' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("DTD","InlineComment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("DTD","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Eiffel.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Email.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Erlang.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -134,12 +135,12 @@ parseRules ("Erlang","comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("Erlang","comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Erlang","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Fortran.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Fsharp.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Gnuassembler.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -113,14 +114,14 @@ (currentContext >>= \x -> guard (x == ("GNU Assembler","Normal")) >> pDefault >>= withAttribute NormalTok)) parseRules ("GNU Assembler","Commentar 1") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|> (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)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("GNU Assembler","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) @@ -144,6 +145,6 @@ parseRules ("GNU Assembler","Some Context") = (currentContext >>= \x -> guard (x == ("GNU Assembler","Some Context")) >> pDefault >>= withAttribute NormalTok) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("GNU Assembler","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Go.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -101,7 +102,7 @@ <|> ((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -112,7 +113,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -136,6 +137,6 @@ <|> (currentContext >>= \x -> guard (x == ("Go","Multiline String")) >> pDefault >>= withAttribute StringTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Go","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Haskell.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -92,15 +93,15 @@ <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok)) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_function >>= withAttribute FunctionTok))+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_function >>= withAttribute NormalTok)) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_type >>= withAttribute DataTypeTok)) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_data >>= withAttribute KeywordTok))+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_data >>= withAttribute DataTypeTok)) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_class >>= withAttribute KeywordTok))+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_prelude_class >>= withAttribute DataTypeTok)) <|>- ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_class >>= withAttribute KeywordTok))+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_class >>= withAttribute DataTypeTok)) <|> ((pRegExpr regex_'28'3a'3a'7c'3d'3e'7c'5c'2d'3e'7c'3c'5c'2d'29 >>= withAttribute OtherTok)) <|>
Text/Highlighting/Kate/Syntax/Haxe.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Html.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -203,7 +204,7 @@ parseRules ("HTML","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -318,7 +319,7 @@ parseRules ("HTML","CSS content") = (((pRegExpr regex_'3c'2fstyle'5cb >>= withAttribute KeywordTok) >>~ pushContext ("HTML","El Close 2")) <|>- ((Text.Highlighting.Kate.Syntax.Css.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Css.parseExpression (Just ("CSS","")))) <|> (currentContext >>= \x -> guard (x == ("HTML","CSS content")) >> pDefault >>= withAttribute NormalTok)) @@ -338,14 +339,14 @@ <|> ((pRegExpr regex_'2f'2f'28'3f'3d'2e'2a'3c'2fscript'5cb'29 >>= withAttribute CommentTok) >>~ pushContext ("HTML","JS comment close")) <|>- ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression (Just ("JavaScript","")))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("HTML","JS comment close")) >> pDefault >>= withAttribute CommentTok)) @@ -381,8 +382,8 @@ <|> (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-parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing+parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression Nothing+parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression Nothing parseRules x = parseRules ("HTML","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Ini.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -89,12 +90,12 @@ parseRules ("INI Files","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("INI Files","Comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("INI Files","ini") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Java.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -87,7 +88,7 @@ regex_'5cs'2a'2e'2a'3b = compileRegex "\\s*.*;" parseRules ("Java","Normal") =- (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression (Just ("Javadoc","")))) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok)) <|>@@ -211,6 +212,6 @@ <|> (currentContext >>= \x -> guard (x == ("Java","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression+parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression Nothing parseRules x = parseRules ("Java","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Javadoc.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -119,7 +120,7 @@ <|> ((pString False "{@value " >>= withAttribute KeywordTok) >>~ pushContext ("Javadoc","InlineTagar")) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Javadoc","JavadocFSar")) >> pDefault >>= withAttribute CommentTok)) @@ -202,7 +203,7 @@ <|> ((pString False "{@value " >>= withAttribute KeywordTok) >>~ pushContext ("Javadoc","InlineTagar")) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Javadoc","Javadocar")) >> pDefault >>= withAttribute CommentTok)) @@ -220,7 +221,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext >> popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute KeywordTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")) >>= ((withAttribute KeywordTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Javadoc","InlineTagar")) >> pDefault >>= withAttribute KeywordTok)) @@ -234,10 +235,10 @@ parseRules ("Javadoc","SeeTag") = (((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext >> popContext >> popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression >>= ((withAttribute KeywordTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")) >>= ((withAttribute KeywordTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Javadoc","SeeTag")) >> pDefault >>= withAttribute KeywordTok)) -parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression+parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression Nothing parseRules x = parseRules ("Javadoc","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Javascript.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -120,7 +121,7 @@ <|> ((pDetectChar False '\'' >>= withAttribute StringTok) >>~ pushContext ("JavaScript","String SQ")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("JavaScript","Comment")) <|>@@ -195,12 +196,12 @@ (currentContext >>= \x -> guard (x == ("JavaScript","String SQ")) >> pDefault >>= withAttribute StringTok)) parseRules ("JavaScript","Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("JavaScript","Comment")) >> pDefault >>= withAttribute CommentTok)) parseRules ("JavaScript","Multi/inline Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -251,7 +252,7 @@ <|> (currentContext >>= \x -> guard (x == ("JavaScript","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok)) -parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression-parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("JavaScript","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Json.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Jsp.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Julia.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Latex.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -620,7 +621,7 @@ parseRules ("LaTeX","HighlightningC++") = (((parseRules ("LaTeX","HighlightningCommon"))) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("LaTeX","HighlightningC++")) >> pDefault >>= withAttribute NormalTok)) @@ -632,7 +633,7 @@ parseRules ("LaTeX","HighlightningPython") = (((parseRules ("LaTeX","HighlightningCommon"))) <|>- ((Text.Highlighting.Kate.Syntax.Python.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Python.parseExpression (Just ("Python","")))) <|> (currentContext >>= \x -> guard (x == ("LaTeX","HighlightningPython")) >> pDefault >>= withAttribute NormalTok)) @@ -913,7 +914,7 @@ <|> (currentContext >>= \x -> guard (x == ("LaTeX","Comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression-parseRules ("Python", _) = Text.Highlighting.Kate.Syntax.Python.parseExpression+parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression Nothing+parseRules ("Python", _) = Text.Highlighting.Kate.Syntax.Python.parseExpression Nothing parseRules x = parseRules ("LaTeX","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Lex.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -113,7 +114,7 @@ (pushContext ("Lex/Flex","Rule RegExpr") >> currentContext >>= parseRules)) parseRules ("Lex/Flex","User Code") =- (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Lex/Flex","User Code")) >> pDefault >>= withAttribute NormalTok)) @@ -216,21 +217,21 @@ (currentContext >>= \x -> guard (x == ("Lex/Flex","Detect C")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Lex/Flex","Indented C") =- (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (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))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (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))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Lex/Flex","Lex Rule C Bloc")) >> pDefault >>= withAttribute NormalTok)) @@ -239,7 +240,7 @@ <|> ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Lex/Flex","Normal C Bloc")) >> pDefault >>= withAttribute NormalTok)) @@ -248,10 +249,10 @@ <|> ((pDetectChar False '}' >>= withAttribute AlertTok)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Lex/Flex","Action C")) >> pDefault >>= withAttribute NormalTok)) -parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression+parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression Nothing parseRules x = parseRules ("Lex/Flex","Pre Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/LiterateCurry.hs view
@@ -1,5 +1,5 @@ {- This module was generated from data in the Kate syntax- highlighting file literate-curry.xml, version 0.1, by Björn Peemöller (bjp@informatik.uni-kiel.de) -}+ highlighting file literate-curry.xml, version 0.2, by Björn Peemöller (bjp@informatik.uni-kiel.de) -} module Text.Highlighting.Kate.Syntax.LiterateCurry (highlight, parseExpression, syntaxName, syntaxExtensions)@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -76,7 +77,7 @@ parseRules ("Literate Curry","Code") = (((pRegExpr regex_'5c'7b'2d'5b'5e'23'5d >>= withAttribute CommentTok) >>~ pushContext ("Literate Curry","multiline")) <|>- ((Text.Highlighting.Kate.Syntax.Curry.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Curry.parseExpression (Just ("Curry","")))) <|> (currentContext >>= \x -> guard (x == ("Literate Curry","Code")) >> pDefault >>= withAttribute NormalTok)) @@ -85,7 +86,7 @@ <|> ((pString False "\\end{spec}" >>= withAttribute NormalTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Curry.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Curry.parseExpression (Just ("Curry","")))) <|> (currentContext >>= \x -> guard (x == ("Literate Curry","normals")) >> pDefault >>= withAttribute NormalTok)) @@ -106,6 +107,6 @@ <|> (currentContext >>= \x -> guard (x == ("Literate Curry","restart")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Curry", _) = Text.Highlighting.Kate.Syntax.Curry.parseExpression+parseRules ("Curry", _) = Text.Highlighting.Kate.Syntax.Curry.parseExpression Nothing parseRules x = parseRules ("Literate Curry","Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/LiterateHaskell.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -76,7 +77,7 @@ 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))+ ((Text.Highlighting.Kate.Syntax.Haskell.parseExpression (Just ("Haskell","")))) <|> (currentContext >>= \x -> guard (x == ("Literate Haskell","normal")) >> pDefault >>= withAttribute NormalTok)) @@ -85,7 +86,7 @@ <|> ((pString False "\\end{spec}" >>= withAttribute NormalTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Haskell.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Haskell.parseExpression (Just ("Haskell","")))) <|> (currentContext >>= \x -> guard (x == ("Literate Haskell","normals")) >> pDefault >>= withAttribute NormalTok)) @@ -106,6 +107,6 @@ <|> (currentContext >>= \x -> guard (x == ("Literate Haskell","recomments")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Haskell", _) = Text.Highlighting.Kate.Syntax.Haskell.parseExpression+parseRules ("Haskell", _) = Text.Highlighting.Kate.Syntax.Haskell.parseExpression Nothing parseRules x = parseRules ("Literate Haskell","text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Lua.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -83,7 +84,7 @@ regex_'5c'5c'5babfnrtv'27'22'5c'5c'5c'5b'5c'5d'5d = compileRegex "\\\\[abfnrtv'\"\\\\\\[\\]]" parseRules ("Lua","Normal") =- (((Text.Highlighting.Kate.Syntax.Doxygenlua.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Doxygenlua.parseExpression (Just ("DoxygenLua","")))) <|> ((pKeyword " \n\t():!+,-<=>%&*/;?[]^{|}~\\\"" list_deprecated >>= withAttribute ErrorTok)) <|>@@ -187,6 +188,6 @@ parseRules ("Lua","Error") = (currentContext >>= \x -> guard (x == ("Lua","Error")) >> pDefault >>= withAttribute ErrorTok) -parseRules ("DoxygenLua", _) = Text.Highlighting.Kate.Syntax.Doxygenlua.parseExpression+parseRules ("DoxygenLua", _) = Text.Highlighting.Kate.Syntax.Doxygenlua.parseExpression Nothing parseRules x = parseRules ("Lua","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Makefile.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Mandoc.hs view
@@ -6,6 +6,7 @@ where import Text.Highlighting.Kate.Types import Text.Highlighting.Kate.Common+import qualified Text.Highlighting.Kate.Syntax.Roff import Text.ParserCombinators.Parsec hiding (State) import Control.Monad.State import Data.Char (isSpace)@@ -24,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -63,11 +65,11 @@ parseRules ("Troff Mandoc","Normal") =- (((parseRules ("Troff Mandoc","DetectComments##Roff")))+ (((Text.Highlighting.Kate.Syntax.Roff.parseExpression (Just ("Roff","DetectComments")))) <|> ((pColumn 0 >> pDetectChar False '.' >>= withAttribute FunctionTok) >>~ pushContext ("Troff Mandoc","DetectDirective")) <|>- ((parseRules ("Troff Mandoc","DetectOthers##Roff")))+ ((Text.Highlighting.Kate.Syntax.Roff.parseExpression (Just ("Roff","DetectOthers")))) <|> (currentContext >>= \x -> guard (x == ("Troff Mandoc","Normal")) >> pDefault >>= withAttribute NormalTok)) @@ -80,14 +82,15 @@ <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_others >>= withAttribute FunctionTok) >>~ pushContext ("Troff Mandoc","Directive")) <|>- ((parseRules ("Troff Mandoc","DetectDirective##Roff")))+ ((Text.Highlighting.Kate.Syntax.Roff.parseExpression (Just ("Roff","DetectDirective")) >>= ((withAttribute FunctionTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Troff Mandoc","DetectDirective")) >> pDefault >>= withAttribute FunctionTok)) parseRules ("Troff Mandoc","Directive") =- (((parseRules ("Troff Mandoc","Directive##Roff")))+ (((Text.Highlighting.Kate.Syntax.Roff.parseExpression (Just ("Roff","Directive")) >>= ((withAttribute StringTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Troff Mandoc","Directive")) >> pDefault >>= withAttribute StringTok)) +parseRules ("Roff", _) = Text.Highlighting.Kate.Syntax.Roff.parseExpression Nothing parseRules x = parseRules ("Troff Mandoc","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Matlab.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Maxima.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Metafont.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Mips.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Modula2.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Modula3.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Monobasic.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Nasm.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Noweb.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -73,7 +74,7 @@ <|> ((pDetect2Chars False '[' '[' >>= withAttribute RegionMarkerTok) >>~ pushContext ("noweb","CodeQuote")) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")))) <|> (currentContext >>= \x -> guard (x == ("noweb","RawDocumentation")) >> pDefault >>= withAttribute NormalTok)) @@ -84,7 +85,7 @@ <|> ((parseRules ("noweb","SectionNames"))) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("noweb","CodeQuote")) >> pDefault >>= withAttribute NormalTok)) @@ -97,7 +98,7 @@ <|> ((parseRules ("noweb","SectionNames"))) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("noweb","CodeSection")) >> pDefault >>= withAttribute NormalTok)) @@ -108,7 +109,7 @@ <|> (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+parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression Nothing+parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression Nothing parseRules x = parseRules ("noweb","RawDocumentation") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Objectivec.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -136,7 +137,7 @@ <|> ((pRangeDetect '<' '>' >>= withAttribute OtherTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute OtherTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute OtherTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C","SingleLineComment")) <|>@@ -149,6 +150,6 @@ <|> (currentContext >>= \x -> guard (x == ("Objective-C","MultiLineCommentPrep")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing parseRules x = parseRules ("Objective-C","Default") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Objectivecpp.hs view
@@ -26,12 +26,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -137,7 +138,7 @@ <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_extensions >>= withAttribute KeywordTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","Commentar 1")) <|>@@ -175,7 +176,7 @@ <|> ((pRangeDetect '<' '>' >>= withAttribute OtherTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute OtherTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute OtherTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","SingleLineComment")) <|>@@ -198,7 +199,7 @@ parseRules ("Objective-C++","Commentar 1") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -209,7 +210,7 @@ <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -226,7 +227,7 @@ <|> ((pRangeDetect '<' '>' >>= withAttribute OtherTok)) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute OtherTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute OtherTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","Commentar 1")) <|>@@ -242,13 +243,13 @@ parseRules ("Objective-C++","Outscoped") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Objective-C++","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","Commentar 1")) <|>@@ -263,13 +264,13 @@ parseRules ("Objective-C++","Outscoped intern") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Objective-C++","String")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("Objective-C++","Commentar 1")) <|>@@ -281,7 +282,7 @@ <|> (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+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Objective-C++","Default") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Ocaml.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Octave.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Pascal.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Perl.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -945,12 +946,12 @@ parseRules ("Perl","comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("Perl","comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Perl","normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Php.hs view
@@ -30,12 +30,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -127,7 +128,7 @@ <|> ((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("PHP/PHP","onelinecomment")) <|>- ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Doxygen.parseExpression (Just ("Doxygen","")))) <|> ((pDetect2Chars False '/' '/' >>= withAttribute CommentTok) >>~ pushContext ("PHP/PHP","onelinecomment")) <|>@@ -210,14 +211,14 @@ parseRules ("PHP/PHP","onelinecomment") = (((lookAhead (pString False "?>") >> (popContext) >> currentContext >>= parseRules)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("PHP/PHP","twolinecomment")) >> pDefault >>= withAttribute CommentTok)) @@ -280,7 +281,7 @@ <|> ((parseRules ("PHP/PHP","commonheredoc"))) <|>- ((Text.Highlighting.Kate.Syntax.Html.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Html.parseExpression (Just ("HTML","")))) <|> (currentContext >>= \x -> guard (x == ("PHP/PHP","htmlheredoc")) >> pDefault >>= withAttribute NormalTok)) @@ -289,7 +290,7 @@ <|> ((parseRules ("PHP/PHP","commonheredoc"))) <|>- ((Text.Highlighting.Kate.Syntax.Css.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Css.parseExpression (Just ("CSS","")))) <|> (currentContext >>= \x -> guard (x == ("PHP/PHP","cssheredoc")) >> pDefault >>= withAttribute NormalTok)) @@ -298,7 +299,7 @@ <|> ((parseRules ("PHP/PHP","commonheredoc"))) <|>- ((Text.Highlighting.Kate.Syntax.SqlMysql.parseExpression))+ ((Text.Highlighting.Kate.Syntax.SqlMysql.parseExpression (Just ("SQL (MySQL)","")))) <|> (currentContext >>= \x -> guard (x == ("PHP/PHP","mysqlheredoc")) >> pDefault >>= withAttribute NormalTok)) @@ -307,7 +308,7 @@ <|> ((parseRules ("PHP/PHP","commonheredoc"))) <|>- ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression (Just ("JavaScript","")))) <|> (currentContext >>= \x -> guard (x == ("PHP/PHP","javascriptheredoc")) >> pDefault >>= withAttribute NormalTok)) @@ -327,11 +328,11 @@ <|> (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-parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression-parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression-parseRules ("SQL (MySQL)", _) = Text.Highlighting.Kate.Syntax.SqlMysql.parseExpression-parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression+parseRules ("Doxygen", _) = Text.Highlighting.Kate.Syntax.Doxygen.parseExpression Nothing+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing+parseRules ("HTML", _) = Text.Highlighting.Kate.Syntax.Html.parseExpression Nothing+parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression Nothing+parseRules ("SQL (MySQL)", _) = Text.Highlighting.Kate.Syntax.SqlMysql.parseExpression Nothing+parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression Nothing parseRules x = parseRules ("PHP/PHP","start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Pike.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Postscript.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Prolog.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -481,7 +482,7 @@ <|> ((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -490,7 +491,7 @@ parseRules ("Prolog","1-comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -669,6 +670,6 @@ <|> (currentContext >>= \x -> guard (x == ("Prolog","operator")) >> pDefault >>= withAttribute ErrorTok)) -parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression+parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression Nothing parseRules x = parseRules ("Prolog","shebang") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Python.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -189,14 +190,14 @@ (currentContext >>= \x -> guard (x == ("Python","parenthesised")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Python","Hash comment") =- (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Python","Tripple A-comment")) >> pDefault >>= withAttribute CommentTok)) @@ -205,7 +206,7 @@ <|> ((pString False "\"\"\"" >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Python","Tripple Q-comment")) >> pDefault >>= withAttribute CommentTok)) @@ -214,7 +215,7 @@ <|> ((pDetectChar False '\'' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Python","Single A-comment")) >> pDefault >>= withAttribute CommentTok)) @@ -223,7 +224,7 @@ <|> ((pDetectChar False '"' >>= withAttribute CommentTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression (Just ("Alerts_indent","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Python","Single Q-comment")) >> pDefault >>= withAttribute CommentTok)) @@ -304,6 +305,6 @@ <|> (currentContext >>= \x -> guard (x == ("Python","Raw Q-string")) >> pDefault >>= withAttribute StringTok)) -parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression+parseRules ("Alerts_indent", _) = Text.Highlighting.Kate.Syntax.Alert_indent.parseExpression Nothing parseRules x = parseRules ("Python","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/R.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Relaxngcompact.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Rhtml.hs view
@@ -27,12 +27,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -363,7 +364,7 @@ parseRules ("Ruby/Rails/RHTML","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -494,7 +495,7 @@ <|> ((pRegExpr regex_'3c'2fstyle'5cb >>= withAttribute KeywordTok) >>~ pushContext ("Ruby/Rails/RHTML","El Close 2")) <|>- ((Text.Highlighting.Kate.Syntax.Css.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Css.parseExpression (Just ("CSS","")))) <|> (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","CSS content")) >> pDefault >>= withAttribute NormalTok)) @@ -518,14 +519,14 @@ <|> ((pRegExpr regex_'2f'2f'28'3f'3d'2e'2a'3c'2fscript'5cb'29 >>= withAttribute CommentTok) >>~ pushContext ("Ruby/Rails/RHTML","JS comment close")) <|>- ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Javascript.parseExpression (Just ("JavaScript","")))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Ruby/Rails/RHTML","JS comment close")) >> pDefault >>= withAttribute CommentTok)) @@ -1420,8 +1421,8 @@ parseRules ("Ruby/Rails/RHTML","DATA") = (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-parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing+parseRules ("CSS", _) = Text.Highlighting.Kate.Syntax.Css.parseExpression Nothing+parseRules ("JavaScript", _) = Text.Highlighting.Kate.Syntax.Javascript.parseExpression Nothing parseRules x = parseRules ("Ruby/Rails/RHTML","Start") <|> fail ("Unknown context" ++ show x)
+ Text/Highlighting/Kate/Syntax/Roff.hs view
@@ -0,0 +1,304 @@+{- This module was generated from data in the Kate syntax+ highlighting file roff.xml, version 0.11, by Matthew Woehlke (mw_triad@users.sourceforge.net) -}++module Text.Highlighting.Kate.Syntax.Roff+ (highlight, parseExpression, syntaxName, syntaxExtensions)+where+import Text.Highlighting.Kate.Types+import Text.Highlighting.Kate.Common+import qualified Text.Highlighting.Kate.Syntax.Alert+import Text.ParserCombinators.Parsec hiding (State)+import Control.Monad.State+import Data.Char (isSpace)+import qualified Data.Set as Set++-- | Full name of language.+syntaxName :: String+syntaxName = "Roff"++-- | Filename extensions for this language.+syntaxExtensions :: String+syntaxExtensions = ""++-- | Highlight source code using this syntax definition.+highlight :: String -> [SourceLine]+highlight input = evalState (mapM parseSourceLine $ lines input) startingState++parseSourceLine :: String -> State SyntaxState SourceLine+parseSourceLine = mkParseSourceLine (parseExpression Nothing)++-- | Parse an expression using appropriate local context.+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext+ result <- parseRules (lang,cont)+ optional $ do eof+ updateState $ \st -> st{ synStPrevChar = '\n' }+ pEndLine+ return result++startingState = SyntaxState {synStContexts = [("Roff","Normal")], synStLineNumber = 0, synStPrevChar = '\n', synStPrevNonspace = False, synStCaseSensitive = True, synStKeywordCaseSensitive = True, synStCaptures = []}++pEndLine = do+ updateState $ \st -> st{ synStPrevNonspace = False }+ context <- currentContext+ contexts <- synStContexts `fmap` getState+ if length contexts >= 2+ then case context of+ ("Roff","Normal") -> return ()+ ("Roff","DetectComments") -> return ()+ ("Roff","DetectOthers") -> return ()+ ("Roff","DetectEscape") -> (popContext) >> pEndLine+ ("Roff","DetectDirective") -> (popContext) >> pEndLine+ ("Roff","Comment") -> (popContext) >> pEndLine+ ("Roff","Error") -> return ()+ ("Roff","Directive") -> (popContext) >> pEndLine+ ("Roff","String") -> (popContext) >> pEndLine+ ("Roff","LiteralSL") -> (popContext) >> pEndLine+ ("Roff","LiteralIL") -> pushContext ("Roff","Error") >> return ()+ ("Roff","Argument") -> pushContext ("Roff","Error") >> return ()+ ("Roff","GlyphArgument") -> pushContext ("Roff","Error") >> return ()+ ("Roff","Measurement") -> pushContext ("Roff","Error") >> return ()+ ("Roff","deDirective") -> pushContext ("Roff","deBody") >> return ()+ ("Roff","deBody") -> return ()+ ("Roff","diDirective") -> pushContext ("Roff","diBody") >> return ()+ ("Roff","diBody") -> return ()+ ("Roff","daDirective") -> pushContext ("Roff","daBody") >> return ()+ ("Roff","daBody") -> return ()+ ("Roff","dsDirective") -> (popContext) >> pEndLine+ ("Roff","dsString") -> (popContext) >> pEndLine+ _ -> return ()+ else return ()++withAttribute attr txt = do+ when (null txt) $ fail "Parser matched no text"+ updateState $ \st -> st { synStPrevChar = last txt+ , synStPrevNonspace = synStPrevNonspace st || not (all isSpace txt) }+ return (attr, txt)++list_layout = Set.fromList $ words $ "br sp"+list_formatting = Set.fromList $ words $ ""+list_gnuext = Set.fromList $ words $ ""++regex_'5c'2e'5cs'2a'5c'5c'22 = compileRegex "\\.\\s*\\\\\""+regex_'5c'5c'28'5c'2a'7cn'5b'2b'2d'5d'3f'29'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 = compileRegex "\\\\(\\*|n[+-]?)([^]\\s]|\\([^]\\s]{2}|\\[[^]\\s]+\\])"+regex_'5c'5c'5bfF'5d'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 = compileRegex "\\\\[fF]([^]\\s]|\\([^]\\s]{2}|\\[[^]\\s]+\\])"+regex_'5c'5cf'28'5b0'2d9'5d'7c'5c'28'5b0'2d9'5d'5b0'2d9'5d'7c'5c'5b'5b0'2d9'5d'2b'5c'5d'29 = compileRegex "\\\\f([0-9]|\\([0-9][0-9]|\\[[0-9]+\\])"+regex_'5c'5cs'28'5c'5b'28'5b1'2d3'5d'5b0'2d9'5d'7c'5b04'2d9'5d'29'5c'5d'7c'5b04'2d9'5d'7c'5b'2b'2d'5d'5b0'2d9'5d'7c'28'5b'2b'2d'5d'3f'5c'28'7c'5c'28'5b'2b'2d'5d'29'5b0'2d9'5d'5b0'2d9'5d'29 = compileRegex "\\\\s(\\[([1-3][0-9]|[04-9])\\]|[04-9]|[+-][0-9]|([+-]?\\(|\\([+-])[0-9][0-9])"+regex_'5c'5c'28'5c'24'5b0'2d9'2a'40'5d'7c'5b'2e'3a'25_'7c'5e'7b'7d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 = compileRegex "\\\\(\\$[0-9*@]|[.:% |^{}_!?@)/,&:~0acdeEprtu])"+regex_'5c'5c'5bAbBDowXZ'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 = compileRegex "\\\\[AbBDowXZ]([^\\\\]|\\\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])"+regex_'5c'5c'5bgkmMVYz'5d'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 = compileRegex "\\\\[gkmMVYz]([^]\\s]|\\([^]\\s]{2}|\\[[^]\\s]+\\])"+regex_'5c'5cO'28'5b0'2d4'5d'7c'5c'5b5'5blrci'5d'5b'5e'5d'5d'5c'5d'29 = compileRegex "\\\\O([0-4]|\\[5[lrci][^]]\\])"+regex_'5c'5c'5bhHSvx'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 = compileRegex "\\\\[hHSvx]([^\\\\]|\\\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])"+regex_'5c'5c'5blL'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29'7c'3f = compileRegex "\\\\[lL]([^\\\\]|\\\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])|?"+regex_'5c'5cR'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 = compileRegex "\\\\R([^\\\\]|\\\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])"+regex_'5c'5cC'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 = compileRegex "\\\\C([^\\\\]|\\\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])"+regex_'5c'5cN'28'5b'5e'5c'5c0'2d9'5d'7c'5c'5c'5b'25'3a'7b'7d'27'60'2d'5f'21'40'2fcep'5d'29'5b0'2d9'5d'2b'5c1 = compileRegex "\\\\N([^\\\\0-9]|\\\\[%:{}'`-_!@/cep])[0-9]+\\1"+regex_'5c'5c'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 = compileRegex "\\\\([^]\\s]|\\([^]\\s]{2}|\\[[^]\\s]+\\])"+regex_'5c'5c'24 = compileRegex "\\\\$"+regex_'5cs'2ads'5cb = compileRegex "\\s*ds\\b"+regex_'5cs'2ade'5cb = compileRegex "\\s*de\\b"+regex_'5cs'2ada'28'3f'3d'5cs'2b'5bA'2dZa'2dz'5d'2b'29 = compileRegex "\\s*da(?=\\s+[A-Za-z]+)"+regex_'5cs'2adi'28'3f'3d'5cs'2b'5bA'2dZa'2dz'5d'2b'29 = compileRegex "\\s*di(?=\\s+[A-Za-z]+)"+regex_'5cs'2a'5bA'2dZa'2dz'5d'2b'5cb = compileRegex "\\s*[A-Za-z]+\\b"+regex_'5c'2e'5cs'2adi'5cb = compileRegex "\\.\\s*di\\b"+regex_'5c'2e'5cs'2ada'5cb = compileRegex "\\.\\s*da\\b"++parseRules ("Roff","Normal") =+ (((parseRules ("Roff","DetectComments")))+ <|>+ ((pColumn 0 >> pDetectChar False '.' >>= withAttribute FunctionTok) >>~ pushContext ("Roff","DetectDirective"))+ <|>+ ((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","Normal")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","DetectComments") =+ (((pColumn 0 >> pRegExpr regex_'5c'2e'5cs'2a'5c'5c'22 >>= withAttribute CommentTok) >>~ pushContext ("Roff","Comment"))+ <|>+ ((pDetect2Chars False '\\' '"' >>= withAttribute CommentTok) >>~ pushContext ("Roff","Comment"))+ <|>+ ((pDetect2Chars False '\\' '#' >>= withAttribute CommentTok) >>~ pushContext ("Roff","Comment"))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","DetectComments")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","DetectOthers") =+ (((parseRules ("Roff","DetectComments")))+ <|>+ ((lookAhead (pDetectChar False '\\') >> pushContext ("Roff","DetectEscape") >> currentContext >>= parseRules))+ <|>+ ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Roff","String"))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","DetectOthers")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","DetectEscape") =+ (((pRegExpr regex_'5c'5c'28'5c'2a'7cn'5b'2b'2d'5d'3f'29'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'5bfF'5d'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5cf'28'5b0'2d9'5d'7c'5c'28'5b0'2d9'5d'5b0'2d9'5d'7c'5c'5b'5b0'2d9'5d'2b'5c'5d'29 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5cs'28'5c'5b'28'5b1'2d3'5d'5b0'2d9'5d'7c'5b04'2d9'5d'29'5c'5d'7c'5b04'2d9'5d'7c'5b'2b'2d'5d'5b0'2d9'5d'7c'28'5b'2b'2d'5d'3f'5c'28'7c'5c'28'5b'2b'2d'5d'29'5b0'2d9'5d'5b0'2d9'5d'29 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pDetect2Chars False '\\' '\\' >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'28'5c'24'5b0'2d9'2a'40'5d'7c'5b'2e'3a'25_'7c'5e'7b'7d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'5bAbBDowXZ'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 >>= withAttribute CharTok) >>~ pushContext ("Roff","Argument"))+ <|>+ ((pRegExpr regex_'5c'5c'5bgkmMVYz'5d'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5cO'28'5b0'2d4'5d'7c'5c'5b5'5blrci'5d'5b'5e'5d'5d'5c'5d'29 >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'5bhHSvx'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 >>= withAttribute CharTok) >>~ pushContext ("Roff","Measurement"))+ <|>+ ((pRegExpr regex_'5c'5c'5blL'5d'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29'7c'3f >>= withAttribute CharTok) >>~ pushContext ("Roff","Measurement"))+ <|>+ ((pRegExpr regex_'5c'5cR'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 >>= withAttribute CharTok) >>~ pushContext ("Roff","Argument"))+ <|>+ ((pRegExpr regex_'5c'5cC'28'5b'5e'5c'5c'5d'7c'5c'5c'5b'25_'7c'5e'7b'7d'27'60'2d'5f'21'3f'40'29'2f'2c'26'3a'7e0acdeEprtu'5d'29 >>= withAttribute OtherTok) >>~ pushContext ("Roff","GlyphArgument"))+ <|>+ ((pRegExpr regex_'5c'5cN'28'5b'5e'5c'5c0'2d9'5d'7c'5c'5c'5b'25'3a'7b'7d'27'60'2d'5f'21'40'2fcep'5d'29'5b0'2d9'5d'2b'5c1 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'28'5b'5e'5d'5cs'5d'7c'5c'28'5b'5e'5d'5cs'5d'7b2'7d'7c'5c'5b'5b'5e'5d'5cs'5d'2b'5c'5d'29 >>= withAttribute OtherTok) >>~ (popContext))+ <|>+ ((pRegExpr regex_'5c'5c'24 >>= withAttribute CharTok) >>~ (popContext))+ <|>+ ((pDetectChar False '\\' >>= withAttribute ErrorTok) >>~ (popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","DetectEscape")) >> pDefault >>= withAttribute ErrorTok))++parseRules ("Roff","DetectDirective") =+ (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_layout >>= withAttribute KeywordTok) >>~ pushContext ("Roff","Directive"))+ <|>+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_formatting >>= withAttribute KeywordTok) >>~ pushContext ("Roff","Directive"))+ <|>+ ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_gnuext >>= withAttribute DataTypeTok) >>~ pushContext ("Roff","Directive"))+ <|>+ ((pColumn 1 >> pRegExpr regex_'5cs'2ads'5cb >>= withAttribute FunctionTok) >>~ pushContext ("Roff","dsDirective"))+ <|>+ ((pColumn 1 >> pRegExpr regex_'5cs'2ade'5cb >>= withAttribute FunctionTok) >>~ pushContext ("Roff","deDirective"))+ <|>+ ((pColumn 1 >> pRegExpr regex_'5cs'2ada'28'3f'3d'5cs'2b'5bA'2dZa'2dz'5d'2b'29 >>= withAttribute FunctionTok) >>~ pushContext ("Roff","daDirective"))+ <|>+ ((pColumn 1 >> pRegExpr regex_'5cs'2adi'28'3f'3d'5cs'2b'5bA'2dZa'2dz'5d'2b'29 >>= withAttribute FunctionTok) >>~ pushContext ("Roff","diDirective"))+ <|>+ ((pColumn 1 >> pRegExpr regex_'5cs'2a'5bA'2dZa'2dz'5d'2b'5cb >>= withAttribute FunctionTok) >>~ pushContext ("Roff","Directive"))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","DetectDirective")) >> pDefault >>= withAttribute FunctionTok))++parseRules ("Roff","Comment") =+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd)))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","Comment")) >> pDefault >>= withAttribute CommentTok))++parseRules ("Roff","Error") =+ (currentContext >>= \x -> guard (x == ("Roff","Error")) >> pDefault >>= withAttribute ErrorTok)++parseRules ("Roff","Directive") =+ (((pFloat >>= withAttribute DecValTok))+ <|>+ ((pInt >>= withAttribute DecValTok))+ <|>+ ((pDetect2Chars False '\\' '"' >>= withAttribute CommentTok) >>~ pushContext ("Roff","Comment"))+ <|>+ ((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","Directive")) >> pDefault >>= withAttribute StringTok))++parseRules ("Roff","String") =+ (((pDetect2Chars False '\\' '"' >>= withAttribute CharTok))+ <|>+ ((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))+ <|>+ ((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","String")) >> pDefault >>= withAttribute StringTok))++parseRules ("Roff","LiteralSL") =+ (currentContext >>= \x -> guard (x == ("Roff","LiteralSL")) >> pDefault >>= withAttribute NormalTok)++parseRules ("Roff","LiteralIL") =+ (((pDetect2Chars False '\\' '\\' >>= withAttribute CharTok))+ <|>+ ((pDetect2Chars False '\\' '?' >>= withAttribute CharTok) >>~ (popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","LiteralIL")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","Argument") =+ (((pRegExprDynamic "%1" >>= withAttribute CharTok) >>~ (popContext >> popContext))+ <|>+ ((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","Argument")) >> pDefault >>= withAttribute StringTok))++parseRules ("Roff","GlyphArgument") =+ (((pRegExprDynamic "%1" >>= withAttribute OtherTok) >>~ (popContext >> popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","GlyphArgument")) >> pDefault >>= withAttribute OtherTok))++parseRules ("Roff","Measurement") =+ (((pRegExprDynamic "%1" >>= withAttribute CharTok) >>~ (popContext >> popContext))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","Measurement")) >> pDefault >>= withAttribute ErrorTok))++parseRules ("Roff","deDirective") =+ (currentContext >>= \x -> guard (x == ("Roff","deDirective")) >> pDefault >>= withAttribute StringTok)++parseRules ("Roff","deBody") =+ (((pColumn 0 >> pDetect2Chars False '.' '.' >>= withAttribute FunctionTok) >>~ (popContext >> popContext))+ <|>+ ((parseRules ("Roff","Normal")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","deBody")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","diDirective") =+ (currentContext >>= \x -> guard (x == ("Roff","diDirective")) >> pDefault >>= withAttribute StringTok)++parseRules ("Roff","diBody") =+ (((pColumn 0 >> pRegExpr regex_'5c'2e'5cs'2adi'5cb >>= withAttribute FunctionTok) >>~ (popContext >> popContext))+ <|>+ ((pDetect2Chars False '\\' '!' >>= withAttribute CharTok) >>~ pushContext ("Roff","LiteralSL"))+ <|>+ ((pDetect2Chars False '\\' '?' >>= withAttribute CharTok) >>~ pushContext ("Roff","LiteralIL"))+ <|>+ ((parseRules ("Roff","Normal")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","diBody")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","daDirective") =+ (currentContext >>= \x -> guard (x == ("Roff","daDirective")) >> pDefault >>= withAttribute StringTok)++parseRules ("Roff","daBody") =+ (((pColumn 0 >> pRegExpr regex_'5c'2e'5cs'2ada'5cb >>= withAttribute FunctionTok) >>~ (popContext >> popContext))+ <|>+ ((pDetect2Chars False '\\' '!' >>= withAttribute CharTok) >>~ pushContext ("Roff","LiteralSL"))+ <|>+ ((pDetect2Chars False '\\' '?' >>= withAttribute CharTok) >>~ pushContext ("Roff","LiteralIL"))+ <|>+ ((parseRules ("Roff","Normal")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","daBody")) >> pDefault >>= withAttribute NormalTok))++parseRules ("Roff","dsDirective") =+ (((pInt >>= withAttribute DecValTok))+ <|>+ ((pFloat >>= withAttribute DecValTok))+ <|>+ ((pDetect2Chars False '\\' '"' >>= withAttribute CommentTok) >>~ pushContext ("Roff","Comment"))+ <|>+ ((pDetectChar False '"' >>= withAttribute StringTok) >>~ pushContext ("Roff","dsString"))+ <|>+ ((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","dsDirective")) >> pDefault >>= withAttribute StringTok))++parseRules ("Roff","dsString") =+ (((parseRules ("Roff","DetectOthers")))+ <|>+ (currentContext >>= \x -> guard (x == ("Roff","dsString")) >> pDefault >>= withAttribute StringTok))++parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing++parseRules x = parseRules ("Roff","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Ruby.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -481,7 +482,7 @@ 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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Ruby","Embedded documentation")) >> pDefault >>= withAttribute CommentTok)) @@ -540,12 +541,12 @@ 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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Ruby","Comment Line")) >> pDefault >>= withAttribute CommentTok)) parseRules ("Ruby","General Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Ruby","General Comment")) >> pDefault >>= withAttribute CommentTok)) @@ -1145,6 +1146,6 @@ parseRules ("Ruby","DATA") = (currentContext >>= \x -> guard (x == ("Ruby","DATA")) >> pDefault >>= withAttribute NormalTok) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Ruby","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Rust.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Scala.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -77,7 +78,7 @@ regex_'5cb'5b'5fa'2dzA'2dZ'5d'5cw'2a'28'3f'3d'5b'5cs'5d'2a'29 = compileRegex "\\b[_a-zA-Z]\\w*(?=[\\s]*)" parseRules ("Scala","Normal") =- (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Javadoc.parseExpression (Just ("Javadoc","")))) <|> ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute KeywordTok)) <|>@@ -179,6 +180,6 @@ <|> (currentContext >>= \x -> guard (x == ("Scala","Commentar 2")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression+parseRules ("Javadoc", _) = Text.Highlighting.Kate.Syntax.Javadoc.parseExpression Nothing parseRules x = parseRules ("Scala","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Scheme.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Sci.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Sed.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Sgml.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Sql.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/SqlMysql.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/SqlPostgresql.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Tcl.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Texinfo.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -80,14 +81,14 @@ (currentContext >>= \x -> guard (x == ("Texinfo","Normal Text")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Texinfo","singleLineComment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (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)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Texinfo","multiLineComment")) >> pDefault >>= withAttribute CommentTok)) @@ -105,6 +106,6 @@ <|> (currentContext >>= \x -> guard (x == ("Texinfo","folding")) >> pDefault >>= withAttribute NormalTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Texinfo","Normal Text") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Verilog.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -143,12 +144,12 @@ (currentContext >>= \x -> guard (x == ("Verilog","String")) >> pDefault >>= withAttribute StringTok)) parseRules ("Verilog","Commentar 1") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> (currentContext >>= \x -> guard (x == ("Verilog","Commentar 1")) >> pDefault >>= withAttribute CommentTok)) parseRules ("Verilog","Commentar 2") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -176,7 +177,7 @@ (currentContext >>= \x -> guard (x == ("Verilog","Some Context")) >> pDefault >>= withAttribute NormalTok) parseRules ("Verilog","Some Context2") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pFirstNonSpace >> pString False "#endif" >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -192,6 +193,6 @@ <|> (currentContext >>= \x -> guard (x == ("Verilog","Port")) >> pDefault >>= withAttribute NormalTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("Verilog","Normal") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Vhdl.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Xml.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -132,7 +133,7 @@ <|> ((pRegExpr regex_'2d'28'2d'28'3f'21'2d'3e'29'29'2b >>= withAttribute ErrorTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -254,6 +255,6 @@ <|> (currentContext >>= \x -> guard (x == ("XML","Value SQ")) >> pDefault >>= withAttribute StringTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("XML","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Xorg.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -111,12 +112,12 @@ parseRules ("x.org Configuration","Comment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("x.org Configuration","Comment")) >> pDefault >>= withAttribute CommentTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("x.org Configuration","xorg") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Xslt.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
Text/Highlighting/Kate/Syntax/Xul.hs view
@@ -25,12 +25,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -160,7 +161,7 @@ <|> ((pRegExpr regex_'2d'28'2d'28'3f'21'2d'3e'29'29'2b >>= withAttribute ErrorTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|>@@ -341,14 +342,14 @@ parseRules ("XUL","JSComment") = (((pDetectSpaces >>= withAttribute CommentTok)) <|>- ((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ ((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetectIdentifier >>= withAttribute CommentTok)) <|> (currentContext >>= \x -> guard (x == ("XUL","JSComment")) >> pDefault >>= withAttribute CommentTok)) parseRules ("XUL","Multi/inline Comment") =- (((Text.Highlighting.Kate.Syntax.Alert.parseExpression >>= ((withAttribute CommentTok) . snd)))+ (((Text.Highlighting.Kate.Syntax.Alert.parseExpression (Just ("Alerts","")) >>= ((withAttribute CommentTok) . snd))) <|> ((pDetect2Chars False '*' '/' >>= withAttribute CommentTok) >>~ (popContext)) <|>@@ -410,6 +411,6 @@ <|> (currentContext >>= \x -> guard (x == ("XUL","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok)) -parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression+parseRules ("Alerts", _) = Text.Highlighting.Kate.Syntax.Alert.parseExpression Nothing parseRules x = parseRules ("XUL","Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Yacc.hs view
@@ -24,12 +24,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }@@ -98,7 +99,7 @@ <|> ((pColumn 0 >> pDetect2Chars False '%' '}' >>= withAttribute BaseNTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Yacc/Bison","C Declarations")) >> pDefault >>= withAttribute NormalTok)) @@ -131,7 +132,7 @@ <|> ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext >> popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union In")) >> pDefault >>= withAttribute NormalTok)) @@ -140,7 +141,7 @@ <|> ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Yacc/Bison","Union InIn")) >> pDefault >>= withAttribute NormalTok)) @@ -167,7 +168,7 @@ (currentContext >>= \x -> guard (x == ("Yacc/Bison","Rule In")) >> pDefault >>= withAttribute NormalTok)) parseRules ("Yacc/Bison","User Code") =- (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ (((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> (currentContext >>= \x -> guard (x == ("Yacc/Bison","User Code")) >> pDefault >>= withAttribute NormalTok)) @@ -233,7 +234,7 @@ <|> ((pDetectChar False '}' >>= withAttribute NormalTok) >>~ (popContext)) <|>- ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression))+ ((Text.Highlighting.Kate.Syntax.Cpp.parseExpression (Just ("C++","")))) <|> ((pDetectChar False '$' >>= withAttribute KeywordTok) >>~ pushContext ("Yacc/Bison","Dol")) <|>@@ -251,6 +252,6 @@ <|> (currentContext >>= \x -> guard (x == ("Yacc/Bison","DolEnd")) >> pDefault >>= withAttribute NormalTok)) -parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression+parseRules ("C++", _) = Text.Highlighting.Kate.Syntax.Cpp.parseExpression Nothing parseRules x = parseRules ("Yacc/Bison","Pre Start") <|> fail ("Unknown context" ++ show x)
Text/Highlighting/Kate/Syntax/Yaml.hs view
@@ -23,12 +23,13 @@ highlight input = evalState (mapM parseSourceLine $ lines input) startingState parseSourceLine :: String -> State SyntaxState SourceLine-parseSourceLine = mkParseSourceLine parseExpression+parseSourceLine = mkParseSourceLine (parseExpression Nothing) -- | Parse an expression using appropriate local context.-parseExpression :: KateParser Token-parseExpression = do- (lang,cont) <- currentContext+parseExpression :: Maybe (String,String)+ -> KateParser Token+parseExpression mbcontext = do+ (lang,cont) <- maybe currentContext return mbcontext result <- parseRules (lang,cont) optional $ do eof updateState $ \st -> st{ synStPrevChar = '\n' }
highlighting-kate.cabal view
@@ -1,5 +1,5 @@ Name: highlighting-kate-Version: 0.5.4+Version: 0.5.5 Cabal-Version: >= 1.10 Build-Type: Simple Category: Text@@ -104,6 +104,7 @@ xml/r.xml xml/relaxngcompact.xml xml/rhtml.xml+ xml/roff.xml xml/ruby.xml xml/rust.xml xml/scala.xml@@ -232,6 +233,7 @@ Text.Highlighting.Kate.Syntax.R Text.Highlighting.Kate.Syntax.Relaxngcompact Text.Highlighting.Kate.Syntax.Rhtml+ Text.Highlighting.Kate.Syntax.Roff Text.Highlighting.Kate.Syntax.Ruby Text.Highlighting.Kate.Syntax.Rust Text.Highlighting.Kate.Syntax.Scala
xml/haskell.xml view
@@ -361,9 +361,9 @@ <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" /> <itemData name="Type Prelude" defStyleNum="dsDataType" spellChecking="false" />- <itemData name="Function Prelude" defStyleNum="dsFunction" spellChecking="false" />- <itemData name="Data Prelude" defStyleNum="dsKeyword" spellChecking="false" />- <itemData name="Class Prelude" defStyleNum="dsKeyword" spellChecking="false" />+ <itemData name="Function Prelude" defStyleNum="dsNormal" spellChecking="false" />+ <itemData name="Data Prelude" defStyleNum="dsDataType" spellChecking="false" />+ <itemData name="Class Prelude" defStyleNum="dsDataType" spellChecking="false" /> <itemData name="Signature" defStyleNum="dsOthers" spellChecking="false" /> <itemData name="Function" defStyleNum="dsNormal" spellChecking="false" />
+ xml/roff.xml view
@@ -0,0 +1,197 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE language SYSTEM "language.dtd"+[+ <!ENTITY roffidc "[^]\s]">+ <!ENTITY roffid "(&roffidc;|\(&roffidc;{2}|\[&roffidc;+\])">+ <!ENTITY roffnum "([0-9]+)">+ <!ENTITY argsep1 "([^\\]|\\[% |^{}'`-_!?@)/,&:~0acdeEprtu])">+ <!ENTITY argsep2 "([^\\0-9]|\\[%:{}'`-_!@/cep])">+]>+<language name="Roff" section="Markup" version="0.11" kateversion="2.9" extensions="" author="Matthew Woehlke (mw_triad@users.sourceforge.net)" license="GPL">++ <highlighting>++ <list name="layout">+ <item>br</item>+ <item>sp</item>+ </list>++ <list name="formatting">+ </list>++ <list name="gnuext">+ </list>++ <contexts>++ <!-- root context -->+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">+ <IncludeRules context="DetectComments"/>+ <DetectChar attribute="Other Macros" context="DetectDirective" char="." column="0"/>+ <IncludeRules context="DetectOthers"/>+ </context>++ <context name="DetectComments" attribute="Normal Text" lineEndContext="#stay">+ <RegExpr attribute="Comment" context="Comment" String="\.\s*\\"" column="0"/>+ <Detect2Chars attribute="Comment" context="Comment" char="\\" char1="""/>+ <Detect2Chars attribute="Comment" context="Comment" char="\\" char1="#"/>+ </context>++ <!-- catch glyphc, registers, strings, etc -->+ <context name="DetectOthers" attribute="Normal Text" lineEndContext="#stay">+ <IncludeRules context="DetectComments"/>+ <DetectChar attribute="Escape" context="DetectEscape" char="\\" lookAhead="true"/>+ <DetectChar attribute="String" context="String" char="""/>+ </context>++ <!-- detect escapes -->+ <context name="DetectEscape" attribute="Error" lineEndContext="#pop">+ <RegExpr attribute="Register" context="#pop" String="\\(\*|n[+-]?)&roffid;"/>+ <RegExpr attribute="Font" context="#pop" String="\\[fF]&roffid;"/>+ <RegExpr attribute="Font" context="#pop" String="\\f([0-9]|\([0-9][0-9]|\[[0-9]+\])"/>+ <RegExpr attribute="Font" context="#pop" String="\\s(\[([1-3][0-9]|[04-9])\]|[04-9]|[+-][0-9]|([+-]?\(|\([+-])[0-9][0-9])"/>+ <Detect2Chars attribute="Escape" context="#pop" char="\\" char1="\\"/>+ <RegExpr attribute="Escape" context="#pop" String="\\(\$[0-9*@]|[.:% |^{}_!?@)/,&:~0acdeEprtu])"/>+ <RegExpr attribute="Escape" context="Argument" String="\\[AbBDowXZ]&argsep1;"/>+ <RegExpr attribute="Escape" context="#pop" String="\\[gkmMVYz]&roffid;"/>+ <RegExpr attribute="Escape" context="#pop" String="\\O([0-4]|\[5[lrci][^]]\])"/>+ <RegExpr attribute="Escape" context="Measurement" String="\\[hHSvx]&argsep1;"/>+ <RegExpr attribute="Escape" context="Measurement" String="\\[lL]&argsep1;|?"/> <!-- TODO - optional trailing &glyph; -->+ <RegExpr attribute="Escape" context="Argument" String="\\R&argsep1;"/> <!-- TODO - &roffid; (register), measurement -->+ <RegExpr attribute="Glyph" context="GlyphArgument" String="\\C&argsep1;"/>+ <RegExpr attribute="Glyph" context="#pop" String="\\N&argsep2;[0-9]+\1"/>+ <RegExpr attribute="Glyph" context="#pop" String="\\&roffid;"/>+ <RegExpr attribute="Escape" context="#pop" String="\\$"/>+ <DetectChar attribute="Error" context="#pop" char="\\"/>+ </context>++ <!-- directive start -->+ <context name="DetectDirective" attribute="Other Macros" lineEndContext="#pop">+ <keyword attribute="Layout Macros" context="Directive" String="layout"/>+ <keyword attribute="Format Macros" context="Directive" String="formatting"/>+ <keyword attribute="GNU Macros" context="Directive" String="gnuext"/>+ <RegExpr attribute="Other Macros" context="dsDirective" String="\s*ds\b" column="1"/>+ <RegExpr attribute="Other Macros" context="deDirective" String="\s*de\b" column="1" beginRegion="de"/>+ <RegExpr attribute="Other Macros" context="daDirective" String="\s*da(?=\s+[A-Za-z]+)" column="1" beginRegion="di"/>+ <RegExpr attribute="Other Macros" context="diDirective" String="\s*di(?=\s+[A-Za-z]+)" column="1" beginRegion="di"/>+ <RegExpr attribute="Other Macros" context="Directive" String="\s*[A-Za-z]+\b" column="1"/>+ </context>++ <!-- comment -->+ <context name="Comment" attribute="Comment" lineEndContext="#pop">+ <IncludeRules context="##Alerts"/>+ </context>++ <!-- error -->+ <context name="Error" attribute="Error" lineEndContext="#stay"/>++ <!-- generic directive -->+ <context name="Directive" attribute="Identifier" lineEndContext="#pop">+ <Float attribute="Number" context="#stay"/>+ <Int attribute="Number" context="#stay"/>+ <Detect2Chars attribute="Comment" context="Comment" char="\\" char1="""/>+ <IncludeRules context="DetectOthers"/>+ </context>++ <!-- quoted string -->+ <context name="String" attribute="String" lineEndContext="#pop">+ <Detect2Chars attribute="Escape" context="#stay" char="\\" char1="""/>+ <DetectChar attribute="String" context="#pop" char="""/>+ <IncludeRules context="DetectOthers"/>+ </context>++ <!-- \!, \? escapes -->+ <context name="LiteralSL" attribute="Normal Text" lineEndContext="#pop"/>+ <context name="LiteralIL" attribute="Normal Text" lineEndContext="Error">+ <Detect2Chars attribute="Escape" context="#stay" char="\\" char1="\\"/>+ <Detect2Chars attribute="Escape" context="#pop" char="\\" char1="?"/>+ </context>++ <!-- escape argument -->+ <context name="Argument" attribute="String" lineEndContext="Error" dynamic="true">+ <RegExpr attribute="Escape" context="#pop#pop" String="%1" dynamic="true"/>+ <IncludeRules context="DetectOthers"/>+ </context>++ <!-- glyph escape argument -->+ <context name="GlyphArgument" attribute="Glyph" lineEndContext="Error" dynamic="true">+ <RegExpr attribute="Glyph" context="#pop#pop" String="%1" dynamic="true"/>+ </context>++ <!-- measurement (or expression) escape argument -->+ <context name="Measurement" attribute="Error" lineEndContext="Error" dynamic="true">+ <RegExpr attribute="Escape" context="#pop#pop" String="%1" dynamic="true"/>+ <!-- TODO -->+ </context>++ <!-- .de directive -->+ <context name="deDirective" attribute="Identifier" lineEndContext="deBody"/>+ <context name="deBody" attribute="Normal Text" lineEndContext="#stay">+ <Detect2Chars attribute="Other Macros" context="#pop#pop" char="." char1="." column="0" endRegion="de"/>+ <IncludeRules context="Normal"/>+ </context>++ <!-- .di directives -->+ <context name="diDirective" attribute="Identifier" lineEndContext="diBody"/>+ <context name="diBody" attribute="Normal Text" lineEndContext="#stay">+ <RegExpr attribute="Other Macros" context="#pop#pop" String="\.\s*di\b" column="0" endRegion="di"/>+ <Detect2Chars attribute="Escape" context="LiteralSL" char="\\" char1="!"/>+ <Detect2Chars attribute="Escape" context="LiteralIL" char="\\" char1="?"/>+ <IncludeRules context="Normal"/>+ </context>++ <!-- .da directives -->+ <context name="daDirective" attribute="Identifier" lineEndContext="daBody"/>+ <context name="daBody" attribute="Normal Text" lineEndContext="#stay">+ <RegExpr attribute="Other Macros" context="#pop#pop" String="\.\s*da\b" column="0" endRegion="di"/>+ <Detect2Chars attribute="Escape" context="LiteralSL" char="\\" char1="!"/>+ <Detect2Chars attribute="Escape" context="LiteralIL" char="\\" char1="?"/>+ <IncludeRules context="Normal"/>+ </context>++ <!-- .ds directive -->+ <context name="dsDirective" attribute="Identifier" lineEndContext="#pop">+ <Int attribute="Number" context="#stay"/>+ <Float attribute="Number" context="#stay"/>+ <Detect2Chars attribute="Comment" context="Comment" char="\\" char1="""/>+ <DetectChar attribute="String" context="dsString" char="""/>+ <IncludeRules context="DetectOthers"/>+ </context>++ <!-- .ds quoted value -->+ <context name="dsString" attribute="String" lineEndContext="#pop">+ <IncludeRules context="DetectOthers"/>+ </context>++ </contexts>++ <itemDatas>+ <itemData name="Normal Text" defStyleNum="dsNormal"/>+ <itemData name="Comment" defStyleNum="dsComment"/>+ <itemData name="Layout Macros" defStyleNum="dsKeyword"/>+ <itemData name="Format Macros" defStyleNum="dsKeyword"/>+ <itemData name="GNU Macros" defStyleNum="dsDataType"/>+ <itemData name="Other Macros" defStyleNum="dsFunction"/>+ <itemData name="Identifier" defStyleNum="dsString"/>+ <itemData name="Number" defStyleNum="dsDecVal"/>+ <itemData name="Register" defStyleNum="dsOthers"/>+ <itemData name="Font" defStyleNum="dsOthers"/>+ <itemData name="Glyph" defStyleNum="dsOthers"/>+ <itemData name="Escape" defStyleNum="dsChar"/>+ <itemData name="String" defStyleNum="dsString"/>+ <itemData name="Error" defStyleNum="dsError"/>+ </itemDatas>++ </highlighting>++ <general>++ <comments>+ <comment name="singleLine" start=".\"" />+ </comments>++ <keywords casesensitive="1"/>++ </general>++</language>