# -*- LE-syntax -*-
# Syntax patterns for LE editor. (c) 1997-2008 Alexander V. Lukyanov
# This file is distributed under GNU GPL license.
# Please send corrections and improvements to <lav@yars.free.net>
#
# $Id: syntax,v 1.55 2013/01/31 08:02:47 lav Exp $
#
# This file describes how to highlight syntax. The following format
# used:
# /PATTERN - selects file names for which next lines apply
# c[i]COLOR[,MASK]=REGEXP - use COLOR (1-3) to highlight subexpressions
# of REGEXP; MASK is bitmask selecting which subexpressions are to
# highlight, 0 (default) means the whole patterm.
# C escapes can be used in REGEXP. It can also be split into several lines
# by trailing \ on the line, spaces after such a split are ignored.
# The optional `i' means to ignore case.

# c1 usually marks keywords
# c2 usually marks important syntax elements
# c3 usually marks comments or text strings
# c4 usually marks preprocessor directives
# c5
# c6

# i=file includes specified file from PKGDATADIR/syntax.d/file
#	(useful for large descriptions or common patterns)
# s[i](file)[MASK]=REGEXP uses patterns in the file to color matched substring(s)

# maximum height of constructs (above and below the screen)
h20

# This file mode
//-\*- *LE-syntax *-\*-
c3=^#.*$
c1,1=^(h|ci?|i)[0-9]?(?:,[0-9]+)?=
c2,1=^(?:h|ci?|i)[0-9]?(?:,[0-9]+)?(=)
c1,1=^(si?)\\([^\n]+\\)[0-9]*=
c2,7=^si?(\\()[^\n]+(\\))[0-9]*(=)
c2=^/

# C language mode (lav)
/*.c|/-\*- *c *-\*-
i=c-comment
i=cpp
i=c-literal
c1,2=([^[:alnum:]_]|^)(asm|else|if|switch|case|while|for|goto|break\
 |continue|char|short|int|long|unsigned|signed|auto\
 |const|default|do|double|enum|extern|float|register\
 |return|sizeof|static|struct|typedef|union|void|volatile\
)([^[:alnum:]_]|$)
c2=\\[|\\]|\\(|\\)|{|}|,

# C++ mode (lav)
/*.cc|*.C|*.cpp|*.h|*.hh|*.hpp|*.H|/-\*- *c\+\+ *-\*-
i=c++-comment
i=cpp
i=c-literal
c1,2=([^[:alnum:]_]|^)(asm|else|if|switch|case|while|for|goto|break\
 |continue|char|short|int|long|unsigned|signed|auto\
 |const|default|do|double|enum|extern|float|register\
 |return|sizeof|static|struct|typedef|union|void|volatile\
 |try|catch|throw|class|new|delete|private|public|protected|this|virtual\
 |inline|bool|true|false|operator|overload|template|friend|namespace|using\
 |typeid|dynamic_cast|const_cast|static_cast|reinterpret_cast|typename|explicit\
 |nullptr|constexpr|decltype|static_assert|noexcept|alignas|alignof|override|final\
)([^[:alnum:]_]|$)
c2=\\[|\\]|\\(|\\)|{|}|,

/named.conf|/-\*- *(named|bind) *-\*-
i=named-conf

/logrotate.conf|/-\*- *logrotate *-\*-
i=logrotate-conf

/*.[1-9]|/-\*- *nroff *-\*-
i=nroff

/*.e
i=eiffel

/*.adb|*.ads|*.adc|*.gpr
i=ada

/*.S|*.s
i=as

/*.py|/^#![ \t]*/.*/python|-\*- *python *-\*-
i=python

/*.sa
i=sather

/*.sh|/^#![ \t]*/.*/(ba|z|k)?sh|-\*- *sh *-\*-
i=shell

/*.java|/-\*- *java *-\*-
i=java

/*.js|/-\*- *javascript *-\*-
i=javascript

# po (i18n) mode (lav)
/*.po|*.pot
c1=^#, .*
c2="|\\\\n|%[+- #]*[0-9*]*\\.?[0-9*]*l?[l]?[diouxXfeEgGcs]
c3=^#.*$

/*.lout
i=lout

/*.awk
i=awk

/*.gma|*.gema|/^#![ \t]*/.*/\gema
i=gema

/*.p[lm]|/^#![ \t]*/.*/\perl|-\*- *perl *-\*-
i=perl

/*.pod|/^=(pod|head[1-4])$
i=pod

/*.sql|*.buf|/-\*- *[sS][qQ][lL] *-\*-
i=sql

/*.mib|*.smi
i=snmp-mib

/*.texi|-\*- *texinfo *-\*-
i=texinfo

/*.tex
i=tex

/*.php.*|*.php|/<\?php
s(php)1=<\?(?:php)?((?:.|\n)*?)\?>
s(html)1=(?:\`|\?>)((?:.|\n)*?)(?:<\?|\`)
c2,1=<(\?(?:php)?)
i=html
i=php

/*.html|*.htm|*.shtml|/-\*- *html *-\*-|^<![Dd][Oo][Cc][Tt][Yy][Pp][Ee] [Hh][Tt][Mm][Ll]|^<[Hh][Tt][Mm][Ll]>
i=html

/*.css
i=css

/*.tcl|/^#![ \t]*/.*/tcl|-\*- *tcl *-\*-
i=tcl

/*.mf|*.mp
i=metafont

# Patch mode, by Serge Vakulenko <vak@cronyx.ru>
/*.pch|*.diff|*.patch|/^diff
c2=^\+\+\+\s.*$
c2=^---\s.*$
c2=^@@.*$
c3=^\+.*$
c1=^-.*$

# Generic configuration files, by Serge Vakulenko <vak@cronyx.ru>
/*.conf|*.cf|*.cfg|*.ini
c3=[#;].*$
c2=:|\$|->|=
c2,1=^(\[)[^\]]+\]
c2,1=^\[[^\]]+(\])
c1,1=^\[([^\]]+)\]

/[Mm]akefile|[Mm]akefile.*|*.mk|/^#![ \t]*/.*/make|-\*-.*makefile[^\w]
i=make-file

/*.v|/-\*- *verilog *-\*-
i=verilog

# Debian control file mode, by Raphael Geissert <atomo64@gmail.com>
#/control|/^Source:
//^Source:
c3=^#.*$
ci2,1=^[[:alnum:]-]+(:)
c2=\$|=|<|>|\||,
c2=^ \.
c1,1=^(Source|Package(-List)?|Version|Section|Priority|Maintainer|Homepage|Description\
 |Standards-Version|(Build-)?Depends(-Indep)?|Pre-Depends|Architecture|Provides|Replaces\
 |Recommends|Suggests|(Build-)?Conflicts(-Indep)?|Breaks|Enhances|Uploaders|Vcs-Browser\
 |Essential|Installed-Size|Binary|Format|Files|Closes|Changes|Urgency\
 |Distribution|Date|Changed-By|Checksums-Sha(1|256)|Multi-Arch|Built-Using)
ci1=^Vcs-[[:alnum:]]+
c1,1=^(X[BCS]+-[[:alnum:]-]+)(:)

# Debian changelog mode, by Raphael Geissert <atomo64@gmail.com>
// ([^ ]+) .+; +urgency=
c3=^[ \t]+--.+
c2,1=urgency=([[:alnum:]]+)
ci2,1=[ \t]+([[:alnum:]-]+);[ \t]+urgency=
c2,1=^[[:alnum:].-]+ +\((.+)\)
c1,1=^([[:alnum:].-]+) +\(.+\)
ci1=closes:[ \t]*(bug)?#?[ \t]?[0-9]+(,[ \t]*\
 (bug)?\#?[ \t]?[0-9]+)*
c1=LP:[ \t]+#[0-9]+
c2,1=(\[).+\]
c2,1=\[.+(\])
c3,1=\[(.+)\]
c1=^[ \t]+[*+-][^-]
c3="[^"]+?"
c3,1=\W('[^']+?')\W

# simple, and imperfect, changelog mode, by Raphael Geissert <atomo64@gmail.com>
/ChangeLog|/^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}[ \t]
c3=^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}[ \t]+
c2,3=^[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2,4\}.*  ([[:alnum:]]+)$

# lsm mode, by Raphael Geissert <atomo64@gmail.com>
/*.lsm|/^Begin[34]
c3=^(Begin[34]|End)
ci2,1=^[[:alnum:]-]+(:)
#c1,1=^([^ \t]*):
c1,1=^(Title|Version|Entered-date|Description|Keywords|Author|Maintained-by\
 |(Primary|Alternate|Original)-site|Platforms|Copying-policy):
c2=[@()]

# really basic m4 and ac modes, by Raphael Geissert <atomo64@gmail.com>
/*.ac|/-\*- *autoconf *-\*-
c3,2=(^|[^[:alnum:]_])dnl([^[:alnum:]_\n].*)?$
c1,2=(^|[^[:alnum:]_])(A[CM]_[[:alnum:]_]+)
c2=:|=|>|<|,|\||\[|\]|\(|\)|{|}|&
c3="|'
i=shell

/*.m4
c3=^[ \t]*#.*$
c2=:|\$|[+-:]?=|>|<|`|\||\[|\]|\(|\)|{|}|&
c1,2=(^|[^[:alnum:]_])(m4_[[:alnum:]_]+)
c3="|'

# watch file mode, by Raphael Geissert <atomo64@gmail.com>
/watch|/version=[23]
c3=^[ \t]*#.*
c2=[ \t]*version=[0-9]
c1,1=^[ \t]*(opt(ion)?s)
c1=(downloadurl|[du]?version|filename)mangle
c1=active|passive|pasv
c2=,
c2,1=[^\\](\.)[^/]+[ \n\t]
c3=\(.+\)

# .gdbinit mode, by Raphael Geissert <atomo64@gmail.com>
/gdbinit|.*gdbinit
c1,1=^(define|end|document)([^[:alnum:]_]|$)
c2,3=^[[:alnum:]][^ \t]+[ \t]+([[:alnum:]_]+)$

# series (quilt) mode, by Raphael Geissert <atomo64@gmail.com>
/series
c3=^[ \t]*#.*

# .desktop files mode, by Raphael Geissert <atomo64@gmail.com>
/*.desktop|*eventsrc
c2,1=(\[).+\]
c2,1=\[.+(\])
c3,1=\[(.+)\]
c3=^[ \t]*#.*
c1,1=^((Generic)?Name|Comment|(Try)?Exec|Icon|X-[a-zA-Z0-9-]+|Type|Categories\
 |Version|NoDisplay|Hidden|(Only|Not)ShowIn|Path|Terminal|MimeType|URL\
 |Startup(Notify|WMClass)|\
 # eventsrc-specific:\
 |default_presentation\
)

/*.fvwm|*.fvwmrc|*.fvwm2rc
i=fvwm2

/*.pas
i=pascal

/*.t2t
i=txt2tags

# OCaml mode, by Raphael Geissert <atomo64@gmail.com>
/*.mli|*.ml
i=ocaml

# Haskell mode, by Raphael Geissert <atomo64@gmail.com>
/*.hs
i=haskell

/*.go
i=golang

# git commit message mode
//# Please enter (the|a) commit message (for your changes|to explain)
c3=^#
c1,1=^# On branch ([^[:space:]]+)
c2,1=^#[[:space:]]+(copied|deleted|modified|new file|renamed\
 |typechange|unknown|unmerged):
c2,1=^(Conflicts):
c3,1=\W('[^']+?')\W

# git rebase (interactive) mode
//# Rebase .\{1,30\} onto .
c3=^#
c2,1=^(p(?:ick)|r(?:eword)|e(?:dit)|s(?:quash)|f(?:ixup)|x|exec)[[:space:]]

# Puppet
/*.pp
i=puppet

# Markdown markup language
/*.md
i=markdown
