{- This module was generated from data in the Kate syntax highlighting file changelog.xml, version 1.04,
by Dominik Haumann (dhdev@gmx.de) -}moduleText.Highlighting.Kate.Syntax.Changelog(highlight,parseExpression,syntaxName,syntaxExtensions)whereimportText.Highlighting.Kate.DefinitionsimportText.Highlighting.Kate.CommonimportText.ParserCombinators.ParsecimportControl.Monad(when)importData.Map(fromList)importData.Maybe(fromMaybe,maybeToList)-- | Full name of language.syntaxName::StringsyntaxName="ChangeLog"-- | Filename extensions for this language.syntaxExtensions::StringsyntaxExtensions="ChangeLog"-- | Highlight source code using this syntax definition.highlight::String->EitherString[SourceLine]highlightinput=caserunParserparseSourcestartingState"source"inputofLefterr->Left$showerrRightresult->Rightresult-- | Parse an expression using appropriate local context.parseExpression::GenParserCharSyntaxStateLabeledSourceparseExpression=dost<-getStateletoldLang=synStLanguagestsetState$st{synStLanguage="ChangeLog"}context<-currentContext<|>(pushContext"Normal">>currentContext)result<-parseRulescontextupdateState$\st->st{synStLanguage=oldLang}returnresultparseSource=dolineContents<-lookAheadwholeLineupdateState$\st->st{synStCurrentLine=lineContents}result<-manyTillparseSourceLineeofreturn$mapnormalizeHighlightingresultstartingState=SyntaxState{synStContexts=fromList[("ChangeLog",["Normal"])],synStLanguage="ChangeLog",synStCurrentLine="",synStCharsParsedInLine=0,synStPrevChar='\n',synStCaseSensitive=True,synStKeywordCaseSensitive=True,synStCaptures=[]}parseSourceLine=manyTillparseExpressionInternalpEndLinepEndLine=dolookAhead$newline<|>(eof>>return'\n')context<-currentContextcasecontextof"Normal"->return()>>pHandleEndLine"line"->(popContext)>>pEndLine"entry"->(popContext)>>pEndLine_->pHandleEndLinewithAttributeattrtxt=dowhen(nulltxt)$fail"Parser matched no text"letlabs=attr:maybeToList(lookupattrstyles)st<-getStateletoldCharsParsed=synStCharsParsedInLinestletprevchar=ifnulltxtthen'\n'elselasttxtupdateState$\st->st{synStCharsParsedInLine=oldCharsParsed+lengthtxt,synStPrevChar=prevchar}return(labs,txt)styles=[("Name","kw"),("E-Mail","ot"),("Date","dt"),("Entry","dv")]parseExpressionInternal=docontext<-currentContextparseRulescontext<|>(pDefault>>=withAttribute(fromMaybe""$lookupcontextdefaultAttributes))regex_'5cd'5cd'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a=compileRegex"\\d\\d\\d\\d\\s*-\\s*\\d\\d\\s*-\\s*\\d\\d\\s*"regex_'28'5cw'5cs'2a'29'2b=compileRegex"(\\w\\s*)+"regex_'3c'2e'2a'3e'5cs'2a'24=compileRegex"<.*>\\s*$"regex_'2e'2a'3a=compileRegex".*:"defaultAttributes=[("Normal","Normal Text"),("line","Normal Text"),("entry","Normal Text")]parseRules"Normal"=do(attr,result)<-(((pFirstNonSpace>>pDetectCharFalse'*'>>=withAttribute"Entry")>>~pushContext"entry")<|>((pColumn0>>pRegExprregex_'5cd'5cd'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a'2d'5cs'2a'5cd'5cd'5cs'2a>>=withAttribute"Date")>>~pushContext"line"))return(attr,result)parseRules"line"=do(attr,result)<-(((pRegExprregex_'28'5cw'5cs'2a'29'2b>>=withAttribute"Name"))<|>((pRegExprregex_'3c'2e'2a'3e'5cs'2a'24>>=withAttribute"E-Mail")>>~(popContext)))return(attr,result)parseRules"entry"=do(attr,result)<-((pRegExprregex_'2e'2a'3a>>=withAttribute"Entry")>>~(popContext))return(attr,result)parseRulesx=fail$"Unknown context"++x