7
|
1 " Vim syntax file
|
|
2 " Language: LambdaProlog (Teyjus)
|
|
3 " Filenames: *.mod *.sig
|
659
|
4 " Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
|
5 " URL: http://www.ocaml.info/vim/syntax/lprolog.vim
|
|
6 " Last Change: 2006 Feb 05
|
20
|
7 " 2001 Apr 26 - Upgraded for new Vim version
|
|
8 " 2000 Jun 5 - Initial release
|
7
|
9
|
|
10 " For version 5.x: Clear all syntax items
|
|
11 " For version 6.x: Quit when a syntax file was already loaded
|
|
12 if version < 600
|
|
13 syntax clear
|
|
14 elseif exists("b:current_syntax")
|
|
15 finish
|
|
16 endif
|
|
17
|
|
18 " Lambda Prolog is case sensitive.
|
|
19 syn case match
|
|
20
|
|
21 syn match lprologBrackErr "\]"
|
|
22 syn match lprologParenErr ")"
|
|
23
|
|
24 syn cluster lprologContained contains=lprologTodo,lprologModuleName,lprologTypeNames,lprologTypeName
|
|
25
|
|
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
|
|
29
|
|
30 " General identifiers
|
|
31 syn match lprologIdentifier "\<\(\w\|[-+*/\\^<>=`'~?@#$&!_]\)*\>"
|
|
32 syn match lprologVariable "\<\(\u\|_\)\(\w\|[-+*/\\^<>=`'~?@#$&!]\)*\>"
|
|
33
|
|
34 syn match lprologOperator "/"
|
|
35
|
|
36 " Comments
|
|
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
|
|
40
|
|
41 syn match lprologInteger "\<\d\+\>"
|
|
42 syn match lprologReal "\<\(\d\+\)\=\.\d+\>"
|
|
43 syn region lprologString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
44
|
|
45 " Clause definitions
|
|
46 syn region lprologClause start="^\w\+" end=":-\|\."
|
|
47
|
|
48 " Modules
|
|
49 syn region lprologModule matchgroup=lprologKeyword start="^\<module\>" matchgroup=lprologKeyword end="\."
|
|
50
|
|
51 " Types
|
|
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
|
|
55
|
|
56 " Keywords
|
|
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
|
|
62
|
|
63 syn keyword lprologSpecial pi sigma is true fail halt stop not
|
|
64
|
|
65 " Operators
|
|
66 syn match lprologSpecial ":-"
|
|
67 syn match lprologSpecial "->"
|
|
68 syn match lprologSpecial "=>"
|
|
69 syn match lprologSpecial "\\"
|
|
70 syn match lprologSpecial "!"
|
|
71
|
|
72 syn match lprologSpecial ","
|
|
73 syn match lprologSpecial ";"
|
|
74 syn match lprologSpecial "&"
|
|
75
|
|
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 "="
|
|
87
|
|
88 syn match lprologOperator "\."
|
|
89 syn match lprologOperator ":"
|
|
90 syn match lprologOperator "|"
|
|
91
|
|
92 syn match lprologCommentErr "\*/"
|
|
93
|
|
94 syn sync minlines=50
|
|
95 syn sync maxlines=500
|
|
96
|
|
97
|
|
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")
|
|
102 if version < 508
|
|
103 let did_lprolog_syntax_inits = 1
|
|
104 command -nargs=+ HiLink hi link <args>
|
|
105 else
|
|
106 command -nargs=+ HiLink hi def link <args>
|
|
107 endif
|
|
108
|
|
109 HiLink lprologComment Comment
|
|
110 HiLink lprologTodo Todo
|
|
111
|
|
112 HiLink lprologKeyword Keyword
|
|
113 HiLink lprologSpecial Special
|
|
114 HiLink lprologOperator Operator
|
|
115 HiLink lprologIdentifier Normal
|
|
116
|
|
117 HiLink lprologInteger Number
|
|
118 HiLink lprologReal Number
|
|
119 HiLink lprologString String
|
|
120
|
|
121 HiLink lprologCommentErr Error
|
|
122 HiLink lprologBrackErr Error
|
|
123 HiLink lprologParenErr Error
|
|
124
|
|
125 HiLink lprologModuleName Special
|
|
126 HiLink lprologTypeName Identifier
|
|
127
|
|
128 HiLink lprologVariable Keyword
|
|
129 HiLink lprologAtom Normal
|
|
130 HiLink lprologClause Type
|
|
131
|
|
132 delcommand HiLink
|
|
133 endif
|
|
134
|
|
135 let b:current_syntax = "lprolog"
|
|
136
|
|
137 " vim: ts=8
|