; $Id: modes.rc,v 1.10 2004/12/08 01:01:31 tom Exp $
; majormodes in this file are ordered alphabetically for convenience - the
; precedence used by vile is strictly alphabetic, counting case.  Use the
; before and after qualifiers to override the precedence.

setv %filters-modes=true

; The tabstops correspond to those used for ncurses' Ada95 wrapper which in
; turn follows gnat's style.
define-mode ada
~with define-submode ada
	suffixes	'\.\(ada\|ads\|adb\)$'
	comment-prefix	'^\s*--'
	comments	'^\s*--\s*$'
	fence-if   '^\s*\<if\>'
	fence-elif '^\s*\<elsif\>'
	fence-else '^\s*\<else\>'
	fence-fi   '^\s*\<end\s\+if\>'
	ignorecase
	notabinsert
	tabstop=3
	shiftwidth=3
~elsewith define-submode ada group 'loop'
	fence-if   '^\s*\<for\>'
	fence-fi   '^\s*\<end\s\+loop\>'
~elsewith define-submode ada group 'case'
	fence-if   '^\s*\<case\>'
	fence-else '^\s*\<when\s\+others\>'
	fence-elif '^\s*\<when\>'
	fence-fi   '^\s*\<end\s\+case\>'
;~elsewith define-submode ada group 'begin'
;	fence-if   '^\s*\<begin\>'
;	fence-else '^\s*\<exception\>'
;	fence-fi   '^\s*\<end\>'
~endwith

; GNU assembler (a Byzantine elaboration of AT&T)
define-mode as
~with define-submode as
	suffixes	'\.[sS]$'
~endwith

; M$ assembler (a Byzantine elaboration of Intel)
define-mode asm
~with define-submode asm
	suffixes	'\.asm$'
	fence-if   '^\s*\<\(if\|ifdef\|ifndef\)\>'
	fence-elif '^\s*\<elseif\>'
	fence-else '^\s*\<else\>'
	fence-fi   '^\s*\<endif\>'
~endwith

; AutoIt version 3
define-mode au3
~with define-submode au3
	suffixes	'\.au3$'
	dos
	ignorecase
	comment-prefix	'^\s*;'
	comments	'^\s*;\s\+\s*$'
	fence-if	'^\s*\<if\>.*\<then\>\s*\(;.*\)\?$'
	fence-elif	'^\s*\<elseif\>'
	fence-else	'^\s*\<else\>'
	fence-fi	'^\s*\<endif\>'
~elsewith define-submode au3 group 'case'
	fence-if	'^\s*\<select\>'
	fence-elif	'^\s*\<case\>'
	fence-else	'^\s*\<case\s\+else\>'
	fence-fi	'^\s*\<endselect\>'
~elsewith define-submode au3 group 'func'
	fence-if	'^\s*\<func\>'
	fence-fi	'^\s*\<endfunc\>'
~elsewith define-submode au3 group 'while'
	fence-if	'^\s*\<while\>'
	fence-fi	'^\s*\<wend\>'
~elsewith define-submode au3 group 'for'
	fence-if	'^\s*\<for\>'
	fence-fi	'^\s*\<next\>'
~endwith

define-mode awk
~with define-submode awk
	suffixes	'\.awk$'
	pre '^#!\s*\/.*awk\>\(\s*-[\a]\+\)*\s*$'
	cindent
	cindent-chars $fences
	comment-prefix '^\s*#'
	comments   '^\s*#\s\+\s*$'
~endwith

define-mode basic
~with define-submode basic
	suffixes	'\.bas$'
	comment-prefix '^\s*\''
	comments   '^\s*\'\s\+\s*$'
	ignorecase
	notabinsert
~endwith

define-mode bat
~with define-submode bat
	suffixes	'\.\(bat\|cmd\)$'
	pre '\s*\(@\)\?echo\s*\(on\|off\)\?$'
	dos
	ignorecase
	comment-prefix '^\s*rem\>'
	comments   '^\s*rem\>\s\+\s*$'
~endwith

; we normally use the builtin values, but this is useful for looking at
; autoconf templates:
~with define-submode c
	mode-filename	'llib-.*$'
	ignoresuffix	'\.\(in\|orig\|~\)$'
~endwith

define-mode cfg
~with define-submode cfg
	suffixes	'\.cfg$'
	comment-prefix	'^\s*#'
	comments	'^\s*#\s*$'
~endwith

define-mode cpp
~with define-submode cpp
	before "c"
	mode-pathname	'.*/include/[cg]++[^/]*/.*'
	~if $filename-ic
		suffixes	'\.\(cc\|cpp\|cxx\|hh\|hpp\|hxx\)$'
	~else
		suffixes	'\.\(cc\|cpp\|cxx\|hh\|hpp\|hxx\|[CH]\|CC\)$'
	~endif
	cindent
	cindent-chars   &cat ':#' $fences
~endwith

define-mode csh
~with define-submode csh
	suffixes	'\.\(csh.*\|login\|logout\)$'
	pre '^#!\s*\/.*csh\>\(\s*-[\a]\+\)*\s*$'
	comment-prefix	'^\s*#'
	comments	'^\s*#\s*$'
	fence-if	'^\s*\<if\>.*\<then\>'
	fence-elif	'^\s*\<else\s*if\>'
	fence-else	'^\s*\<else\>'
	fence-fi	'^\s*\<endif\>'
~elsewith define-submode csh group 'case'
	fence-if	'^\s*\<switch\>\s*(.*)'
	fence-elif	'^\s*\<case\>.*:'
	fence-else	'^\s*\<default\>\s*:'
	fence-fi	'^\s*\<endsw\>'
~elsewith define-submode csh group 'loop'
	fence-if	'^\s*\<foreach\s\+.*\|while\>\s*(.*)'
	fence-fi	'^\s*\<end\>'
~endwith

define-mode cweb
~with define-submode cweb
	suffixes	'\.\(w\|web\)$'
~endwith

; Fences in DCL do not work well because we really want a fence-if which
; looks for an 'if' on a line where there is no 'then'.  But here is a set of
; expressions that work by relying on matching the if-once first, so it
; excludes the if-block.
define-mode dcl
~with define-submode dcl
	suffixes	'\.\(com\|tpu\)$'
	comment-prefix	'^\s*\$!'
	comments	'^\s*\$!\s*$'
	ignorecase
~elsewith define-submode dcl group 'if-once'
	fence-if	'^\s*\(\$\s*\)\?\<if\>.*\<then\>'
~elsewith define-submode dcl group 'if-block'
	fence-if	'^\s*\(\$\s*\)\?\<if\>'
	fence-else	'^\s*\(\$\s*\)\?\<else\>'
	fence-fi	'^\s*\(\$\s*\)\?\<endif\>'
~endwith

define-mode def
~with define-submode def
	suffixes	'\.\(def\)$'
	ignorecase
	dos
~endwith

define-mode diff
~with define-submode diff
	suffixes	'\.\(patch\|dif\|diff\|diffs\|rej\)$'
	pre '^\<diff\>'
~endwith

; ECLiPSe (a dialect of Prolog)
define-mode ecl
~with define-submode ecl
	suffixes	'\.\(ecl\|pro\)$'
~endwith

; Syntax descriptions for enscript
; NOTE: Smalltalk files also may have ".st" suffix.
define-mode est
~with define-submode est
	suffixes	'\.st$'
	cindent
~endwith

; Embedded SQL in C/C++
define-mode esql
~with define-submode esql
	suffixes	'\.\(ec\|pc\|ppc\)$'
	cindent
	cindent-chars &cat ':#' $fences
~endwith

; forms definition.
; FIXME: The groups should not nest (extend the syntax)
define-mode fdl
~with define-submode fdl
	suffixes	'\.\<fdl\>$'
	comment-prefix '^\s*$rem\>'
	comments   '^\(\|$rem\)$'
	fence-if   '^\$\s*if\>'
	fence-elif '^\$\s*elseif\>'
	fence-else '^\$\s*else\>\s*$'
	fence-fi   '^\$\s*endif\s*$'
~elsewith define-submode fdl group 'form'
	fence-if   '^\$form\>'
	fence-fi   '^\$endform\s*$'
~elsewith define-submode fdl group 'field'
	fence-if   '^\$field\>$'
	fence-fi   '^\$endfield\s*$'
~elsewith define-submode fdl group 'group'
	fence-if   '^\$group\>'
	fence-fi   '^\$endgroup\s*$'
~elsewith define-submode fdl group 'array'
	fence-if   '^\$array\>'
	fence-fi   '^\$endarray\s*$'
~elsewith define-submode fdl group 'page'
	fence-if   '^\$page\>'
	fence-fi   '^\$endpage\s*$'
~elsewith define-submode fdl group 'scroll'
	fence-if   '^\$scroll\>'
	fence-fi   '^\$endscroll\s*$'
~elsewith define-submode fdl group 'state'
	fence-if   '^\$state\>'
	fence-fi   '^\$endstate\s*$'
~elsewith define-submode fdl group 'text'
	fence-if   '^\$text\>'
	fence-fi   '^\$endtext\s*$'
~endwith

; Inherit the C-style fences for JavaScript, but add new ones for HTML
define-mode html
~with define-submode html
	suffixes	'\.\(html\|htm\)$'
	pre '\(<html>\|<script>\|<!doctype\|<!--\)'
	fence-pairs	'<>()[]{}'
	ignorecase
	comment-prefix	'^\s*--'
	comments	'^\s*$'
~elsewith define-submode html group 'script'
	fence-if	'^\s*<script>$'
	fence-fi	'^\s*</script>$'
~elsewith define-submode html group 'server'
	fence-if	'^\s*<server>$'
	fence-fi	'^\s*</server>$'
~elsewith define-submode html group 'html'
	fence-begin	'<--'
	fence-end	'-->'
~endwith

define-mode info
~with define-submode info
	after ti
	mode-filename	'\([a-z]*\)\(info\(-\d\+\)\?\)$'
	suffixes	'\.\(info\(-\d\+\)\?\)$'
~endwith

define-mode imake
~with define-submode imake
	before "def"
	mode-filename	'I[Mm]akefile.*$'
	pre '^\s*\(XCOMM\>\|\/\*\*\/#\)'
~endwith

define-mode java
~with define-submode java
	suffixes	'\.\(java\|jad\)$'
	cindent
	cindent-chars &cat ':' $fences
~endwith

define-mode js
~with define-submode js
	suffixes	'\.\(js\|jsp\)$'
	cindent
	cindent-chars &cat ':' $fences
~endwith

define-mode key
~with define-submode key
	suffixes	'\.\(key\|keywords\)$'
	comment-prefix	'^\s*:'
	comments	'^\s*:\s+*$'
~endwith

define-mode latex
~with define-submode latex
	suffixes	'\.\(latex\|ltex\|ltx\|sty\)$'
	fence-pairs='<>{}()[]'
	comment-prefix	'^\s*%'
	comments	'^\s*%.*$'
~endwith

define-mode lex
~with define-submode lex
	suffixes	'\.\(l\|lex\|flex\|flx\)$'
	cindent
	cindent-chars &cat ':#' $fences
~endwith

define-mode lisp
~with define-submode lisp
	suffixes	'\.\(el\|lisp\|lsp\)$'
	fence-pairs='()'
	fence-begin='#|'
	fence-end='|#'
	comment-prefix ';'
~endwith

define-mode log
~with define-submode log
	mode-filename	'^\(run\|\w\?make\).*\.out$'
	suffixes	'\.\(log.*\)$'
	before make
~endwith

; actually, m4 used for autoconf scripts, which is Bourne-shell
define-mode m4
~with define-submode m4
	pre '^\s*dnl\>'
	suffixes	'\.\(ac\|m4\)$'
	comment-prefix '^\s*\(dnl\|#\)'
	comments   '^\s*\(dnl\>\|#\)\s*$'
	fence-if   '^\s*\<if\>'
	fence-elif '^\s*\<elif\>'
	fence-else '^\s*\<else\>'
	fence-fi   '^\s*\<fi\>'
~elsewith define-submode m4 group 'case'
	fence-if   '^\s*\<case\>.*\<in\>'
	fence-fi   '^\s*\<esac\>'
~elsewith define-submode m4 group 'do'
	fence-if   '\(^\s*\<do\>\|;\s*\<do\>\)\s*$'
	fence-fi   '^\s*\<done\>'
~endwith

define-mode mail
~with define-submode mail
	mode-filename	'\([Mm]ail\>.*\|\<mbox\|mutt-.*\)$'
	pre '^\(From \|To: \)'
~endwith

define-mode make
~with define-submode make
	mode-filename	'\([Mm]akefile.*\|make\..*\|\.mak\|\.mk\)$'
	comment-prefix	'^\s*[!#]'
	comments	'^\s*[!#]\s*$'
~elsewith define-submode make group 'gnumake'
	fence-if   '^[ ]*if'
	fence-else '^[ ]*else\>'
	fence-fi   '^[ ]*endif\>'
~elsewith define-submode make group 'nmake'
	fence-if   '^\s*!if'
	fence-elif '^\s*!else\s*if'
	fence-else '^\s*!else\>'
	fence-fi   '^\s*!endif\>'
~if &sin $os 'win32'
	ignorecase
~endif
~endwith

define-mode mms
~with define-submode mms
	suffixes	'\.mms$'
	comment-prefix	'^\s*[!#]'
	comments	'^\s*[!#]\s*$'
	ignorecase
	fence-if   '^\s*\.\<ifdef\>'
	fence-elif '^\s*\.\<elif\>'
	fence-else '^\s*\.\<else\>'
	fence-fi   '^\s*\.\<endif\>'
~endwith

; prevent .newsrc from being recognized as a mode that requires syntax
; highlighting, since it may contain very long lines.
define-mode newsrc
~with define-submode newsrc
	suffixes	'\.\(.*newsrc.*\)$'
	before "sh"
~endwith

define-mode nmake
~with define-submode nmake
	suffixes	'\.dsp$'
	dos
	comment-prefix	'^\s*[!#]'
	comments	'^\s*[!#]\s*$'
~with define-submode make group 'nmake'
	fence-if   '^\s*!if'
	fence-elif '^\s*!else\s*if'
	fence-else '^\s*!else\>'
	fence-fi   '^\s*!endif\>'
	ignorecase
~endwith

define-mode nr
~with define-submode nr
	after "sh"
	suffixes	'\.\(\([1-9ln][a-z]\?\)\|me\|ms\|man\)$'
	pre '^\.\\"'
	comment-prefix	'^\.\\"'
	comments	'^\.\\"\s*$'
~endwith

define-mode pas
~with define-submode pas
	suffixes	'\.\(p\|pas\)$'
~endwith

define-mode pc
~with define-submode pc
	mode-filename	'\(\<printcap.*\)$'
	comment-prefix	'^\s*[:#]'
	comments	'^\s*[:#]\s*$'
~endwith

; 'do' should really be a separate group, but since ambiguous fence-fi is
; very expensive to resolve, we combine it with the similar 'while' group.
define-mode perl
~with define-submode perl
	pre '^#\s*!\s*\.*\/.*perl[0-9]*\>'
	suffixes	'\.\(pl\|pm\|PL\)$'
	before "mail"
	cindent
	cindent-chars  &cat ':' $fences
	comment-prefix '^\s*#'
	comments       '^\s*#\s*$'
	fence-pairs    '{}()[]<>'
	fence-if       '^\s*if\>.*{'
	fence-elif     '^\s*}\s*elsif\s*(.*{'
	fence-else     '^\s*}\s*else\s*{'
	fence-fi       '^\s*}\s*$'
;- The trailing "}" in the different perl groups makes it ambiguous and not
;- easy to use (so they're commented out).  Note that the default (if) group
;- still relies on having the "}" on the same lines as the elsif and else
;- keywords.
;~elsewith define-submode perl group 'while'
;	fence-if       '^\s*\(sub\|foreach\|while\|unless\|do\)\>.*{'
;	fence-fi       '^\s*}'
~endwith

; gettext message files
define-mode pot
~with define-submode pot
	suffixes	'\.\(pot\|po\)$'
	comment-prefix '^#'
	comments       '^#\s*$'
~endwith

; PostScript
define-mode ps
~with define-submode ps
	suffixes	'\.ps$'
~endwith

; Python
define-mode py
~with define-submode py
	pre '^\(\(#!\s*\/.*python[\d_.-]*\>\(\s*[-]\+[\a]*\s*\)\?\)\|:\)\s*$'
	suffixes	'\.py$'
	comment-prefix '^\s*#'
	comments   '^\s*#\s\+\s*$'
~endwith

; Ruby
define-mode rb
~with define-submode rb
	pre '^#\s*!\s*\.*\/.*ruby*\>'
	suffixes	'\.rb$'
~endwith

define-mode rc
~with define-submode rc
	after "vile"
	suffixes	'\.rc\d*$'
	preamble '^\s*[^;"]'
	qualifiers=all
	comment-prefix	'^\s*//'
	comments	'^\s*//\s*$'
~endwith

define-mode rexx
~with define-submode rexx
	pre '^#\s*!\s*\.*\/.*\(rexx\|regina\|rxcurses\)\>'
	suffixes	'\.\(cmd\|rexx\)$'
	~if &not &seq $os "win32"
		before "bat"
	~endif
	comment-prefix '^\s*#'
	comments   '^\s*#\s\+\s*$'
~endwith

; I capitalized the majormode RCS/SCCS names because matches are made in
; alphabetic order (usually not a problem, but conflicting with other modes,
; such as 'makemode').
define-mode RCS
~with define-submode RCS
	mode-filename	',v$'
~endwith

define-mode rpm
~with define-submode rpm
	suffixes	'\.spec$'
~endwith

; (see RCS)
define-mode SCCS
~with define-submode SCCS
	mode-filename	'^s\.'
	pre '^\h'
~elsewith define-submode SCCS group 'delete'
	fence-if       '^\D\s\+\(\d\+\)$'
	fence-fi       '^\E\s\+\(\d\+\)$'
~elsewith define-submode SCCS group 'insert'
	fence-if       '^\I\s\+\(\d\+\)$'
	fence-fi       '^\E\s\+\(\d\+\)$'
~endwith

define-mode sed
~with define-submode sed
	suffixes	'\.\(sed\)$'
	pre '^#!\s*\/sed\>\(\s*-[\a]*\s*\)\*\s*$'
	comment-prefix	'^\s*#'
	comments	'^\s*#\s*$'
~endwith

; This is matched after 'csh', and will pick up /bin/sh, /bin/bash, /bin/ksh
define-mode sh
~with define-submode sh
	mode-filename	'profile$'
	suffixes	'\(\.\(sh\|ksh\|shar\|.*rc\)$\|\.bash_[a-z]\+$\)'
	pre '^\(\(#!\s*\/.*sh\>\(\s*[-]\+[\a]*\s*\)\?\)\|:\)\s*$'
	comment-prefix	'^\s*[:#]'
	comments	'^\s*[:#]\s*$'
	fence-if   '^\s*\<if\>'
	fence-elif '^\s*\<elif\>'
	fence-else '^\s*\<else\>'
	fence-fi   '^\s*\<fi\>'
~elsewith define-submode sh group 'case'
	fence-if   '^\s*\<case\>.*\<in\>'
	fence-elif '^\s*[^ 	)]\+)'
	fence-else '^\s*\*)'
	fence-fi   '^\s*\<esac\>'
~elsewith define-submode sh group 'do'
	fence-if   '\(^\s*\<do\>\|;\s*\<do\>\)\s*$'
	fence-fi   '^\s*\<done\>'
~endwith

define-mode sml
~with define-submode sml
	suffixes	'\.sml$'
	comment-prefix	'^\s*[*]'
	fence-begin="(\\*"
	fence-end="\\*)"
~endwith

define-mode sql
~with define-submode sql
	before "bat"
	suffixes	'\.sql$'
	pre '^\s*\(rem\>.*$\|remark\>.*$\|set\s\+echo\s\+\(on\|off\)\?$\)'
	comment-prefix	'^\s*rem\(ark\)\?'
	comments	'^\s*rem\(ark\)\?\s*$'
	ignorecase
	; PL/SQL
	fence-if   '^\s*if\>'
	fence-elif '^\s*elseif\>'
	fence-else '^\s*else\>\s*$'
	fence-fi   '^\s*end\s\+if\s*;'
~elsewith define-submode sql group 'loop'
	fence-if   '^\s*while\>.*\<loop\>'
	fence-fi   '^\s*end\s\+loop\s*;'
~elsewith define-submode sql group 'block'
	fence-if   '^\s*begin\>'
	fence-else '^\s*exception\>'
	fence-fi   '^\s*end\s*;'
~endwith

define-mode tags
~with define-submode tags
	mode-filename	'^tags$'
	comment-prefix	'^!_'
	comments	'^!_$'
~endwith

; VILE's mktbls
define-mode tbl
~with define-submode tbl
	mode-filename	'^\(modetbl\|cmdtbl\)$'
	comment-prefix	'^\s*#'
	comments	'^\s*#\s*$'
~endwith

define-mode tc
~with define-submode tc
	mode-filename	'^termcap.*$'
	suffixes	'\.\(tc\|tcap\|termcap\)$'
	comment-prefix	'^\s*[:#]'
	comments	'^\s*[:#]\s*$'
~endwith

define-mode tcl
~with define-submode tcl
	before "sh"
	suffixes	'\.\(tcl\|exp\)$'
	pre '^#!\s*\/.*\(wish\|wishx\|tclsh\|tcl\|expectk\)[0-9.]*\>\(\s*-[\a]\+\)*\s*$'
	comment-prefix	'^\s*[:#]'
	comments	'^\s*[:#]\s*$'
~endwith

define-mode tex
~with define-submode tex
	suffixes	'\.\(tex\)$'
	fence-pairs='<>{}()[]'
	comment-prefix	'^\s*%'
	comments	'^\s*%.*$'
~endwith

define-mode texi
~with define-submode texi
	suffixes	'\.\(texi\|txi\|texinfo\)$'
~endwith

define-mode ti
~with define-submode ti
	before "sh"
	mode-filename	'^\<terminfo\(\.src\)\?$'
	suffixes	'\.\(ti\|tic\|tinfo\|terminfo\)$'
	comment-prefix	'^\s*[:#]'
	comments	'^\s*[:#]\s*$'
~endwith

define-mode txt
~with define-submode txt
	mode-filename	'^\(\(TODO\|\(\(.*-\)\?README\)\|CHANGES\|Change[Ll]og\|COPYING\).*\)$'
	suffixes	'\.\(txt\|doc\|hlp\)$'
	comment-prefix	'^\s*--'
	comments	'^\s*--\s*$'
~endwith

define-mode vb
~with define-submode vb
	before "basic"
	suffixes	'\.\(bas\|frm\)$'
	pre '\(^VERSION\|VB_Name\)'
	qualifiers=all
	comment-prefix	'^\s*\''
	comments	'^\s*\'\s\+\s*$'
	dos
	ignorecase
	notabinsert
~endwith

define-mode vlog
~with define-submode vlog
	suffixes	'\.v$'
	cindent
	cindent-chars $fences
~endwith

; "define-mode vile" is builtin
~with define-submode vile
	before "sh"
	mode-pathname	'\(vile.*/.*rc\)$'
	mode-filename	'\(vile.*rc\)$'
	suffixes	'\.\(exrc\|vile\)$'
	comment-prefix	'^\s*;'
	comments	'^\s*;\s*$'
	fence-if	'^\s*~if\>'
	fence-elif	'^\s*~elseif\>'
	fence-else	'^\s*~else\>'
	fence-fi	'^\s*~endif\>'
	sections	'^\s*\(define-mode\|\(\d\+\s*\)\?\(store-\(macro\|procedure\)\)\)'
~elsewith define-submode vile group 'while'
	fence-if	'^\s*~while\>'
	fence-fi	'^\s*~endwhile\>'
~elsewith define-submode vile group 'with'
	fence-if	'^\s*~with\>'
	fence-elif	'^\s*~elsewith\>'
	fence-fi	'^\s*~endwith\>'
~elsewith define-submode vile group 'macro'
	fence-if	'^\s*\(\d\+\s*\)\?store-\(macro\|procedure\)'
	fence-fi	'^\s*~endm\>'
~endwith

define-mode vim
~with define-submode vim
	suffixes	'\.\(vim\)$'
	comment-prefix	'^\s*"'
	before "make"
	comments	'^\s*"\s*$'
	fence-if	'^\s*if\>'
	fence-elif	'^\s*elseif\>'
	fence-else	'^\s*else\>'
	fence-fi	'^\s*endif\>'
~elsewith define-submode vim group 'while'
	fence-if	'^\s*while\>'
	fence-fi	'^\s*endwhile\>'
~elsewith define-submode vim group 'function'
	fence-if	'^\s*function\>'
	fence-fi	'^\s*endfunction\>'
~endwith

define-mode xml
~with define-submode xml
	suffixes	'\.\(xml\|xsl\|xsd\)$'
	pre '^\s*<?xml\s'
	fence-pairs	'<>()[]{}'
	comment-prefix	'^\s*--'
	comments	'^\s*$'
~endwith

define-mode xres
~with define-submode xres
	mode-filename	'^\(\.Xdefaults\(-.\+$\)\?\)$'
	suffixes	'\.\(ad\)$'
	~if &not $filename-ic
		mode-pathname	'\(app-defaults/[A-Z]\?[A-Z][a-z0-9-]\+\)$'
	~endif
	comment-prefix	'^\s*!'
	comments	'^\s*!\s*$'
~endwith

define-mode xs
~with define-submode xs
	suffixes	'\.xs$'
	cindent
	cindent-chars &cat ':' $fences
~endwith

define-mode yacc
~with define-submode yacc
	suffixes	'\.\(y\|yacc\)$'
	cindent
	cindent-chars &cat ':#' $fences
~endwith
