<?xml version="1.0" encoding="UTF-8"?>
<!--
		Bluefish HTML Editor
		bflang2.bflang2 $Revision: 8922 $

		Copyright (C) 2008-2023 Olivier Sessink

	    This program is free software: you can redistribute it and/or modify
		it under the terms of the GNU General Public License as published by
		the Free Software Foundation, either version 3 of the License, or
		(at your option) any later version.

		This program is distributed in the hope that it will be useful,
		but WITHOUT ANY WARRANTY; without even the implied warranty of
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
		GNU General Public License for more details.

		You should have received a copy of the GNU General Public License
		along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<bflang name="Bflang2" version="3" contexts="40" matches="221">
<header>
	<mime type="application/x-bluefish-language2"/>
	<option name="load_reference" default="1"/>
	<option name="load_completion" default="1"/>
	<option name="show_in_menu" default="0" />
	<highlight name="attribute-string" style="string-no-spell-check" />
	<highlight name="attribute" style="attribute"   />
	<highlight name="comment" style="comment"  />
	<highlight name="entity" style="value"  />
	<highlight name="pattern-tag" style="special-tag"  />
	<highlight name="string" style="string"  />
	<highlight name="tag" style="tag" />
	<highlight name="markup-tag" style="special-tag2" />
</header>
<properties>
	<comment type="block" start="&lt;!--" end="--&gt;" />
	<default_spellcheck enabled="1" />
	<!--<smartselection characters="&gt;&lt;" />-->
</properties>
<definition>
<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
<element id="e.comment" pattern="&lt;!--" highlight="comment" starts_block="1">
	<context id="c.comment" symbols="-&gt; &#9;&#10;&#13;" highlight="comment">
	<element pattern="--&gt;" ends_block="1" blockstartelement="e.comment" highlight="comment" ends_context="1" />
	</context>
</element>
<element id="e.entity" pattern="&amp;[a-z0-9#]+;" is_regex="1" highlight="entity" />
<tag name="bflang" highlight="tag" attributes="name,version,table,matches,contexts" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;" >
<autocomplete append="name=&quot;&quot; version=&quot;1&quot;&gt;" />
<reference>the <i>bflang</i> tag is the root tag of the bluefish language file. It should have attribute <i>name</i> and <i>version</i>.</reference>
	<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
	<element idref="e.comment"/>
	<element idref="e.entity" />
	<tag name="header" highlight="tag" >
	<autocomplete append="&gt;" />
	<reference>The <i>header</i> tag is the region of the language file that is always loaded, regardless if the language is used or not. </reference>
		<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
		<element idref="e.comment"/>
		<element idref="e.entity" />
		<tag name="mime" highlight="tag" attributes="type" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			<autocomplete append=" type=&quot;&quot; /&gt;" />
			<reference>The <i>mime</i> tag should have attribute <i>type</i> which has the mime type. The mime type is used to find the correct language definition for a file in the editor. There can be multiple mime tags in the heading section.</reference>
		</tag>
		<tag name="option" highlight="tag" attributes="default,description,name" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			 <autocomplete append=" name=&quot;&quot; /&gt;" />
			<reference>A boolean (0 or 1) option that can be changed by the user. Each <i>class</i> or <i>notclass</i> used in the language file can be set by the user if defined as an option. Each block with a <i>block-name</i> used in the language file can be made <b>not foldable</b> if <i>`block-name`_foldable</i> is defined as an option. Options are also used if a parameter has the value option:foobar or condition:foobar?foo:bar. In the first example a 0 or 1 is used depending on the state of option foobar. In the second case foo is inserted if foobar is 1, else bar is inserted.
The default value defines the behavior if the user previously did not have this option, and the description is a human readable description on what the option does.</reference>
		</tag>
		<tag name="highlight" highlight="tag" attributes="name,style" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			<autocomplete append=" name=&quot;&quot; style=&quot;&quot; /&gt;" />
			<reference>The <i>highlight</i> tag should have attributes <i>name</i> and <i>style</i>. The tag links the types of elements that can be highlighted (called <i>highlights</i>) and <i>styles</i> that are used by multiple languages. Default styles are hardcoded in bftexdtview2_langmgr.c A user may override each highlight / style combination in the configuration and may change the looks of each style.</reference>
		</tag>
		</context>
	</tag>
	<tag name="properties" highlight="tag">
		<autocomplete append="&gt;&#10;&lt;/properties&gt;" backup_cursor="13" />
		<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;" >
			<element idref="e.comment"/>
			<element idref="e.entity" />
			<tag id="t.tagcomment" name="comment" highlight="tag" attributes="type,start,end,id" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
				<autocomplete append=" type=&quot;&quot; start=&quot;&quot; /&gt;" />
				<reference>The comment tag specifies which comment syntax is possible in this language. This is used by the 'toggle comment' feature. In some languages this is context specific (for example Javascript inside HTML has a different comment than HTML). The id attribute can be used to set a certain comment type for a certain context.</reference>
			</tag>
			<tag name="smartindent" highlight="tag" attributes="characters" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;"/>
			<tag name="smartoutdent" highlight="tag" attributes="characters" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;"/>
			<tag name="smartselection" highlight="tag" attributes="characters" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;"/>
			<tag name="default_spellcheck" highlight="tag" attributes="enabled,spell_decode_entities" attribhighlight="attribute" attrib_autocomplete_append="=&quot;1&quot;">
				<autocomplete append=" enabled=&quot;1&quot; /&gt;" />
			</tag>
		</context>
	</tag>
	<tag name="definition" highlight="tag" autocomplete_append="&gt;">
	<reference>The <i>definition</i> tag is the region of the language file that actually defines the language. This region is only loaded when a file of this type is opened in the editor.</reference>
		<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;" >
		<element idref="e.comment"/>
		<element idref="e.entity" />
		<tag name="context" id="t.context" highlight="tag" attributes="id,idref,symbols,highlight,commentid_block,commentid_line,default_spellcheck" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			<autocomplete append=" symbols=&quot;&quot; &gt;" />
<reference>Every definition starts with a context. The most important attribute of a context are the symbols. Symbols is a string with all characters that may be at the start or end of a pattern (for example whitespace in most programming languages, or &lt; and &gt; in XML, SGML and HTML), or characters that are a pattern themselves (for example a bracket [ ).

Some contexts change to a different language syntax, e.g. javascript inside html. In such a case the context ay bring new options for the line coment (commentid_block; refers to the id in properties/comment), block comment (commentid_line; refers to the id in properties/comment) and the default spellcheck (default_spellcheck, set to 0 or 1 if words that are not highlighted should be checked for spelling or not).

</reference>
			<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
			<element idref="e.comment"/>
			<element idref="e.entity" />
			<tag id="t.element" name="element" highlight="pattern-tag" attributes="id,idref,pattern,starts_block,ends_block,block_name,ends_context,highlight,blockstartelement,stretch_blockstart,blockhighlight,class,notclass,is_regex,case_insens,identifier_mode,identifier_autocomp,identifier_jump,condition_contextref,condition_mode,condition_relation" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;" >
			<autocomplete append=" pattern=&quot;&quot; /&gt;" backup_cursor="4"/>
			<reference>Element is an actual language element that is syntax highlighted, autocompleted or has reference information. The most important attribute is pattern. The pattern may be a keyword (such as <b>function</b>) or a regular expression pattern (such as <b>[0-9]+</b>) if attribute <i>is_regex</i> is set to 1.
Several attributes of an element define the block behavior. An element may start a block (<b>starts_block</b>="1"), in which case <b>block_name</b> may give a name to this block. A named block can be made optionally unfoldable by the user (see options/properties), and it can be specified in the expand/collapse popup menu. An element may also end a block, in which case <b>ends_block</b>="1" and <b>blockstartpattern</b> should specify the id of the block that starts this block.
An element may also end one or more contexts, the value of the attribute <b>ends_context</b> defines the number of contexts that will closed.
Some elements are identifiers, for example the name of a function or variable. In some cases the pattern itself is an identifier, set <b>identifier_mode="2"</b>. An example is the php variable <i>$foo</i>. In some cases the name following the pattern is the identifier, set <b>identifier_mode="1"</b>. An example is in php <i>function foo</i>. You can add identifiers to the auto-completion popup, set <b>identifier_autocomp="1"</b> or make them a reference for the go to reference function, set <b>identifier_jump="1"</b>.
</reference>
				<context id="c.innerpattern" symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
					<element idref="e.comment"/>
					<element idref="e.entity" />
					<tag id="t.reference" name="reference" highlight="tag" block_name="Reference block">
						<autocomplete append="&gt;&lt;/reference&gt;" />
						<reference>reference is a tag that can be added to tag or to element. The text within the reference opening/closing is the reference information about the pertinent tag or element. Simple layout is available because the string is passed to Pango. <i>i</i>, <b>b</b>, <tt>tt</tt>, <small>small</small>, <big>big</big>, <s>s</s>, <u>u</u>, <sub>sub</sub>
<sup>sup</sup> tags are permitted. <span foreground="blue">&lt;span foreground="blue"&gt;</span> is also permitted, see Pango Text Attribute Markup Language.</reference>
						<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
							<group highlight="markup-tag">
							<tag name="b" />
							<tag name="i" />
							<tag name="big" />
							<tag name="s" />
							<tag name="sub" />
							<tag name="sup" />
							<tag name="small" />
							<tag name="tt" />
							<tag name="u" />
							<tag name="span" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;" attrib_autocomplete_backup_cursor="1" attributes="font,font_desc,font_family,face,font_size,size,font_style,style,font_weight,weight,font_variant,variant,font_stretch,stretch,fireground,fgcolor,color,background,bgcolor,underline,underline_color,rise,strikethrough,strikethrough_color,fallback,lang,letter_spacing,gravity,gravity_hint " />
							</group>
						</context>
					</tag>
					<tag name="autocomplete" id="t.autocomplete" highlight="tag" attributes="append,backup_cursor,class,notclass,enable,string,condition_blockstartidref,condition_contextref,condition_mode,condition_relation" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;" attrib_autocomplete_backup_cursor="1">
						<reference>autocomplete strings that are defined using an autocomplete tag inside a element tag override the autocomplete attribute on the element tag itself. The class and notclass attributes can be used to use different autocomplete settings dependiong on the users preferences</reference>
					</tag>
					<tag idref="t.context" />
				</context>
			</tag>
			<tag id="t.tag" name="tag" highlight="pattern-tag" attributes="id,idref,name,highlight,class,block_name,notclass,attributes,autocomplete,autocomplete_append,autocomplete_backup_cursor,attribhighlight,attrib_autocomplete_append,attrib_autocomplete_backup_cursor,case_insens,sgml_shorttag,no_close" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			<autocomplete append=" name=&quot;&quot; /&gt;" />
			<reference>tag is added for convenience. Everything within tag is possible with a combination of multiple element and context tags. A tag automatically is a block with its own end-tag, and a tag automatically creates a new context for all attributes and autocompletes them. Most attributes are the same as <i>element</i>.</reference>
				<context id="c.innertag" symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
					<element idref="e.comment"/>
					<element idref="e.entity" />
					<tag idref="t.reference" />
					<tag idref="t.autocomplete" />
					<tag idref="t.context" />
					<tag id="t.attribute" name="attribute" highlight="pattern-tag" attributes="id,idref,highlight,class,notclass,name,values,autocomplete_append,autocomplete_backup_cursor" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
						<autocomplete append=" name=&quot;&quot; values=&quot;&quot;&gt;&lt;reference&gt;&lt;/reference&gt;&lt;/attribute&gt;" backup_cursor="25" />
						<context id="c.innertag.innerattribute" symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
							<element idref="e.comment"/>
							<element idref="e.entity" />
							<tag idref="t.reference" />
						</context>
					</tag>
				</context>
			</tag>
			<tag name="group" id="t.group" highlight="tag" attributes="highlight,class,notclass,case_insens,is_regex,attrib_autocomplete_append,attrib_autocomplete_backup_cursor,attribhighlight,no_close,sgml_shorttag" attribhighlight="attribute" attrib_autocomplete_append="=&quot;&quot;">
			<autocomplete append="&gt;" />
			<reference>group is a tag that can be used to group multiple tags or multiple elements that share the same attribute values for the attributes highlight, autocomplete, autocomplete_append, class, case_insens, is_regex, attrib_autocomplete_append or attribhighlight. These attributes are then only set for the group tag, and not for the elements or tags immediately within this group tag.</reference>
				<context id="c.group" symbols="&gt;&lt;&amp;; &#9;&#10;&#13;">
				<element idref="e.comment"/>
				<element idref="e.entity" />
				<tag idref="t.element"/>
				<tag idref="t.tag"/>
				<tag idref="t.group"/>
				<tag idref="t.autocomplete"/>
				</context>
			</tag>
			</context>
		</tag>
		</context>
	</tag>
	</context>
</tag>

<tag name="bfinc" highlight="tag" >
<reference>the <i>bfinc</i> tag is the root tag of the bluefish language include file.</reference>
	<context symbols="&gt;&lt;&amp;; &#9;&#10;&#13;" >
		<element idref="e.comment"/>
		<element idref="e.entity" />
		<tag idref="t.context" />
		<tag idref="t.element"/>
		<tag idref="t.tag"/>
		<tag idref="t.group"/>
	</context>
</tag>

</context>
</definition>
</bflang>
