<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
	<!ENTITY n1 "[A-Za-z0-9_/.-]">
	<!ENTITY notnmy "(?![nmy]([^A-Za-z0-9_/.-]|$))">
	<!ENTITY badCom "[^ \t#A-Za-z0-9_&quot;']">
	<!ENTITY badParam "[^ \t#A-Za-z0-9_/.&quot;'&amp;&lt;&gt;\|\(\)!=-]">
]>

<!--

Kate Kconfig highlighting definition

This is for Kconfig files of LKC (LinuxKernelConf), the configuration system
that is in use by and maintained with the Linux Kernel since release 2.5.45,
i.e. in particular throughout all 2.6 release series and the 3.x releases so far
(up to 3.15 as of this writing, or to be honest 3.15-rc5).

There have been several minor syntax modifications since Linux Kernel 2.5.45,
and it is likely that there will be more in the future. Therefore, the version
number of this file corresponds to the version number of the Linux Kernel with
the latest changes that have been adapted.

When it comes to details, the language of LKC is extremely complicated. At the
same time this definition aims to be precise. As a result it is very long and
massively uses regular expressions. Hence you may notice high cpu usage when
opening large files, depending on your hardware.

When editing Kconfig files keep in mind that this definition targets the syntax
as found in a specific release.

There are other projects that use the same configuration system:
busybox http://busybox.net/, uClibc (http://www.uclibc.org/),
OpenWrt (https://openwrt.org/) and many more. Of course you can use this
definition also for those configuration files, but be aware that the versions of
LKC in those projects may be highly outdated. Sporadically you can even find
project specific syntax modifications that have never been part of upstream LKC.

If you are interested in the standalone configuration system (e.g. for your own
project) stripped from the Linux kernel, take a look at kconfig-frontends
(http://ymorin.is-a-geek.org/projects/kconfig-frontends).
(As of this writing that project is two releases behind, not sure if it is
still maintained.)

Newer changes in the configuration language:

2.6.18:
- add "option" for config blocks (first options: "modules" and "defconfig_list")
2.6.24:
- remove "requires" (synonymous for "depends on", hardly ever used)
- remove "depends" (without "on", also synonymous for "depends on", was rare)
- remove "def_boolean" (synonymous for "def_bool", hardly ever used)
2.6.25:
- add option "env=..." to import values of environment variables
- remove "enable" property (you have probably never seen this one)
2.6.26
- add named choice groups like choice "FOO" (hardly ever seen, buggy, avoid it)
2.6.37:
- reduce "mainmenu" to occur only as first statement
- add "visible if" property to menus
3.15:
- add option "allnoconfig_yes"
4.2:
- add <=, >=, <, > operators

-->

<language name="Kconfig" section="Configuration" extensions="Kconfig*" version="9" kateversion="5.62" casesensitive="true" priority="0" author="Martin Walch (walch.martin@web.de)" license="GPLv3">

	<highlighting>
		<list name="choice_type">
			<item>bool</item>
			<item>boolean</item>
			<item>tristate</item>
		</list>

		<list name="def_type">
			<item>def_bool</item>
			<item>def_tristate</item>
		</list>

		<list name="choice_bad_type">
			<item>string</item>
			<item>int</item>
			<item>hex</item>
		</list>

		<list name="type">
			<item>bool</item>
			<item>boolean</item>
			<item>tristate</item>
			<item>string</item>
			<item>int</item>
			<item>hex</item>
		</list>

		<list name="config">
			<item>config</item>
			<item>menuconfig</item>
		</list>

		<list name="entry">
			<item>if</item>
			<item>comment</item>
			<item>config</item>
			<item>menuconfig</item>
			<item>source</item>
		</list>

		<list name="keyword">
			<item>mainmenu</item>
			<item>menu</item>
			<item>endmenu</item>
			<item>source</item>
			<item>choice</item>
			<item>endchoice</item>
			<item>comment</item>
			<item>config</item>
			<item>menuconfig</item>
			<item>help</item>
			<item>if</item>
			<item>endif</item>
			<item>depends</item>
			<item>optional</item>
			<item>default</item>
			<item>prompt</item>
			<item>tristate</item>
			<item>def_tristate</item>
			<item>bool</item>
			<item>boolean</item>
			<item>def_bool</item>
			<item>int</item>
			<item>hex</item>
			<item>string</item>
			<item>select</item>
			<item>imply</item>
			<item>range</item>
			<item>visible</item>
			<item>option</item>
			<item>on</item>
			<item>modules</item>
			<item>defconfig_list</item>
			<item>env</item>
			<item>allnoconfig_y</item>
		</list>

		<list name="entry_keyword">
			<item>menu</item>
			<item>endmenu</item>
			<item>source</item>
			<item>choice</item>
			<item>endchoice</item>
			<item>comment</item>
			<item>config</item>
			<item>menuconfig</item>
			<item>if</item>
			<item>endif</item>
		</list>

		<list name="option">
			<item>defconfig_list</item>
			<item>allnoconfig_y</item>
			<item>modules</item>
		</list>

		<list name="default_value">
			<item>y</item>
			<item>m</item>
			<item>n</item>
		</list>

		<contexts>
			<context name="input" attribute="plain" lineEndContext="#stay" fallthroughContext="#pop!stmt_list">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="mainmenu" attribute="keyword" context="mainmenuPrompt" />
			</context>

			<context name="mainmenuPrompt" attribute="plain" lineEndContext="#pop!stmt_list.error" fallthroughContext="#pop!stmt_list.error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedMainmenuPrompt" context="#pop!stmt_list.nl.SQMainmenuPrompt" />
				<DetectChar char="&quot;" attribute="quotedMainmenuPrompt" context="#pop!stmt_list.nl.DQMainmenuPrompt" />
				<RegExpr String="&n1;+" attribute="unquotedMainmenuPrompt" context="#pop!stmt_list.nl" />
			</context>

			<context name="stmt_list.nl.SQMainmenuPrompt" attribute="quotedMainmenuPrompt" lineEndContext="#pop!stmt_list.error">
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="quoted.variable" />
				<DetectChar char="'" attribute="quotedMainmenuPrompt" context="#pop!stmt_list.nl" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="quoted.variable" attribute="symbolVar" lineEndContext="#pop" fallthroughContext="#pop">
				<DetectIdentifier context="#pop" />
			</context>

			<context name="stmt_list.nl.DQMainmenuPrompt" attribute="quotedMainmenuPrompt" lineEndContext="#pop!stmt_list.error">
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="quoted.variable" />
				<DetectChar char="&quot;" attribute="quotedMainmenuPrompt" context="#pop!stmt_list.nl" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="stmt_list.nl" attribute="plain" lineEndContext="#pop!stmt_list" fallthroughContext="#pop!stmt_list.error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<!-- Mainmenu over -->

			<context name="source_stmt" attribute="source" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedSourceString" context="#pop!nl.SQStringSource" />
				<DetectChar char="&quot;" attribute="quotedSourceString" context="#pop!nl.DQStringSource" />
				<RegExpr String="&n1;+" attribute="unquotedSourceString" context="#pop" />
			</context>

			<context name="nl.SQStringSource" attribute="quotedSourceString" lineEndContext="stmt_list.error">
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="quoted.variable" />
				<DetectChar char="'" attribute="quotedSourceString" context="#pop!nl" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="nl.DQStringSource" attribute="quotedSourceString" lineEndContext="stmt_list.error">
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="quoted.variable" />
				<DetectChar char="&quot;" attribute="quotedSourceString" context="#pop!nl" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="choice_entry" attribute="plain" lineEndContext="#pop!choice_option_list" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<RegExpr String="&n1;+" attribute="symbolVar" context="choice_option_list.nl" />
			</context>

			<context name="choice_option_list.nl" attribute="plain" lineEndContext="#pop!choice_option_list" fallthroughContext="#pop!choice_option_list.error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="choice_option_list" attribute="plain" lineEndContext="#stay" fallthroughContext="error" >
				<IncludeRules context="wsOrComment" />
				<WordDetect String="prompt" attribute="property" context="ifOpt.prompt" />
				<keyword String="choice_type" attribute="type" context="ifOpt.prompt_stmt_opt" />
				<keyword String="choice_bad_type" attribute="badType" context="ifOpt.prompt_stmt_opt" />
				<WordDetect String="optional" attribute="property" context="nl" />
				<WordDetect String="default" attribute="property" context="ifOpt.symbolVar" />
				<WordDetect String="depends" attribute="property" context="depends" />
				<WordDetect String="help" attribute="property" context="helpEntry" beginRegion="help" />
				<StringDetect String="---help---" attribute="property" context="helpEntry" beginRegion="help" />
				<keyword String="entry" lookAhead="true" context="#pop!choice_block" />
				<WordDetect String="endchoice" attribute="keyword" context="#pop!nl" endRegion="choice_stmt" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="choice_block" attribute="plain" lineEndContext="#stay" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="common_stmt" />
				<WordDetect String="endchoice" attribute="keyword" context="#pop!nl" endRegion="choice_stmt" />
			</context>

			<context name="depends" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<WordDetect String="on" attribute="property" context="#pop!nl.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="ifOpt.prompt_stmt_opt" attribute="plain" lineEndContext="#pop">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!ifOpt.SQPrompt" />
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!ifOpt.DQPrompt" />
				<RegExpr String="&n1;+" attribute="unquotedPrompt" context="#pop!ifOpt" />
			</context>

			<context name="ifOpt" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<WordDetect String="if" attribute="keyword" context="#pop!nl.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="nl" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="ifOpt.prompt" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!ifOpt.SQPrompt" />
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!ifOpt.DQPrompt" />
				<RegExpr String="&n1;+" attribute="unquotedPrompt" context="#pop!ifOpt" />
			</context>

			<context name="ifOpt.SQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error" >
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!ifOpt" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.DQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error" >
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!ifOpt" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="menu_visList.nl.SQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error">
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!menu_visList.nl" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="menu_visList.nl.DQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error">
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!menu_visList.nl" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="comment_stmt.nl.prompt" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!comment_stmt.nl.SQPrompt" />
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!comment_stmt.nl.DQPrompt" />
				<RegExpr String="&n1;+" attribute="unquotedPrompt" context="#pop!comment_stmt.nl" />
			</context>

			<context name="comment_stmt.nl.SQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error" >
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!comment_stmt.nl" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="comment_stmt.nl.DQPrompt" attribute="quotedPrompt" lineEndContext="#pop!error" >
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!comment_stmt.nl" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="comment_stmt.nl" attribute="plain" lineEndContext="#pop!comment_stmt" fallthroughContext="error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="comment_stmt" attribute="plain" lineEndContext="#stay" fallthroughContext="error">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="depends" attribute="property" context="depends" />
				<keyword String="entry_keyword" attribute="property" lookAhead="true" endRegion="comment_stmt" context="#pop" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="config_entry_start" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<RegExpr String="&n1;+" attribute="symbolVar" context="#pop!config_option_list.nl" />
			</context>

			<context name="config_option_list.nl" attribute="plain" lineEndContext="#pop!config_option_list" fallthroughContext="#pop!config_option_list.error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="config_option_list" attribute="plain" lineEndContext="#stay" fallthroughContext="error">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="prompt" attribute="property" context="ifOpt.prompt" />
				<keyword String="type" attribute="type" context="ifOpt.prompt_stmt_opt" />
				<WordDetect String="default" attribute="property" context="ifOpt.expr" />
				<keyword String="def_type" attribute="property" context="ifOpt.expr.type" lookAhead="1" />
				<WordDetect String="depends" attribute="property" context="depends" />
				<WordDetect String="select" attribute="property" context="ifOpt.symbolVar" />
				<WordDetect String="imply" attribute="property" context="ifOpt.symbolVar" />
				<WordDetect String="range" attribute="property" context="range" />
				<WordDetect String="help" attribute="property" context="helpEntry" beginRegion="help" />
				<StringDetect String="---help---" attribute="property" context="helpEntry" beginRegion="help" />
				<WordDetect String="option" attribute="keyword" context="option" />
				<keyword String="entry_keyword" attribute="property" lookAhead="true" context="#pop" endRegion="config_stmt" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="ifOpt.expr.type" attribute="plain" lineEndContext="#pop!error">
				<StringDetect String="def_" attribute="property" context="#stay" />
				<StringDetect String="bool" attribute="type" context="#pop!ifOpt.expr" />
				<StringDetect String="tristate" attribute="type" context="#pop!ifOpt.expr" />
			</context>

			<context name="option" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<keyword String="option" attribute="option" context="optionWithoutValue" />
				<WordDetect String="env" attribute="option" context="optionValue.eq" />
				<RegExpr String="&n1;+" attribute="unknownOption" context="optionValue.eq" />
			</context>

			<context name="optionValue.eq" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="=" attribute="optionEq" context="#pop!optionValue" />
			</context>

			<context name="optionWithoutValue" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<DetectSpaces />
			</context>

			<context name="SQStringOptionValue" attribute="quotedOptionValue" lineEndContext="#pop!error" >
				<DetectChar char="'" attribute="quotedOptionValue" context="#pop" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="DQStringOptionValue" attribute="quotedOptionValue" lineEndContext="#pop!error" >
				<DetectChar char="&quot;" attribute="quotedOptionValue" context="#pop" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="optionValue" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedOptionValue" context="#pop!SQStringOptionValue" />
				<DetectChar char="&quot;" attribute="quotedOptionValue" context="#pop!DQStringOptionValue" />
				<RegExpr String="&n1;+" attribute="unquotedOptionValue" context="#pop" />
			</context>

			<context name="ifOpt.symbolVar" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<RegExpr String="&notnmy;&n1;+" attribute="symbolVar" context="#pop!ifOpt" />
				<AnyChar String="nmy" attribute="badTristateConst" context="#pop!ifOpt.binOpOrEnd" />
			</context>

			<context name="range" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt.sym.SQSymbolConst" />
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt.sym.DQSymbolConst" />
				<RegExpr String="&n1;+" attribute="symbolVar" context="#pop!ifOpt.sym" />
			</context>

			<context name="ifOpt.sym" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt.SQSymbolConst" />
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt.DQSymbolConst" />
				<RegExpr String="&n1;+" attribute="symbolVar" context="#pop!ifOpt" />
			</context>

			<context name="ifOpt.sym.SQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error" >
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt.sym" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.sym.DQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error" >
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt.sym" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.SQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error" >
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.DQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error" >
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="menu_entry" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<DetectChar char="'" attribute="quotedPrompt" context="#pop!menu_visList.nl.SQPrompt" />
				<DetectChar char="&quot;" attribute="quotedPrompt" context="#pop!menu_visList.nl.DQPrompt" />
				<RegExpr String="&n1;+" attribute="unquotedPrompt" context="#pop!menu_visList.nl" />
			</context>

			<context name="menu_visList.nl" attribute="plain" lineEndContext="#pop!menu_visList" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="menu_visList" attribute="plain" lineEndContext="#stay" fallthroughContext="#pop!menu_depList">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="visible" attribute="property" context="visible" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="visible" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="if" attribute="property" context="#pop!nl.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="menu_depList" attribute="plain" lineEndContext="#stay" fallthroughContext="#pop!menu_stmt">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="depends" attribute="property" context="depends" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="menu_stmt" attribute="plain" lineEndContext="#stay" fallthroughContext="error">
				<IncludeRules context="stmt_list" />
				<WordDetect String="endmenu" attribute="keyword" context="#pop!nl" endRegion="menu_stmt" />
			</context>

			<context name="if_stmt" attribute="plain" lineEndContext="#stay">
				<IncludeRules context="wsOrComment" />
				<IncludeRules context="stmt_list" />
				<WordDetect String="endif" attribute="keyword" context="#pop" endRegion="if_stmt" />
			</context>

			<context name="stmt_list" attribute="plain" lineEndContext="#stay" fallthroughContext="error">
				<IncludeRules context="common_stmt" />
				<WordDetect String="choice" attribute="keyword" context="choice_entry" beginRegion="choice_stmt" />
				<WordDetect String="menu" attribute="keyword" context="menu_entry" beginRegion="menu_stmt" />
			</context>

			<context name="choice_option_list.error" attribute="error" lineEndContext="#pop!choice_option_list" />
			<context name="config_option_list.error" attribute="error" lineEndContext="#pop!config_option_list" />
			<context name="stmt_list.error" attribute="error" lineEndContext="#pop!stmt_list" />
			<context name="error" attribute="error" lineEndContext="#pop" />

			<!-- expressions -->
			<context name="nl.expr" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<Detect2Chars char="(" char1=")" attribute="exprOp" context="#pop!nl.emptyParenthesesInstance" lookAhead="1" />
				<DetectChar char="(" attribute="exprOp" context="#pop!nl.parenthesesInstance" beginRegion="parentheses" />
				<DetectChar char="!" attribute="exprOp" context="#stay" />
				<DetectChar char="'" attribute="symbolConst" context="#pop!nl.binOpOrEnd.SQSymbolConst" />
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!nl.binOpOrEnd.DQSymbolConst" />
				<keyword String="keyword" context="#pop!error" />
				<keyword String="default_value" attribute="tristateConst" context="#pop!nl.binOpOrEnd" />
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="expr.$" />
				<RegExpr String="&n1;+" attribute="symbolVar" context="#pop!nl.binOpOrEnd" />
			</context>

			<context name="nl.emptyParenthesesInstance" attribute="plain" lineEndContext="#stay">
				<DetectChar char="(" attribute="exprOp" context="#pop!error" />
			</context>

			<context name="nl.binOpOrEnd" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!nl">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<DetectChar char=")" lookAhead="true" context="#pop" />
				<Detect2Chars char="&amp;" char1="&amp;" attribute="exprOp" context="#pop!nl.expr" />
				<Detect2Chars char="|" char1="|" attribute="exprOp" context="#pop!nl.expr" />
				<DetectChar char="=" attribute="exprOp" context="#pop!nl.expr" />
				<Detect2Chars char="!" char1="=" attribute="exprOp" context="#pop!nl.expr" />
				<Detect2Chars char="&lt;" char1="=" attribute="exprOp" context="#pop!nl.expr" />
				<Detect2Chars char="&gt;" char1="=" attribute="exprOp" context="#pop!nl.expr" />
				<DetectChar char="&lt;" attribute="exprOp" context="#pop!nl.expr" />
				<DetectChar char="&gt;" attribute="exprOp" context="#pop!nl.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="nl.binOpOrEnd.SQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="'" attribute="symbolConst" context="#pop!nl.binOpOrEnd" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="nl.binOpOrEnd.DQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!nl.binOpOrEnd" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.expr" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<Detect2Chars char="(" char1=")" attribute="exprOp" context="#pop!nl.emptyParenthesesInstance" lookAhead="1" />
				<DetectChar char="(" attribute="exprOp" context="#pop!ifOpt.parenthesesInstance" beginRegion="parentheses" />
				<DetectChar char="!" context="#stay" />
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt.binOpOrEnd.SQSymbolConst" />
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt.binOpOrEnd.DQSymbolConst" />
				<keyword String="keyword" attribute="error" context="#pop!error" />
				<RegExpr String="&notnmy;&n1;+" attribute="symbolVar" context="#pop!ifOpt.binOpOrEnd" />
				<AnyChar String="nmy" attribute="tristateConst" context="#pop!ifOpt.binOpOrEnd" />
				<Detect2Chars char="$" char1="(" attribute="symbolVar" context="expr.$" />
			</context>

			<context name="expr.$" attribute="plain" lineEndContext="#pop#pop!error">
				<DetectIdentifier />
				<DetectSpaces />
				<DetectChar char=")" attribute="symbolVar" context="#pop" />
				<DetectChar char="," attribute="exprOp" context="#stay" />
				<DetectChar char="'" attribute="quotedOptionValue" context="SQStringOptionValue" />
				<DetectChar char="&quot;" attribute="quotedOptionValue" context="DQStringOptionValue" />
			</context>

			<context name="ifOpt.binOpOrEnd" attribute="plain" lineEndContext="#pop" fallthroughContext="#pop!ifOpt">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<DetectChar char=")" lookAhead="true" attribute="exprOp" context="#pop" />
				<Detect2Chars char="&amp;" char1="&amp;" attribute="exprOp" context="#pop!ifOpt.expr" />
				<Detect2Chars char="|" char1="|" attribute="exprOp" context="#pop!ifOpt.expr" />
				<DetectChar char="=" attribute="exprOp" context="#pop!ifOpt.expr" />
				<Detect2Chars char="!" char1="=" attribute="exprOp" context="#pop!ifOpt.expr" />
				<Detect2Chars char="&lt;" char1="=" attribute="exprOp" context="#pop!ifOpt.expr" />
				<Detect2Chars char="&gt;" char1="=" attribute="exprOp" context="#pop!ifOpt.expr" />
				<DetectChar char="&lt;" attribute="exprOp" context="#pop!ifOpt.expr" />
				<DetectChar char="&gt;" attribute="exprOp" context="#pop!ifOpt.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="ifOpt.binOpOrEnd.SQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="'" attribute="symbolConst" context="#pop!ifOpt.binOpOrEnd" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="ifOpt.binOpOrEnd.DQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!ifOpt.binOpOrEnd" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="if_stmt.nl.expr" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop!error">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<Detect2Chars char="(" char1=")" attribute="exprOp" context="#pop!nl.emptyParenthesesInstance" lookAhead="1" />
				<DetectChar char="(" attribute="exprOp" context="#pop!if_stmt.nl.parenthesesInstance" beginRegion="parentheses" />
				<DetectChar char="!" context="#stay" />
				<DetectChar char="'" attribute="symbolConst" context="#pop!if_stmt.nl.binOpOrEnd.SQSymbolConst" />
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!if_stmt.nl.binOpOrEnd.DQPlainSymbolConst" />
				<keyword String="keyword" context="#pop!error" />
				<RegExpr String="&notnmy;&n1;+" attribute="symbolVar" context="#pop!if_stmt.nl.binOpOrEnd" />
				<AnyChar String="nmy" attribute="tristateConst" context="#pop!if_stmt.nl.binOpOrEnd" />
			</context>

			<context name="if_stmt.nl.binOpOrEnd" attribute="plain" lineEndContext="#pop!if_stmt" fallthroughContext="#pop!nl">
				<IncludeRules context="wsOrComment" />
				<LineContinue context="#stay" />
				<DetectChar char=")" lookAhead="true" attribute="exprOp" context="#pop" />
				<Detect2Chars char="&amp;" char1="&amp;" attribute="exprOp" context="#pop!if_stmt.nl.expr" />
				<Detect2Chars char="|" char1="|" attribute="exprOp" context="#pop!if_stmt.nl.expr" />
				<DetectChar char="=" attribute="exprOp" context="#pop!if_stmt.nl.expr" />
				<Detect2Chars char="!" char1="=" attribute="exprOp" context="#pop!if_stmt.nl.expr" />
				<IncludeRules context="ignoreBadParamChars" />
			</context>

			<context name="if_stmt.nl.binOpOrEnd.SQSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="'" attribute="symbolConst" context="#pop!if_stmt.nl.binOpOrEnd" />
				<Detect2Chars char="\" char1="'" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="if_stmt.nl.binOpOrEnd.DQPlainSymbolConst" attribute="symbolConst" lineEndContext="#pop!error">
				<DetectChar char="&quot;" attribute="symbolConst" context="#pop!if_stmt.nl.binOpOrEnd" />
				<Detect2Chars char="\" char1="&quot;" attribute="escapeQuotedPrompt" context="#stay" />
			</context>

			<context name="nl.parenthesesInstance" attribute="plain" lineEndContext="#stay" fallthroughContext="nl.expr">
				<DetectChar char=")" attribute="exprOp" context="#pop!nl.binOpOrEnd" endRegion="parentheses" />
			</context>

			<context name="ifOpt.parenthesesInstance" attribute="plain" lineEndContext="#stay" fallthroughContext="ifOpt.expr">
				<DetectChar char=")" attribute="exprOp" context="#pop!ifOpt.binOpOrEnd" endRegion="parentheses" />
			</context>

			<context name="if_stmt.nl.parenthesesInstance" attribute="plain" lineEndContext="#stay" fallthroughContext="nl.expr">
				<DetectChar char=")" attribute="exprOp" context="#pop!if_stmt.nl.binOpOrEnd" endRegion="parentheses" />
			</context>

			<context name="helpEntry" attribute="helpText" lineEndContext="#pop!helpDetectIndentation" fallthroughContext="#pop!error">
				<DetectSpaces />
			</context>

			<context name="helpDetectIndentation" attribute="helpText" lineEndContext="#pop!firstLineWasNotIndented" fallthroughContext="#pop!error">
				<IncludeRules context="firstLineWasNotIndented" />
			</context>

			<context name="firstLineWasNotIndented" attribute="helpText" lineEndContext="#stay" fallthroughContext="#pop!endHelp">
				<RegExpr String="^([ \t]+).*" attribute="helpText" context="#pop!helpIndent" column="0" />
			</context>

			<context name="helpIndent" attribute="helpText" lineEndContext="#stay" fallthroughContext="#pop!endHelp">
				<StringDetect String="%1" dynamic="1" attribute="helpText" context="helpText" />
				<DetectSpaces attribute="helpText" context="helpIndentSpaces"/>
			</context>

			<context name="helpIndentSpaces" attribute="helpText" lineEndContext="#pop" fallthroughContext="#pop#pop!endHelp"/>

			<context name="helpText" attribute="helpText" lineEndContext="#pop"/>

			<context name="endHelp" attribute="helpText" lineEndContext="#pop" >
				<RegExpr String="." lookAhead="true" attribute="helpText" context="#pop" endRegion="help" />
			</context>

			<!-- only as included rules -->
			<context name="common_stmt" attribute="plain" lineEndContext="#pop!error" fallthroughContext="#pop">
				<IncludeRules context="wsOrComment" />
				<WordDetect String="if" attribute="keyword" context="if_stmt.nl.expr" beginRegion="if_stmt" />
				<WordDetect String="comment" attribute="keyword" context="comment_stmt.nl.prompt" beginRegion="comment_stmt" />
				<keyword String="config" attribute="keyword" context="config_entry_start" beginRegion="config_stmt" />
				<WordDetect String="source" attribute="source" context="source_stmt" />
				<IncludeRules context="ignoreBadComChars" />
			</context>

			<context name="wsOrComment" attribute="plain" lineEndContext="#stay">
				<DetectSpaces />
				<DetectChar char="#" lookAhead="true" context="lineComment" />
			</context>

			<context name="ignoreBadComChars" attribute="badChar" lineEndContext="#stay">
				<RegExpr String="&badCom;+" attribute="badChar" context="#stay" />
			</context>

			<context name="ignoreBadParamChars" attribute="badChar" lineEndContext="#stay">
				<RegExpr String="&badParam;+" attribute="badChar" context="#stay" />
			</context>

			<context name="lineComment" attribute="comment" lineEndContext="#pop">
				<DetectSpaces />
				<IncludeRules context="##Comments" />
			</context>
		</contexts>
		<itemDatas>
			<itemData name="plain" defStyleNum="dsNormal" spellChecking="true" />
			<itemData name="helpText" defStyleNum="dsVerbatimString" spellChecking="true" />
			<itemData name="unquotedPrompt" defStyleNum="dsNormal" spellChecking="true" />
			<itemData name="quotedPrompt" defStyleNum="dsString" spellChecking="true" />
			<itemData name="escapeQuotedPrompt" defStyleNum="dsSpecialChar" spellChecking="true" />
			<itemData name="symbolConst" defStyleNum="dsString" spellChecking="false" />
			<itemData name="symbolVar" defStyleNum="dsNormal" spellChecking="false" />
			<itemData name="keyword" defStyleNum="dsKeyword" spellChecking="false" />
			<itemData name="property" defStyleNum="dsOthers" spellChecking="false" />
			<itemData name="type" defStyleNum="dsDataType" spellChecking="false" />
			<itemData name="badType" defStyleNum="dsAlert" spellChecking="false" />
			<itemData name="badChar" defStyleNum="dsAlert" spellChecking="false" />
			<itemData name="error" defStyleNum="dsError" spellChecking="false" />
			<itemData name="option" defStyleNum="dsOthers" spellChecking="false" />
			<itemData name="optionEq" defStyleNum="dsOperator" spellChecking="false" />
			<itemData name="unknownOption" defStyleNum="dsNormal" italic="true" spellChecking="false" />
			<itemData name="unquotedOptionValue" defStyleNum="dsString" spellChecking="false" />
			<itemData name="quotedOptionValue" defStyleNum="dsString" spellChecking="false" />
			<itemData name="unquotedMainmenuPrompt" defStyleNum="dsString" />
			<itemData name="quotedMainmenuPrompt" defStyleNum="dsString" spellChecking="false" />
			<itemData name="unquotedSourceString" defStyleNum="dsString" spellChecking="false" />
			<itemData name="quotedSourceString" defStyleNum="dsString" spellChecking="false" />
			<itemData name="comment" defStyleNum="dsComment" spellChecking="true" />
			<itemData name="source" defStyleNum="dsOthers" spellChecking="false" />
			<itemData name="exprOp" defStyleNum="dsOperator" spellChecking="false" />
			<itemData name="tristateConst" defStyleNum="dsKeyword" spellChecking="false" />
			<itemData name="badTristateConst" defStyleNum="dsAlert" spellChecking="false" />
		</itemDatas>
	</highlighting>
	<general>
		<comments>
			<comment name="singleLine" start="#" />
		</comments>
		<keywords weakDeliminator=".-" additionalDeliminator="'&quot;"/>
	</general>
</language>
<!-- kate: replace-tabs off; -->
