diff options
Diffstat (limited to 'contrib/gtksourceview-3.0/language-specs')
-rw-r--r-- | contrib/gtksourceview-3.0/language-specs/ousia.lang | 70 |
1 files changed, 67 insertions, 3 deletions
diff --git a/contrib/gtksourceview-3.0/language-specs/ousia.lang b/contrib/gtksourceview-3.0/language-specs/ousia.lang index 0a61304..0038fbd 100644 --- a/contrib/gtksourceview-3.0/language-specs/ousia.lang +++ b/contrib/gtksourceview-3.0/language-specs/ousia.lang @@ -39,16 +39,25 @@ <style id="boolean" _name="Boolean Value" map-to="def:boolean"/> <style id="type" _name="Data Type" map-to="def:type"/> <style id="special-char" _name="Special Character" map-to="def:special-char"/> + <style id="annotation" _name="Annotation" map-to="def:statement"/> </styles> <definitions> <!-- An ousia command --> - <define-regex id="identifier">[a-zA-z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?</define-regex> + <define-regex id="identifier">[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?</define-regex> <define-regex id="identifierWithNS">\%{identifier}(:\%{identifier})*</define-regex> <define-regex id="command">(?P<command_cmd>\\\%{identifierWithNS})(?P<command_name>#\%{identifier})?</define-regex> <define-regex id="begin_command">(?P<begin>\\begin){(?P<begin_cmd>\%{identifierWithNS})(?P<begin_name>#\%{identifier})?}</define-regex> <define-regex id="end_command">(?P<end>\\end){(?P<end_cmd>\%{identifierWithNS})}</define-regex> + <define-regex id="annotation-start">(?P<annotation_start_cmd><\\\%{identifierWithNS})(?P<annotation_start_name>#\%{identifier})?</define-regex> + <define-regex id="annotation-start-begin">(?P<annotation_start_begin_char><)(?P<annotation_start_begin>\\begin){(?P<annotation_start_begin_cmd>\%{identifierWithNS})(?P<annotation_start_begin_name>#\%{identifier})?}</define-regex> + <define-regex id="annotation-end">(?P<annotation_end_cmd>\\\%{identifierWithNS})(?P<annotation_end_name>#\%{identifier})?(?P<annotation_end_char>>)</define-regex> <define-regex id="builtin">\\(import|include)</define-regex> + <!-- Escaped characters --> + <context id="escape" class="no-spell-check" style-ref="special-char"> + <match>\\[^a-zA-Z]</match> + </context> + <!-- Any command --> <context id="command" class="no-spell-check"> <match>\%{command}</match> @@ -82,7 +91,25 @@ <start>\[</start> <end>\]</end> <include> - <context ref="map"/> + <context ref="map-inner"/> + <context ref="map-key"/> + <context ref="def:string" style-ref="string"/> + <context ref="def:single-quoted-string" style-ref="string"/> + <context ref="def:float"/> + <context ref="def:decimal"/> + <context ref="def:hexadecimal"/> + <context ref="boolean"/> + <context ref="type"/> + <context ref="cardinality"/> + </include> + </context> + + <!-- Maps within argument lists --> + <context id="map-inner"> + <start>\[</start> + <end>\]</end> + <include> + <context ref="map-inner"/> <context ref="map-key"/> <context ref="def:string" style-ref="string"/> <context ref="def:single-quoted-string" style-ref="string"/> @@ -139,7 +166,7 @@ <end>$</end> </context> - <!-- Field --> + <!-- Default field marker --> <context id="default-field"> <match>{(!)</match> <include> @@ -147,9 +174,46 @@ </include> </context> + <!-- Annotation --> + <context id="annotation-start"> + <match>\%{annotation-start}</match> + <include> + <context sub-pattern="annotation_start_cmd" style-ref="annotation"/> + <context sub-pattern="annotation_start_name" style-ref="name"/> + </include> + </context> + + <context id="annotation-start-begin"> + <match>\%{annotation-start-begin}</match> + <include> + <context sub-pattern="annotation_start_begin_char" style-ref="annotation"/> + <context sub-pattern="annotation_start_begin" style-ref="common-commands"/> + <context sub-pattern="annotation_start_begin_cmd" style-ref="command"/> + <context sub-pattern="annotation_start_begin_name" style-ref="name"/> + </include> + </context> + + <context id="annotation-short-end" style-ref="annotation"> + <match>\\></match> + </context> + + <context id="annotation-end"> + <match>\%{annotation-end}</match> + <include> + <context sub-pattern="annotation_end_cmd" style-ref="annotation"/> + <context sub-pattern="annotation_end_name" style-ref="name"/> + <context sub-pattern="annotation_end_char" style-ref="annotation"/> + </include> + </context> + <!-- Main context --> <context id="ousia"> <include> + <context ref="annotation-short-end"/> + <context ref="annotation-start-begin"/> + <context ref="annotation-start"/> + <context ref="annotation-end"/> + <context ref="escape"/> <context ref="begin-command"/> <context ref="end-command"/> <context ref="common-commands"/> |