2 " Language: LambdaProlog (Teyjus)
3 " Filenames: *.mod *.sig
4 " Maintainer: Markus Mottl <markus.mottl@gmail.com>
5 " URL: http://www.ocaml.info/vim/syntax/lprolog.vim
6 " Last Change: 2006 Feb 05
7 " 2001 Apr 26 - Upgraded for new Vim version
8 " 2000 Jun 5 - Initial release
10 " For version 5.x: Clear all syntax items
11 " For version 6.x: Quit when a syntax file was already loaded
14 elseif exists("b:current_syntax")
18 " Lambda Prolog is case sensitive.
21 syn match lprologBrackErr "\]"
22 syn match lprologParenErr ")"
24 syn cluster lprologContained contains=lprologTodo,lprologModuleName,lprologTypeNames,lprologTypeName
26 " Enclosing delimiters
27 syn region lprologEncl transparent matchgroup=lprologKeyword start="(" matchgroup=lprologKeyword end=")" contains=ALLBUT,@lprologContained,lprologParenErr
28 syn region lprologEncl transparent matchgroup=lprologKeyword start="\[" matchgroup=lprologKeyword end="\]" contains=ALLBUT,@lprologContained,lprologBrackErr
31 syn match lprologIdentifier "\<\(\w\|[-+*/\\^<>=`'~?@#$&!_]\)*\>"
32 syn match lprologVariable "\<\(\u\|_\)\(\w\|[-+*/\\^<>=`'~?@#$&!]\)*\>"
34 syn match lprologOperator "/"
37 syn region lprologComment start="/\*" end="\*/" contains=lprologComment,lprologTodo
38 syn region lprologComment start="%" end="$" contains=lprologTodo
39 syn keyword lprologTodo contained TODO FIXME XXX
41 syn match lprologInteger "\<\d\+\>"
42 syn match lprologReal "\<\(\d\+\)\=\.\d+\>"
43 syn region lprologString start=+"+ skip=+\\\\\|\\"+ end=+"+
46 syn region lprologClause start="^\w\+" end=":-\|\."
49 syn region lprologModule matchgroup=lprologKeyword start="^\<module\>" matchgroup=lprologKeyword end="\."
52 syn match lprologKeyword "^\<type\>" skipwhite nextgroup=lprologTypeNames
53 syn region lprologTypeNames matchgroup=lprologBraceErr start="\<\w\+\>" matchgroup=lprologKeyword end="\." contained contains=lprologTypeName,lprologOperator
54 syn match lprologTypeName "\<\w\+\>" contained
57 syn keyword lprologKeyword end import accumulate accum_sig
58 syn keyword lprologKeyword local localkind closed sig
59 syn keyword lprologKeyword kind exportdef useonly
60 syn keyword lprologKeyword infixl infixr infix prefix
61 syn keyword lprologKeyword prefixr postfix postfixl
63 syn keyword lprologSpecial pi sigma is true fail halt stop not
66 syn match lprologSpecial ":-"
67 syn match lprologSpecial "->"
68 syn match lprologSpecial "=>"
69 syn match lprologSpecial "\\"
70 syn match lprologSpecial "!"
72 syn match lprologSpecial ","
73 syn match lprologSpecial ";"
74 syn match lprologSpecial "&"
76 syn match lprologOperator "+"
77 syn match lprologOperator "-"
78 syn match lprologOperator "*"
79 syn match lprologOperator "\~"
80 syn match lprologOperator "\^"
81 syn match lprologOperator "<"
82 syn match lprologOperator ">"
83 syn match lprologOperator "=<"
84 syn match lprologOperator ">="
85 syn match lprologOperator "::"
86 syn match lprologOperator "="
88 syn match lprologOperator "\."
89 syn match lprologOperator ":"
90 syn match lprologOperator "|"
92 syn match lprologCommentErr "\*/"
98 " Define the default highlighting.
99 " For version 5.7 and earlier: only when not done already
100 " For version 5.8 and later: only when an item doesn't have highlighting yet
101 if version >= 508 || !exists("did_lprolog_syntax_inits")
103 let did_lprolog_syntax_inits = 1
104 command -nargs=+ HiLink hi link <args>
106 command -nargs=+ HiLink hi def link <args>
109 HiLink lprologComment Comment
110 HiLink lprologTodo Todo
112 HiLink lprologKeyword Keyword
113 HiLink lprologSpecial Special
114 HiLink lprologOperator Operator
115 HiLink lprologIdentifier Normal
117 HiLink lprologInteger Number
118 HiLink lprologReal Number
119 HiLink lprologString String
121 HiLink lprologCommentErr Error
122 HiLink lprologBrackErr Error
123 HiLink lprologParenErr Error
125 HiLink lprologModuleName Special
126 HiLink lprologTypeName Identifier
128 HiLink lprologVariable Keyword
129 HiLink lprologAtom Normal
130 HiLink lprologClause Type
135 let b:current_syntax = "lprolog"