packages feed

highlighting-kate 0.2.8.1 → 0.2.8.2

raw patch · 7 files changed

+598/−6 lines, 7 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Text.Highlighting.Kate.Syntax.Fsharp: highlight :: String -> Either String [SourceLine]
+ Text.Highlighting.Kate.Syntax.Fsharp: parseExpression :: GenParser Char SyntaxState LabeledSource
+ Text.Highlighting.Kate.Syntax.Fsharp: syntaxExtensions :: String
+ Text.Highlighting.Kate.Syntax.Fsharp: syntaxName :: String

Files

README view
@@ -27,6 +27,10 @@ which generates some of the needed source files from xml syntax definitions. +If you get a linking error with GHC 7 on Mac OS X, "scattered reloc r_address+too large for inferred architecture i386," the workaround is to use the flag+`--disable-library-for-ghci` when you `cabal install`.+ To generate the documentation:      cabal haddock
Text/Highlighting/Kate/Format.hs view
@@ -33,7 +33,7 @@ formatAsXHtml opts lang lines =   let startNum = getStartNum opts       numberOfLines = length lines-      code = thecode << map (sourceLineToHtml opts) lines+      code = thecode << intersperse br (map (sourceLineToHtml opts) lines)   in  if OptNumberLines `elem` opts          then let lnTitle = title "Click to toggle line numbers"                   lnOnClick = strAttr "onclick" "with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"@@ -62,7 +62,7 @@  sourceLineToHtml :: [FormatOption] -> SourceLine -> Html sourceLineToHtml opts contents =-  concatHtml $ (map (labeledSourceToHtml opts) contents) ++ [br]+  concatHtml $ map (labeledSourceToHtml opts) contents  removeSpaces :: String -> String removeSpaces = filter (/= ' ')
Text/Highlighting/Kate/Syntax.hs view
@@ -36,6 +36,7 @@ import qualified Text.Highlighting.Kate.Syntax.Email as Email import qualified Text.Highlighting.Kate.Syntax.Erlang as Erlang import qualified Text.Highlighting.Kate.Syntax.Fortran as Fortran+import qualified Text.Highlighting.Kate.Syntax.Fsharp as Fsharp import qualified Text.Highlighting.Kate.Syntax.Fstab as Fstab import qualified Text.Highlighting.Kate.Syntax.Gap as Gap import qualified Text.Highlighting.Kate.Syntax.Gdb as Gdb@@ -110,11 +111,11 @@  -- | List of supported languages. languages :: [String]-languages = ["Actionscript","Ada","Alert","Alert_indent","Ansys","Apache","Asn1","Asp","Awk","Bash","Bibtex","Boo","C","Changelog","Cisco","Cmake","Coldfusion","Commonlisp","Cpp","Cs","Css","Cue","D","Desktop","Diff","Djangotemplate","Doxygen","Doxygenlua","Dtd","Eiffel","Email","Erlang","Fortran","Fstab","Gap","Gdb","Gettext","Gnuassembler","Go","Haskell","Haxe","Html","Idl","Ilerpg","Ini","Java","Javadoc","Javascript","Json","Jsp","Latex","Lex","LiterateHaskell","Lua","M3u","Makefile","Mandoc","Matlab","Maxima","Mediawiki","Metafont","Mips","Modula2","Modula3","Monobasic","Nasm","Noweb","Objectivec","Objectivecpp","Ocaml","Octave","Pango","Pascal","Perl","Php","Pike","Postscript","Prolog","Python","R","Relaxngcompact","Rhtml","Ruby","Scala","Scheme","Sci","Sed","Sgml","Sql","SqlMysql","SqlPostgresql","Tcl","Texinfo","Verilog","Vhdl","Winehq","Wml","Xharbour","Xml","Xorg","Xslt","Xul","Yacc","Yaml"]+languages = ["Actionscript","Ada","Alert","Alert_indent","Ansys","Apache","Asn1","Asp","Awk","Bash","Bibtex","Boo","C","Changelog","Cisco","Cmake","Coldfusion","Commonlisp","Cpp","Cs","Css","Cue","D","Desktop","Diff","Djangotemplate","Doxygen","Doxygenlua","Dtd","Eiffel","Email","Erlang","Fortran","Fsharp","Fstab","Gap","Gdb","Gettext","Gnuassembler","Go","Haskell","Haxe","Html","Idl","Ilerpg","Ini","Java","Javadoc","Javascript","Json","Jsp","Latex","Lex","LiterateHaskell","Lua","M3u","Makefile","Mandoc","Matlab","Maxima","Mediawiki","Metafont","Mips","Modula2","Modula3","Monobasic","Nasm","Noweb","Objectivec","Objectivecpp","Ocaml","Octave","Pango","Pascal","Perl","Php","Pike","Postscript","Prolog","Python","R","Relaxngcompact","Rhtml","Ruby","Scala","Scheme","Sci","Sed","Sgml","Sql","SqlMysql","SqlPostgresql","Tcl","Texinfo","Verilog","Vhdl","Winehq","Wml","Xharbour","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), ("Ansys", Ansys.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), ("Cisco", Cisco.syntaxExtensions), ("Cmake", Cmake.syntaxExtensions), ("Coldfusion", Coldfusion.syntaxExtensions), ("Commonlisp", Commonlisp.syntaxExtensions), ("Cpp", Cpp.syntaxExtensions), ("Cs", Cs.syntaxExtensions), ("Css", Css.syntaxExtensions), ("Cue", Cue.syntaxExtensions), ("D", D.syntaxExtensions), ("Desktop", Desktop.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), ("Fstab", Fstab.syntaxExtensions), ("Gap", Gap.syntaxExtensions), ("Gdb", Gdb.syntaxExtensions), ("Gettext", Gettext.syntaxExtensions), ("Gnuassembler", Gnuassembler.syntaxExtensions), ("Go", Go.syntaxExtensions), ("Haskell", Haskell.syntaxExtensions), ("Haxe", Haxe.syntaxExtensions), ("Html", Html.syntaxExtensions), ("Idl", Idl.syntaxExtensions), ("Ilerpg", Ilerpg.syntaxExtensions), ("Ini", Ini.syntaxExtensions), ("Java", Java.syntaxExtensions), ("Javadoc", Javadoc.syntaxExtensions), ("Javascript", Javascript.syntaxExtensions), ("Json", Json.syntaxExtensions), ("Jsp", Jsp.syntaxExtensions), ("Latex", Latex.syntaxExtensions), ("Lex", Lex.syntaxExtensions), ("LiterateHaskell", LiterateHaskell.syntaxExtensions), ("Lua", Lua.syntaxExtensions), ("M3u", M3u.syntaxExtensions), ("Makefile", Makefile.syntaxExtensions), ("Mandoc", Mandoc.syntaxExtensions), ("Matlab", Matlab.syntaxExtensions), ("Maxima", Maxima.syntaxExtensions), ("Mediawiki", Mediawiki.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), ("Pango", Pango.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), ("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), ("Winehq", Winehq.syntaxExtensions), ("Wml", Wml.syntaxExtensions), ("Xharbour", Xharbour.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), ("Ansys", Ansys.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), ("Cisco", Cisco.syntaxExtensions), ("Cmake", Cmake.syntaxExtensions), ("Coldfusion", Coldfusion.syntaxExtensions), ("Commonlisp", Commonlisp.syntaxExtensions), ("Cpp", Cpp.syntaxExtensions), ("Cs", Cs.syntaxExtensions), ("Css", Css.syntaxExtensions), ("Cue", Cue.syntaxExtensions), ("D", D.syntaxExtensions), ("Desktop", Desktop.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), ("Fstab", Fstab.syntaxExtensions), ("Gap", Gap.syntaxExtensions), ("Gdb", Gdb.syntaxExtensions), ("Gettext", Gettext.syntaxExtensions), ("Gnuassembler", Gnuassembler.syntaxExtensions), ("Go", Go.syntaxExtensions), ("Haskell", Haskell.syntaxExtensions), ("Haxe", Haxe.syntaxExtensions), ("Html", Html.syntaxExtensions), ("Idl", Idl.syntaxExtensions), ("Ilerpg", Ilerpg.syntaxExtensions), ("Ini", Ini.syntaxExtensions), ("Java", Java.syntaxExtensions), ("Javadoc", Javadoc.syntaxExtensions), ("Javascript", Javascript.syntaxExtensions), ("Json", Json.syntaxExtensions), ("Jsp", Jsp.syntaxExtensions), ("Latex", Latex.syntaxExtensions), ("Lex", Lex.syntaxExtensions), ("LiterateHaskell", LiterateHaskell.syntaxExtensions), ("Lua", Lua.syntaxExtensions), ("M3u", M3u.syntaxExtensions), ("Makefile", Makefile.syntaxExtensions), ("Mandoc", Mandoc.syntaxExtensions), ("Matlab", Matlab.syntaxExtensions), ("Maxima", Maxima.syntaxExtensions), ("Mediawiki", Mediawiki.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), ("Pango", Pango.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), ("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), ("Winehq", Winehq.syntaxExtensions), ("Wml", Wml.syntaxExtensions), ("Xharbour", Xharbour.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]@@ -170,6 +171,7 @@         "email" -> Email.highlight         "erlang" -> Erlang.highlight         "fortran" -> Fortran.highlight+        "fsharp" -> Fsharp.highlight         "fstab" -> Fstab.highlight         "gap" -> Gap.highlight         "gdb" -> Gdb.highlight
+ Text/Highlighting/Kate/Syntax/Fsharp.hs view
@@ -0,0 +1,255 @@+{- This module was generated from data in the Kate syntax highlighting file fsharp.xml, version 0.0.1,+   by  Bas Bossink (bas.bossink@gmail.com) -}++module Text.Highlighting.Kate.Syntax.Fsharp ( highlight, parseExpression, syntaxName, syntaxExtensions ) where+import Text.Highlighting.Kate.Definitions+import Text.Highlighting.Kate.Common+import Text.ParserCombinators.Parsec+import Control.Monad (when)+import Data.Map (fromList)+import Data.Maybe (fromMaybe, maybeToList)++import qualified Data.Set as Set+-- | Full name of language.+syntaxName :: String+syntaxName = "FSharp"++-- | Filename extensions for this language.+syntaxExtensions :: String+syntaxExtensions = "*.fs;*.fsi;*.fsx"++-- | Highlight source code using this syntax definition.+highlight :: String -> Either String [SourceLine]+highlight input =+  case runParser parseSource startingState "source" input of+    Left err     -> Left $ show err+    Right result -> Right result++-- | Parse an expression using appropriate local context.+parseExpression :: GenParser Char SyntaxState LabeledSource+parseExpression = do+  st <- getState+  let oldLang = synStLanguage st+  setState $ st { synStLanguage = "FSharp" }+  context <- currentContext <|> (pushContext "Normal" >> currentContext)+  result <- parseRules context+  updateState $ \st -> st { synStLanguage = oldLang }+  return result++parseSource = do +  lineContents <- lookAhead wholeLine+  updateState $ \st -> st { synStCurrentLine = lineContents }+  result <- manyTill parseSourceLine eof+  return $ map normalizeHighlighting result++startingState = SyntaxState {synStContexts = fromList [("FSharp",["Normal"])], synStLanguage = "FSharp", synStCurrentLine = "", synStCharsParsedInLine = 0, synStPrevChar = '\n', synStCaseSensitive = True, synStKeywordCaseSensitive = True, synStCaptures = []}++parseSourceLine = manyTill parseExpressionInternal pEndLine++pEndLine = do+  lookAhead $ newline <|> (eof >> return '\n')+  context <- currentContext+  case context of+    "Normal" -> return () >> pHandleEndLine+    "Singleline Comment" -> (popContext) >> pEndLine+    "Multiline Comment" -> return () >> pHandleEndLine+    "String Constant" -> return () >> pHandleEndLine+    "Block" -> return () >> pHandleEndLine+    "Sig" -> return () >> pHandleEndLine+    "Struct" -> return () >> pHandleEndLine+    "Object" -> return () >> pHandleEndLine+    "ModuleEnv" -> return () >> pHandleEndLine+    "ModuleEnv2" -> return () >> pHandleEndLine+    "Camlp4 Quotation Constant" -> return () >> pHandleEndLine+    _ -> pHandleEndLine++withAttribute attr txt = do+  when (null txt) $ fail "Parser matched no text"+  let labs = attr : maybeToList (lookup attr styles)+  st <- getState+  let oldCharsParsed = synStCharsParsedInLine st+  let prevchar = if null txt then '\n' else last txt+  updateState $ \st -> st { synStCharsParsedInLine = oldCharsParsed + length txt, synStPrevChar = prevchar } +  return (labs, txt)++styles = [("Keyword","kw"),("Core Data Type","dt"),("Decimal","dv"),("Hexadecimal","bn"),("Octal","bn"),("Binary","bn"),("Float","fl"),("Character","ch"),("String","st"),("Escaped characters","ch"),("Comment","co"),("Camlp4 Quotation","st"),("Directive","ot"),("Region Marker","kw")]++parseExpressionInternal = do+  context <- currentContext+  parseRules context <|> (pDefault >>= withAttribute (fromMaybe "" $ lookup context defaultAttributes))++list_keywords = Set.fromList $ words $ "abstract and as assert base class delegate dowcast downto elif else exception extern false for fun function functor global if in inherit inline interfaece internal lazy let match member mutable namespace new not null of or override private public rec ref return static then to true try type upcast use val void when while with yield"+list_core_types = Set.fromList $ words $ "bool byte sbyte int16 uint16 int uint32 int64 uint64 nativeint unativeint char string decimal unit void float32 single float double bigint option seq"+list_symbols = Set.fromList $ words $ "?"+list_end = Set.fromList $ words $ "end"+list_sig = Set.fromList $ words $ "sig"+list_struct = Set.fromList $ words $ "struct"+list_object = Set.fromList $ words $ "object"+list_begin = Set.fromList $ words $ "begin"+list_do = Set.fromList $ words $ "do"+list_done = Set.fromList $ words $ "done"+list_module'5fenvironment = Set.fromList $ words $ "module open"++regex_'60'5cs'2a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex "`\\s*[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"+regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'5cs'2a'5c'2e = compileRegex "[A-Z][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*\\s*\\."+regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex "[A-Z][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"+regex_'23'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'2e'2a'24 = compileRegex "#[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*.*$"+regex_'27'28'28'5c'5c'5bntbr'27'22'5c'5c'5d'7c'5c'5c'5b0'2d9'5d'7b3'7d'7c'5c'5cx'5b0'2d9A'2dFa'2df'5d'7b2'7d'29'7c'5b'5e'27'5d'29'27 = compileRegex "'((\\\\[ntbr'\"\\\\]|\\\\[0-9]{3}|\\\\x[0-9A-Fa-f]{2})|[^'])'"+regex_'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c = compileRegex "<:[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*<"+regex_'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a = compileRegex "[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*"+regex_'2d'3f0'5bxX'5d'5b0'2d9A'2dFa'2df'5f'5d'2b = compileRegex "-?0[xX][0-9A-Fa-f_]+"+regex_'2d'3f0'5boO'5d'5b0'2d7'5f'5d'2b = compileRegex "-?0[oO][0-7_]+"+regex_'2d'3f0'5bbB'5d'5b01'5f'5d'2b = compileRegex "-?0[bB][01_]+"+regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'28'28'5c'2e'28'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'3f'28'5beE'5d'5b'2d'2b'5d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'3f'29'7c'28'5beE'5d'5b'2d'2b'5d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'29 = compileRegex "-?[0-9][0-9_]*((\\.([0-9][0-9_]*)?([eE][-+]?[0-9][0-9_]*)?)|([eE][-+]?[0-9][0-9_]*))"+regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a = compileRegex "-?[0-9][0-9_]*"+regex_'28'5c'5c'5bntbr'27'22'5c'5c'5d'7c'5c'5c'5b0'2d9'5d'7b3'7d'7c'5c'5cx'5b0'2d9A'2dFa'2df'5d'7b2'7d'29 = compileRegex "(\\\\[ntbr'\"\\\\]|\\\\[0-9]{3}|\\\\x[0-9A-Fa-f]{2})"+regex_'5c'5c'24 = compileRegex "\\\\$"+regex_'5c'5c'28'5c'5c'7c'3e'3e'7c'3c'3c'29 = compileRegex "\\\\(\\\\|>>|<<)"+regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c = compileRegex "\\\\<:[A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\0377_][A-Za-z\\0300-\\0326\\0330-\\0366\\0370-\\03770-9_']*<"++defaultAttributes = [("Normal","Normal Text"),("Singleline Comment","Comment"),("Multiline Comment","Comment"),("String Constant","String"),("Block","Normal text"),("Sig","Normal text"),("Struct","Normal text"),("Object","Normal text"),("ModuleEnv","Normal text"),("ModuleEnv2","Normal text"),("Camlp4 Quotation Constant","Camlp4 Quotation")]++parseRules "Normal" = +  do (attr, result) <- (((pDetect2Chars False '(' '*' >>= withAttribute "Comment") >>~ pushContext "Multiline Comment")+                        <|>+                        ((pDetect2Chars False '/' '/' >>= withAttribute "Normal Text") >>~ pushContext "Singleline Comment")+                        <|>+                        ((pDetectChar False '(' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetectChar False ')' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetectChar False '{' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetectChar False '}' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetect2Chars False '[' '<' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetect2Chars False '>' ']' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetect2Chars False '[' '|' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetect2Chars False '|' ']' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetectChar False '[' >>= withAttribute "Symbol"))+                        <|>+                        ((pDetectChar False ']' >>= withAttribute "Symbol"))+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_do >>= withAttribute "Keyword"))+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_done >>= withAttribute "Keyword"))+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_module'5fenvironment >>= withAttribute "Directive") >>~ pushContext "ModuleEnv")+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_begin >>= withAttribute "Region Marker") >>~ pushContext "Block")+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_object >>= withAttribute "Region Marker") >>~ pushContext "Object")+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_sig >>= withAttribute "Region Marker") >>~ pushContext "Sig")+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_struct >>= withAttribute "Region Marker") >>~ pushContext "Struct")+                        <|>+                        ((pRegExpr regex_'60'5cs'2a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a >>= withAttribute "Constructor"))+                        <|>+                        ((lookAhead (pRegExpr regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'5cs'2a'5c'2e) >> return ([],"") ) >>~ pushContext "ModuleEnv2")+                        <|>+                        ((pRegExpr regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a >>= withAttribute "Constructor"))+                        <|>+                        ((pFirstNonSpace >> pRegExpr regex_'23'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'2e'2a'24 >>= withAttribute "Directive"))+                        <|>+                        ((pDetectChar False '"' >>= withAttribute "String") >>~ pushContext "String Constant")+                        <|>+                        ((pRegExpr regex_'27'28'28'5c'5c'5bntbr'27'22'5c'5c'5d'7c'5c'5c'5b0'2d9'5d'7b3'7d'7c'5c'5cx'5b0'2d9A'2dFa'2df'5d'7b2'7d'29'7c'5b'5e'27'5d'29'27 >>= withAttribute "Character"))+                        <|>+                        ((pDetect2Chars False '<' '<' >>= withAttribute "Camlp4 Quotation") >>~ pushContext "Camlp4 Quotation Constant")+                        <|>+                        ((pRegExpr regex_'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c >>= withAttribute "Camlp4 Quotation") >>~ pushContext "Camlp4 Quotation Constant")+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_keywords >>= withAttribute "Keyword"))+                        <|>+                        ((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_core_types >>= withAttribute "Core Data Type"))+                        <|>+                        ((pRegExpr regex_'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a >>= withAttribute "Identifier"))+                        <|>+                        ((pRegExpr regex_'2d'3f0'5bxX'5d'5b0'2d9A'2dFa'2df'5f'5d'2b >>= withAttribute "Hexadecimal"))+                        <|>+                        ((pRegExpr regex_'2d'3f0'5boO'5d'5b0'2d7'5f'5d'2b >>= withAttribute "Octal"))+                        <|>+                        ((pRegExpr regex_'2d'3f0'5bbB'5d'5b01'5f'5d'2b >>= withAttribute "Binary"))+                        <|>+                        ((pRegExpr regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'28'28'5c'2e'28'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'3f'28'5beE'5d'5b'2d'2b'5d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'3f'29'7c'28'5beE'5d'5b'2d'2b'5d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a'29'29 >>= withAttribute "Float"))+                        <|>+                        ((pRegExpr regex_'2d'3f'5b0'2d9'5d'5b0'2d9'5f'5d'2a >>= withAttribute "Decimal")))+     return (attr, result)++parseRules "Singleline Comment" = +  pzero++parseRules "Multiline Comment" = +  do (attr, result) <- (((pDetect2Chars False '*' ')' >>= withAttribute "Comment") >>~ (popContext))+                        <|>+                        ((pDetect2Chars False '(' '*' >>= withAttribute "Comment") >>~ pushContext "Multiline Comment"))+     return (attr, result)++parseRules "String Constant" = +  do (attr, result) <- (((pDetectChar False '"' >>= withAttribute "String") >>~ (popContext))+                        <|>+                        ((pRegExpr regex_'28'5c'5c'5bntbr'27'22'5c'5c'5d'7c'5c'5c'5b0'2d9'5d'7b3'7d'7c'5c'5cx'5b0'2d9A'2dFa'2df'5d'7b2'7d'29 >>= withAttribute "Escaped characters"))+                        <|>+                        ((pRegExpr regex_'5c'5c'24 >>= withAttribute "Escaped characters")))+     return (attr, result)++parseRules "Block" = +  do (attr, result) <- (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute "Region Marker") >>~ (popContext))+                        <|>+                        ((parseRules "Normal")))+     return (attr, result)++parseRules "Sig" = +  do (attr, result) <- (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute "Region Marker") >>~ (popContext))+                        <|>+                        ((parseRules "Normal")))+     return (attr, result)++parseRules "Struct" = +  do (attr, result) <- (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute "Region Marker") >>~ (popContext))+                        <|>+                        ((parseRules "Normal")))+     return (attr, result)++parseRules "Object" = +  do (attr, result) <- (((pKeyword " \n\t.():!+,-<=>%&*/;?[]^{|}~\\" list_end >>= withAttribute "Region Marker") >>~ (popContext))+                        <|>+                        ((parseRules "Normal")))+     return (attr, result)++parseRules "ModuleEnv" = +  do (attr, result) <- (((pDetectSpaces >>= withAttribute "Normal text"))+                        <|>+                        ((lookAhead (pRegExpr regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'5cs'2a'5c'2e) >> return ([],"") ) >>~ pushContext "ModuleEnv2")+                        <|>+                        ((pRegExpr regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a >>= withAttribute "Module") >>~ (popContext))+                        <|>+                        ((popContext) >> return ([], "")))+     return (attr, result)++parseRules "ModuleEnv2" = +  do (attr, result) <- (((pRegExpr regex_'5bA'2dZ'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a >>= withAttribute "Module"))+                        <|>+                        ((pDetectSpaces >>= withAttribute "Normal text"))+                        <|>+                        ((pString False "." >>= withAttribute "Keyword") >>~ (popContext)))+     return (attr, result)++parseRules "Camlp4 Quotation Constant" = +  do (attr, result) <- (((pDetect2Chars False '>' '>' >>= withAttribute "Camlp4 Quotation") >>~ (popContext))+                        <|>+                        ((pDetect2Chars False '<' '<' >>= withAttribute "Camlp4 Quotation") >>~ pushContext "Camlp4 Quotation Constant")+                        <|>+                        ((pRegExpr regex_'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c >>= withAttribute "Camlp4 Quotation") >>~ pushContext "Camlp4 Quotation Constant")+                        <|>+                        ((pRegExpr regex_'5c'5c'28'5c'5c'7c'3e'3e'7c'3c'3c'29 >>= withAttribute "Escaped characters"))+                        <|>+                        ((pRegExpr regex_'5c'5c'3c'3a'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c0377'5f'5d'5bA'2dZa'2dz'5c0300'2d'5c0326'5c0330'2d'5c0366'5c0370'2d'5c03770'2d9'5f'27'5d'2a'3c >>= withAttribute "Escaped characters")))+     return (attr, result)++parseRules x = fail $ "Unknown context" ++ x
changelog view
@@ -1,3 +1,45 @@+highlighting-kate 0.2.8.2 (28 Jan 2011)++  * formatAsXHtml: Don't put `<br/>` after last line.+  * Added F# highlighting based on the present ocaml definitions+    (Bas Bossink).++highlighting-kate 0.2.8.1 (02 Jan 2011)++  * Updated parseSyntaxFiles.hs to use HXT 9.0.0.++  * Added Makefile to help developers.+    When you check out the source from the repository, you can now+    do 'make prep' to generate the syntax parsers from the xml+    definitions.++  * Improved installation instructions.++  * Updated grammar files from Kate (Tianyi Cui).++  * Fixed bug in endline parsing (pointed out by Samuel Hym).+    + The bug occurs when you're nested two contexts in, and you hit+      the end of a line. Even if both contexts were set up to+      popContext at the end of line, previously only the first+      context was popped.  Example: in bash,+      export A=a+      export B=b+      The second 'export' was being highlighted as VarName.+    + Common: Added pHandleEndline.+    + ParseSyntaxFiles:  don't consume newline if you pop context at end+      of line; instead, fall back to next context and try the newline+      again.++  * Changed type of pPopContext. Now returns () instead of String.++  * Use doxygen instead of doxygenlua in lua parser.+    Using doxygenlua causes many lines to be erroneously+    interpreted as comments.  Reverting to doxygen as before+    fixes things.  Not sure if this is a bug in the lua.xml+    file or in highlighting-kate.++  * Added css based on Pygment’s tango style theme (Samuel Hym).+ highlighting-kate 0.2.7.1 (15 July 2010)    * Don't use the withAttribute combinator with null attribute.@@ -57,7 +99,7 @@     + Put keyword sets in separate definitions.     + Use words and unwords to trick GHC into not inlining the       lists of keywords, which slows compilation considerably.-  +   * Changed ghc-prof-options to include -caf-all and -O0.  highlighting-kate 0.2.6 (22 Jan 2010)
highlighting-kate.cabal view
@@ -1,5 +1,5 @@ Name:                highlighting-kate-Version:             0.2.8.1+Version:             0.2.8.2 Cabal-Version:       >= 1.2 Build-Type:          Simple Category:            Text@@ -61,6 +61,7 @@                      xml/email.xml                      xml/erlang.xml                      xml/fortran.xml+                     xml/fsharp.xml                      xml/fstab.xml                      xml/gap.xml                      xml/gdb.xml@@ -194,6 +195,7 @@                      Text.Highlighting.Kate.Syntax.Erlang                      Text.Highlighting.Kate.Syntax.Fortran                      Text.Highlighting.Kate.Syntax.Fstab+                     Text.Highlighting.Kate.Syntax.Fsharp                      Text.Highlighting.Kate.Syntax.Gap                      Text.Highlighting.Kate.Syntax.Gdb                      Text.Highlighting.Kate.Syntax.Gettext
+ xml/fsharp.xml view
@@ -0,0 +1,287 @@+<?xml version="1.0" encoding="UTF-8"?>+<!-- Kate syntax highlighting for F# based on the OCAML syntax by Glyn Webster (glyn@wave.co.nz). -->+<!DOCTYPE language SYSTEM "language.dtd"+[+<!-- Regular expresion constants: -->+<!ENTITY LETTER "A-Za-z\0300-\0326\0330-\0366\0370-\0377">          <!-- Latin-1 letters. -->+<!ENTITY IDENT  "[&LETTER;_][&LETTER;0-9_']*">                      <!-- OCaml identifiers. -->+<!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*">                            <!-- OCaml uppercase identifiers. -->+<!ENTITY ESC    "(\\[ntbr'&quot;\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->+<!ENTITY DEC    "[0-9][0-9_]*">                                     <!-- Decimal digits with underscores. -->+]>+<language name="FSharp" version="0.0.1" kateversion="2.4" section="Sources" extensions="*.fs;*.fsi;*.fsx" mimetype="" priority="10" author="Bas Bossink (bas.bossink@gmail.com)" license="LGPL">++  <highlighting>+    <list name="keywords">+      <item> abstract </item>+      <item> and </item>+      <item> as </item>+      <item> assert </item>+      <item> base </item>+<!--       <item> begin </item> -->+      <item> class </item>+      <item> delegate </item>+<!--       <item> do </item> -->+<!--       <item> done </item> -->+      <item> dowcast </item>+      <item> downto </item>+      <item> elif </item>+      <item> else </item>+<!--       <item> end </item> -->+      <item> exception </item>+      <item> extern </item>+      <item> false </item>+      <item> for </item>+      <item> fun </item>+      <item> function </item>+      <item> functor </item>+      <item> global </item>+      <item> if </item>+      <item> in </item>+<!--       <item> include </item> -->+      <item> inherit </item>+      <item> inline </item>+      <item> interfaece </item>+      <item> internal </item>+      <item> lazy </item>+      <item> let </item>+      <item> match </item>+      <item> member </item>+<!--       <item> module </item> -->+      <item> mutable </item>+      <item> namespace </item>+      <item> new </item>+      <item> not </item>+      <item> null </item>+<!--       <item> object </item> -->+      <item> of </item>+<!--       <item> open </item> -->+      <item> or </item>+      <item> override </item>+      <item> private </item>+      <item> public </item>+      <item> rec </item>+      <item> ref </item>+      <item> return </item>+<!--       <item> sig </item> -->+      <item> static </item>+<!--       <item> struct </item> -->+      <item> then </item>+      <item> to </item>+      <item> true </item>+      <item> try </item>+      <item> type </item>+      <item> upcast </item>+      <item> use </item>+      <item> val </item>+      <item> void </item>+      <item> when </item>+      <item> while </item>+      <item> with </item>+      <item> yield </item>+    </list>+    <list name="core types">+      <item> bool </item>+      <item> byte </item>+      <item> sbyte </item>+      <item> int16 </item>+      <item> uint16 </item>+      <item> int </item>+      <item> uint32 </item>+      <item> int64 </item>+      <item> uint64 </item>+      <item> nativeint </item>+      <item> unativeint </item>+      <item> char </item>+      <item> string </item>+      <item> decimal </item>+      <item> unit </item>+      <item> void </item>+      <item> float32 </item>+      <item> single </item>+      <item> float </item>+      <item> double </item>+      <item> bigint </item>+      <item> option </item>+      <item> seq </item>+    </list>+    <list name="symbols">+      <item> ? </item>+    </list>+    <list name="end">+      <item> end </item>+    </list>+    <list name="sig">+      <item> sig </item>+    </list>+    <list name="struct">+      <item> struct </item>+    </list>+    <list name="object">+      <item> object </item>+    </list>+    <list name="begin">+      <item> begin </item>+    </list>+    <list name="do">+      <item> do </item>+    </list>+    <list name="done">+      <item> done </item>+    </list>+    <list name="module_environment">+      <item> module </item>+      <item> open </item>+    </list>+    <contexts>++      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">++        <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />+        <Detect2Chars context="Singleline Comment" char="/" char1="/" />++        <DetectChar attribute="Symbol" context="#stay" char="(" beginRegion="paren"/>+        <DetectChar attribute="Symbol" context="#stay" char=")" endRegion="paren"/>++        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="record"/>+        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="record"/>+        <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="&lt;" beginRegion="attribute"/>+        <Detect2Chars attribute="Symbol" context="#stay" char="&gt;" char1="]" endRegion="attribute"/>++        <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="|" beginRegion="array"/>+        <Detect2Chars attribute="Symbol" context="#stay" char="|" char1="]" endRegion="array"/>+        <DetectChar attribute="Symbol" context="#stay" char="[" beginRegion="list"/>+        <DetectChar attribute="Symbol" context="#stay" char="]" endRegion="list"/>++        <keyword attribute="Keyword" context="#stay" String="do" beginRegion="loop"/>+        <keyword attribute="Keyword" context="#stay" String="done" endRegion="loop"/>+        <keyword attribute="Directive" context="ModuleEnv" String="module_environment"/>+        <keyword attribute="Region Marker" context="Block" String="begin" beginRegion="block"/>+        <keyword attribute="Region Marker" context="Object" String="object" beginRegion="object"/>+        <keyword attribute="Region Marker" context="Sig" String="sig" beginRegion="sig"/>+        <keyword attribute="Region Marker" context="Struct" String="struct" beginRegion="struct"/>++        <RegExpr attribute="Constructor" context="#stay" String="`\s*&IDENT;"/>+        <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>+        <RegExpr attribute="Constructor" context="#stay" String="&MIDENT;"/>++        <!-- Interpreter directives. --> +        <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->+        <!-- Such lines could also be part of a method call split over two lines but     --> +        <!-- it's unlikey anyone would code like that.)                                  -->+        <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/>++        <!-- String, character and Camlp4 "quotation" constants.              --> +        <!-- Note: If you must modify the pattern for characters be precise:  -->+        <!-- single quotes have several meanings in Ocaml.                    -->+        <DetectChar attribute="String" context="String Constant" char="&quot;" />+        <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />+        <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />+        <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />++        <!-- Identifiers and keywords. --> +        <keyword attribute="Keyword" context="#stay" String="keywords" />+        <keyword attribute="Core Data Type" context="#stay" String="core types" />+        <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" />++        <!-- Numeric constants. -->+        <!-- Note that they may contain underscores. --> +        <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" />+        <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" />+        <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" />+        <RegExpr attribute="Float" context="#stay" String="-?&DEC;((\.(&DEC;)?([eE][-+]?&DEC;)?)|([eE][-+]?&DEC;))" />+        <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" />+      </context>++      <context attribute="Comment" lineEndContext="#pop" name="Singleline Comment"/>+      <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">+        <!-- Support for nested comments -->+        <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" />+        <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />+      </context>++      <context attribute="String" lineEndContext="#stay" name="String Constant">+        <DetectChar attribute="String" context="#pop" char="&quot;" />+        <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;" />+        <!-- An underscore at the end of a line in a string indicates  -->+        <!-- that the string will continue on the next line.           -->+        <RegExpr attribute="Escaped characters" context="#stay" String="\\$" />+      </context>++      <context attribute="Normal text" lineEndContext="#stay" name="Block">+        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="block"/>+        <IncludeRules context="Normal"/>+      </context>++      <context attribute="Normal text" lineEndContext="#stay" name="Sig">+        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="sig"/>+        <IncludeRules context="Normal"/>+      </context>++      <context attribute="Normal text" lineEndContext="#stay" name="Struct">+        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="struct"/>+        <IncludeRules context="Normal"/>+      </context>+      +      <context attribute="Normal text" lineEndContext="#stay" name="Object">+        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="object"/>+        <IncludeRules context="Normal"/>+      </context>+      +      <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv" fallthrough="true" fallthroughContext="#pop">+        <DetectSpaces attribute="Normal text" context="#stay"/>+        <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>+        <RegExpr attribute="Module" context="#pop" String="&MIDENT;"/>+      </context>+      +      <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv2">+        <RegExpr attribute="Module" context="#stay" String="&MIDENT;"/>+        <DetectSpaces attribute="Normal text" context="#stay"/>+        <StringDetect attribute="Keyword" context="#pop" String="."/>+      </context>+      +      <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor.           -->+      <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. -->+      <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant">+        <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char="&gt;" char1="&gt;" />+        <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />+        <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />+        <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|&gt;&gt;|&lt;&lt;)" />+        <RegExpr attribute="Escaped characters" context="#stay" String="\\&lt;:&IDENT;&lt;" />+      </context>+    </contexts>++    <itemDatas>+      <itemData name="Normal Text" defStyleNum="dsNormal"/>+      <itemData name="Identifier" defStyleNum="dsNormal"/>+      <itemData name="Symbol" defStyleNum="dsNormal"/>+      <itemData name="Keyword"  defStyleNum="dsKeyword"/>+      <itemData name="Revised Syntax Keyword"  defStyleNum="dsNormal"/>+      <itemData name="Core Data Type"  defStyleNum="dsDataType"/>+      <itemData name="Decimal"  defStyleNum="dsDecVal"/>+      <itemData name="Hexadecimal"  defStyleNum="dsBaseN"/>+      <itemData name="Octal"  defStyleNum="dsBaseN"/>+      <itemData name="Binary"  defStyleNum="dsBaseN"/>+      <itemData name="Float"  defStyleNum="dsFloat"/>+      <itemData name="Character"  defStyleNum="dsChar"/>+      <itemData name="String"  defStyleNum="dsString"/>+      <itemData name="Escaped characters"  defStyleNum="dsChar"/>+      <itemData name="Comment"  defStyleNum="dsComment"/>+      <itemData name="Camlp4 Quotation"  defStyleNum="dsString"/>+      <itemData name="Directive"  defStyleNum="dsOthers"/>+      <itemData name="Constructor" defStyleNum="dsNormal"/>+      <itemData name="Module" defStyleNum="dsNormal"/>+      <itemData name="Region Marker" defStyleNum="dsKeyword"/>+    </itemDatas>+  </highlighting>++  <general>+    <keywords casesensitive="1" />+    <comments>+      <comment name="singleLine" start="//" />+      <comment name="singleLine" start="///" />+      <comment name="multiLine" start="(*" end="*)" />+    </comments>+  </general>+</language>+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->