.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Syntax::Highlight::Engine::Kate::Template 3pm" .TH Syntax::Highlight::Engine::Kate::Template 3pm "2022-11-29" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Syntax::Highlight::Engine::Kate::Template \- a template for syntax highlighting plugins .SH "DESCRIPTION" .IX Header "DESCRIPTION" Syntax::Highlight::Engine::Kate::Template is a framework to assist authors of plugin modules. All methods to provide highlighting to the Syntax::Highlight::Engine::Kate module are there, Just no syntax definitions and callbacks. An instance of Syntax::Highlight::Engine::Kate::Template should never be created, it's meant to be sub classed only. .SH "METHODS" .IX Header "METHODS" .IP "\fBattributes\fR(\fI?$attributesref?\fR);" 4 .IX Item "attributes(?$attributesref?);" Sets and returns a reference to the attributes hash. .IP "\fBbasecontext\fR(\fI?$context?\fR);" 4 .IX Item "basecontext(?$context?);" Sets and returns the basecontext instance variable. This is the context that is used when highlighting starts. .IP "\fBcaptured\fR(\fI\f(CI$cap\fI\fR);" 4 .IX Item "captured($cap);" Puts \f(CW$cap\fR in the first element of the stack, the current context. Used when the context is dynamic. .IP "\fBcapturedGet\fR(\fI\f(CI$num\fI\fR);" 4 .IX Item "capturedGet($num);" Returns the \f(CW$num\fR'th element that was captured in the current context. .IP "\fBcapturedParse\fR(\fI\f(CI$string\fI\fR, \fI\f(CI$mode\fI\fR);" 4 .IX Item "capturedParse($string, $mode);" If \fB\f(CB$mode\fB\fR is specified, \fB\f(CB$string\fB\fR should only be one character long and numeric. \&\fBcapturedParse\fR will return the Nth captured element of the current context. .Sp If \fB\f(CB$mode\fB\fR is not specified, all occurrences of %[1\-9] will be replaced by the captured element of the current context. .IP "\fBcolumn\fR" 4 .IX Item "column" returns the column position in the line that is currently highlighted. .IP "\fBcontextdata\fR(\fI\e%data\fR);" 4 .IX Item "contextdata(%data);" Sets and returns a reference to the contextdata hash. .IP "\fBcontextInfo\fR(\fI\f(CI$context\fI\fR, \fI\f(CI$item\fI\fR);" 4 .IX Item "contextInfo($context, $item);" returns the value of several context options. \fB\f(CB$item\fB\fR can be \fBcallback\fR, \fBattribute\fR, \fBlineending\fR, \&\fBlinebeginning\fR, \fBfallthrough\fR. .IP "\fBcontextParse\fR(\fI\f(CI$plugin\fI\fR, \fI\f(CI$context\fI\fR);" 4 .IX Item "contextParse($plugin, $context);" Called by the plugins after a test succeeds. if \fB\f(CB$context\fB\fR has following values: .Sp .Vb 5 \& #pop returns to the previous context, removes to top item in the stack. Can \& also be specified as #pop#pop etc. \& #stay does nothing. \& ##.... Switches to the plugin specified in .... and assumes it\*(Aqs basecontext. \& .... Swtiches to the context specified in .... .Ve .IP "\fBdeliminators\fR(\fI?$delim?\fR);" 4 .IX Item "deliminators(?$delim?);" Sets and returns a string that is a regular expression for detecting deliminators. .IP "\fBengine\fR" 4 .IX Item "engine" Returns a reference to the Syntax::Highlight::Engine::Kate module that created this plugin. .IP "\fBfirstnonspace\fR(\fI\f(CI$string\fI\fR);" 4 .IX Item "firstnonspace($string);" returns true if the current line did not contain a non-spatial character so far and the first character in \fB\f(CB$string\fB\fR is also a spatial character. .IP "\fBformatTable\fR" 4 .IX Item "formatTable" sets and returns the instance variable \fBformat_table\fR. See also the option \fBformat_table\fR .IP "\fBhighlight\fR(\fI\f(CI$text\fI\fR);" 4 .IX Item "highlight($text);" highlights \fI\f(CI$text\fI\fR. It does so by selecting the proper callback from the \fBcommands\fR hash and invoke it. It will do so until \&\f(CW$text\fR has been reduced to an empty string. returns a paired list of snippets of text and the attribute with which they should be highlighted. .IP "\fBhighlightText\fR(\fI\f(CI$text\fI\fR);" 4 .IX Item "highlightText($text);" highlights \fI\f(CI$text\fI\fR and reformats it using the \fBformat_table\fR and \fBsubstitutions\fR .IP "\fBincludePlugin\fR(\fI\f(CI$language\fI\fR, \fI\e$text\fR);" 4 .IX Item "includePlugin($language, $text);" Includes the plugin for \fB\f(CB$language\fB\fR in the highlighting. .IP "\fBincludeRules\fR(\fI\f(CI$language\fI\fR, \fI\e$text\fR);" 4 .IX Item "includeRules($language, $text);" Includes the plugin for \fB\f(CB$language\fB\fR in the highlighting. .IP "\fBkeywordscase\fR" 4 .IX Item "keywordscase" Sets and returns the keywordscase instance variable. .IP "\fBlastchar\fR" 4 .IX Item "lastchar" return the last character that was processed. .IP "\fBlastcharDeliminator\fR" 4 .IX Item "lastcharDeliminator" returns true if the last character processed was a deliminator. .IP "\fBlinesegment\fR" 4 .IX Item "linesegment" returns the string of text in the current line that has been processed so far, .IP "\fBlinestart\fR" 4 .IX Item "linestart" returns true if processing is currently at the beginning of a line. .IP "\fBlistAdd\fR(\fI'listname'\fR, \fI\f(CI$item1\fI\fR, \fI\f(CI$item2\fI\fR ...);" 4 .IX Item "listAdd('listname', $item1, $item2 ...);" Adds a list to the 'lists' hash. .IP "\fBlists\fR(\fI?\e%lists?\fR);" 4 .IX Item "lists(?%lists?);" sets and returns the instance variable 'lists'. .IP "\fBout\fR(\fI?\e@highlightedlist?\fR);" 4 .IX Item "out(?@highlightedlist?);" sets and returns the instance variable 'out'. .IP "\fBparseResult\fR(\fI\e$text\fR, \fI\f(CI$match\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "parseResult($text, $match, $lookahaed, $column, $firstnonspace, $context, $attribute);" Called by every one of the test methods below. If the test matches, it will do a couple of subtests. If \fB\f(CB$column\fB\fR is a defined numerical value it will test if the process is at the requested column. If \fB\f(CB$firnonspace\fB\fR is true, it will test this also. Ig it is not a look ahead and all tests are passed, \fB\f(CB$match\fB\fR is then parsed and removed from \fB$$text\fR. .IP "\fBpluginGet\fR(\fI\f(CI$language\fI\fR);" 4 .IX Item "pluginGet($language);" Returns a reference to a plugin object for the specified language. Creating an instance if needed. .IP "\fBreset\fR" 4 .IX Item "reset" Resets the highlight engine to a fresh state, does not change the syntx. .IP "\fBsnippet\fR" 4 .IX Item "snippet" Contains the current snippet of text that will have one attribute. The moment the attribute changes it will be parsed. .IP "\fBsnippetAppend\fR(\fI\f(CI$string\fI\fR)" 4 .IX Item "snippetAppend($string)" appends \fI\f(CI$string\fI\fR to the current snippet. .IP "\fBsnippetAttribute\fR(\fI\f(CI$attribute\fI\fR)" 4 .IX Item "snippetAttribute($attribute)" Sets and returns the used attribute. .IP "\fBsnippetForce\fR" 4 .IX Item "snippetForce" Forces the current snippet to be parsed. .IP "\fBsnippetParse\fR(\fI\f(CI$text\fI\fR, \fI?$attribute?\fR)" 4 .IX Item "snippetParse($text, ?$attribute?)" If attribute is defined and differs from the current attribute it does a snippetForce and sets the current attribute to \fB\f(CB$attribute\fB\fR. Then it does a snippetAppend of \fB\f(CB$text\fB\fR .IP "\fBstack\fR" 4 .IX Item "stack" sets and returns the instance variable 'stack', a reference to an array .IP "\fBstackPull\fR" 4 .IX Item "stackPull" retrieves the element that is on top of the stack, decrements stacksize by 1. .IP "\fBstackPush\fR(\fI\f(CI$tagname\fI\fR);" 4 .IX Item "stackPush($tagname);" puts \fI\f(CI$tagname\fI\fR on top of the stack, increments stacksize by 1 .IP "\fBstackTop\fR" 4 .IX Item "stackTop" Retrieves the element that is on top of the stack. .IP "\fBstateCompare\fR(\fI\e@state\fR)" 4 .IX Item "stateCompare(@state)" Compares two lists, \e@state and the stack. returns true if they match. .IP "\fBstateGet\fR" 4 .IX Item "stateGet" Returns a list containing the entire stack. .IP "\fBstateSet\fR(\fI\f(CI@list\fI\fR)" 4 .IX Item "stateSet(@list)" Accepts \fI\f(CI@list\fI\fR as the current stack. .IP "\fBsubstitutions\fR" 4 .IX Item "substitutions" sets and returns a reference to the substitutions hash. .PP The methods below all return a boolean value. .IP "\fBtestAnyChar\fR(\fI\e$text\fR, \fI\f(CI$string\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testAnyChar($text, $string, $insensitive, $lookahaed, $column, $firstnonspace, $context, $attribute);" .PD 0 .IP "\fBtestDetectChar\fR(\fI\e$text\fR, \fI\f(CI$char\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$dynamic\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testDetectChar($text, $char, $insensitive, $dynamic, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestDetect2Chars\fR(\fI\e$text\fR, \fI\f(CI$char1\fI\fR, \fI\f(CI$char2\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$dynamic\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testDetect2Chars($text, $char1, $char2, $insensitive, $dynamic, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestDetectIdentifier\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testDetectIdentifier($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestDetectSpaces\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testDetectSpaces($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestFloat\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testFloat($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestHlCChar\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testHlCChar($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestHlCHex\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testHlCHex($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestHlCOct\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testHlCOct($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestHlCStringChar\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testHlCStringChar($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestInt\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testInt($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestKeyword\fR(\fI\e$text\fR, \fI\f(CI$list\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testKeyword($text, $list, $insensitive, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestLineContinue\fR(\fI\e$text\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testLineContinue($text, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestRangeDetect\fR(\fI\e$text\fR, \fI\f(CI$char1\fI\fR, \fI\f(CI$char2\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testRangeDetect($text, $char1, $char2, $insensitive, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestRegExpr\fR(\fI\e$text\fR, \fI\f(CI$reg\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$dynamic\fI\fR, \fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testRegExpr($text, $reg, $insensitive, $dynamic, $lookahaed, $column, $firstnonspace, $context, $attribute);" .IP "\fBtestStringDetect\fR(\fI\e$text\fR, \fI\f(CI$string\fI\fR, \fI\f(CI$insensitive\fI\fR, \fI\f(CI$dynamic\fI\fR, I\fI\f(CI$lookahaed\fI\fR, \fI\f(CI$column\fI\fR, \fI\f(CI$firstnonspace\fI\fR, \fI\f(CI$context\fI\fR, \fI\f(CI$attribute\fI\fR);" 4 .IX Item "testStringDetect($text, $string, $insensitive, $dynamic, I$lookahaed, $column, $firstnonspace, $context, $attribute);" .PD .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" All the people who wrote Kate and the syntax highlight xml files. .SH "AUTHOR AND COPYRIGHT" .IX Header "AUTHOR AND COPYRIGHT" This module is written and maintained by: .PP Hans Jeuken < haje at toneel dot demon dot nl > .PP Copyright (c) 2006 by Hans Jeuken, all rights reserved. .PP You may freely distribute and/or modify this module under same terms as Perl itself .SH "SEE ALSO" .IX Header "SEE ALSO" Synax::Highlight::Engine::Kate http:://www.kate\-editor.org