2 " Language: LambdaProlog (Teyjus)
3 " Filenames: *.mod *.sig
4 " Maintainer: Markus Mottl <mottl@miss.wu-wien.ac.at>,
5 " URL: http://miss.wu-wien.ac.at/~mottl/vim/syntax/lprolog.vim
6 " Last Change: 2001 May 10
7 " 2000 Jun 5 - initial release
9 " For version 5.x: Clear all syntax items
10 " For version 6.x: Quit when a syntax file was already loaded
13 elseif exists("b:current_syntax")
17 " Lambda Prolog is case sensitive.
20 syn match lprologBrackErr "\]"
21 syn match lprologParenErr ")"
23 syn cluster lprologContained contains=lprologTodo,lprologModuleName,lprologTypeNames,lprologTypeName
25 " Enclosing delimiters
26 syn region lprologEncl transparent matchgroup=lprologKeyword start="(" matchgroup=lprologKeyword end=")" contains=ALLBUT,@lprologContained,lprologParenErr
27 syn region lprologEncl transparent matchgroup=lprologKeyword start="\[" matchgroup=lprologKeyword end="\]" contains=ALLBUT,@lprologContained,lprologBrackErr
30 syn match lprologIdentifier "\<\(\w\|[-+*/\\^<>=`'~?@#$&!_]\)*\>"
31 syn match lprologVariable "\<\(\u\|_\)\(\w\|[-+*/\\^<>=`'~?@#$&!]\)*\>"
33 syn match lprologOperator "/"
36 syn region lprologComment start="/\*" end="\*/" contains=lprologComment,lprologTodo
37 syn region lprologComment start="%" end="$" contains=lprologTodo
38 syn keyword lprologTodo contained TODO FIXME XXX
40 syn match lprologInteger "\<\d\+\>"
41 syn match lprologReal "\<\(\d\+\)\=\.\d+\>"
42 syn region lprologString start=+"+ skip=+\\\\\|\\"+ end=+"+
45 syn region lprologClause start="^\w\+" end=":-\|\."
48 syn region lprologModule matchgroup=lprologKeyword start="^\<module\>" matchgroup=lprologKeyword end="\."
51 syn match lprologKeyword "^\<type\>" skipwhite nextgroup=lprologTypeNames
52 syn region lprologTypeNames matchgroup=lprologBraceErr start="\<\w\+\>" matchgroup=lprologKeyword end="\." contained contains=lprologTypeName,lprologOperator
53 syn match lprologTypeName "\<\w\+\>" contained
56 syn keyword lprologKeyword end import accumulate accum_sig
57 syn keyword lprologKeyword local localkind closed sig
58 syn keyword lprologKeyword kind exportdef useonly
59 syn keyword lprologKeyword infixl infixr infix prefix
60 syn keyword lprologKeyword prefixr postfix postfixl
62 syn keyword lprologSpecial pi sigma is true fail halt stop not
65 syn match lprologSpecial ":-"
66 syn match lprologSpecial "->"
67 syn match lprologSpecial "=>"
68 syn match lprologSpecial "\\"
69 syn match lprologSpecial "!"
71 syn match lprologSpecial ","
72 syn match lprologSpecial ";"
73 syn match lprologSpecial "&"
75 syn match lprologOperator "+"
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 "="
87 syn match lprologOperator "\."
88 syn match lprologOperator ":"
89 syn match lprologOperator "|"
91 syn match lprologCommentErr "\*/"
97 " Define the default highlighting.
98 " For version 5.7 and earlier: only when not done already
99 " For version 5.8 and later: only when an item doesn't have highlighting yet
100 if version >= 508 || !exists("did_lprolog_syntax_inits")
102 let did_lprolog_syntax_inits = 1
103 command -nargs=+ HiLink hi link <args>
105 command -nargs=+ HiLink hi def link <args>
108 HiLink lprologComment Comment
109 HiLink lprologTodo Todo
111 HiLink lprologKeyword Keyword
112 HiLink lprologSpecial Special
113 HiLink lprologOperator Operator
114 HiLink lprologIdentifier Normal
116 HiLink lprologInteger Number
117 HiLink lprologReal Number
118 HiLink lprologString String
120 HiLink lprologCommentErr Error
121 HiLink lprologBrackErr Error
122 HiLink lprologParenErr Error
124 HiLink lprologModuleName Special
125 HiLink lprologTypeName Identifier
127 HiLink lprologVariable Keyword
128 HiLink lprologAtom Normal
129 HiLink lprologClause Type
134 let b:current_syntax = "lprolog"