annotate runtime/syntax/lprolog.vim @ 49:000769ce6c9d default tip

Added tag v7-3-618 for changeset 67300faee616
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 01 Aug 2012 18:08:37 +0900
parents 76efa0be13f1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 " Vim syntax file
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 " Language: LambdaProlog (Teyjus)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Filenames: *.mod *.sig
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " Maintainer: Markus Mottl <markus.mottl@gmail.com>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 " URL: http://www.ocaml.info/vim/syntax/lprolog.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 " Last Change: 2006 Feb 05
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 " 2001 Apr 26 - Upgraded for new Vim version
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 " 2000 Jun 5 - Initial release
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 if version < 600
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 syntax clear
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 elseif exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18 " Lambda Prolog is case sensitive.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 syn case match
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21 syn match lprologBrackErr "\]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 syn match lprologParenErr ")"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24 syn cluster lprologContained contains=lprologTodo,lprologModuleName,lprologTypeNames,lprologTypeName
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26 " Enclosing delimiters
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27 syn region lprologEncl transparent matchgroup=lprologKeyword start="(" matchgroup=lprologKeyword end=")" contains=ALLBUT,@lprologContained,lprologParenErr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 syn region lprologEncl transparent matchgroup=lprologKeyword start="\[" matchgroup=lprologKeyword end="\]" contains=ALLBUT,@lprologContained,lprologBrackErr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 " General identifiers
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31 syn match lprologIdentifier "\<\(\w\|[-+*/\\^<>=`'~?@#$&!_]\)*\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32 syn match lprologVariable "\<\(\u\|_\)\(\w\|[-+*/\\^<>=`'~?@#$&!]\)*\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34 syn match lprologOperator "/"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 " Comments
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37 syn region lprologComment start="/\*" end="\*/" contains=lprologComment,lprologTodo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 syn region lprologComment start="%" end="$" contains=lprologTodo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39 syn keyword lprologTodo contained TODO FIXME XXX
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 syn match lprologInteger "\<\d\+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42 syn match lprologReal "\<\(\d\+\)\=\.\d+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 syn region lprologString start=+"+ skip=+\\\\\|\\"+ end=+"+
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 " Clause definitions
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 syn region lprologClause start="^\w\+" end=":-\|\."
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 " Modules
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 syn region lprologModule matchgroup=lprologKeyword start="^\<module\>" matchgroup=lprologKeyword end="\."
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 " Types
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 syn match lprologKeyword "^\<type\>" skipwhite nextgroup=lprologTypeNames
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 syn region lprologTypeNames matchgroup=lprologBraceErr start="\<\w\+\>" matchgroup=lprologKeyword end="\." contained contains=lprologTypeName,lprologOperator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 syn match lprologTypeName "\<\w\+\>" contained
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 " Keywords
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 syn keyword lprologKeyword end import accumulate accum_sig
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 syn keyword lprologKeyword local localkind closed sig
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 syn keyword lprologKeyword kind exportdef useonly
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60 syn keyword lprologKeyword infixl infixr infix prefix
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 syn keyword lprologKeyword prefixr postfix postfixl
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63 syn keyword lprologSpecial pi sigma is true fail halt stop not
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 " Operators
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 syn match lprologSpecial ":-"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 syn match lprologSpecial "->"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68 syn match lprologSpecial "=>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 syn match lprologSpecial "\\"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70 syn match lprologSpecial "!"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72 syn match lprologSpecial ","
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 syn match lprologSpecial ";"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 syn match lprologSpecial "&"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 syn match lprologOperator "+"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 syn match lprologOperator "-"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78 syn match lprologOperator "*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79 syn match lprologOperator "\~"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 syn match lprologOperator "\^"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81 syn match lprologOperator "<"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82 syn match lprologOperator ">"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83 syn match lprologOperator "=<"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 syn match lprologOperator ">="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 syn match lprologOperator "::"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86 syn match lprologOperator "="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88 syn match lprologOperator "\."
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 syn match lprologOperator ":"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90 syn match lprologOperator "|"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 syn match lprologCommentErr "\*/"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94 syn sync minlines=50
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95 syn sync maxlines=500
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 " For version 5.7 and earlier: only when not done already
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100 " For version 5.8 and later: only when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101 if version >= 508 || !exists("did_lprolog_syntax_inits")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102 if version < 508
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103 let did_lprolog_syntax_inits = 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104 command -nargs=+ HiLink hi link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106 command -nargs=+ HiLink hi def link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109 HiLink lprologComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110 HiLink lprologTodo Todo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
111
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
112 HiLink lprologKeyword Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
113 HiLink lprologSpecial Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
114 HiLink lprologOperator Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
115 HiLink lprologIdentifier Normal
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
116
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
117 HiLink lprologInteger Number
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
118 HiLink lprologReal Number
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
119 HiLink lprologString String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
120
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
121 HiLink lprologCommentErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
122 HiLink lprologBrackErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
123 HiLink lprologParenErr Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
124
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
125 HiLink lprologModuleName Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
126 HiLink lprologTypeName Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
127
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
128 HiLink lprologVariable Keyword
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
129 HiLink lprologAtom Normal
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
130 HiLink lprologClause Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
131
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
132 delcommand HiLink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
133 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
134
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
135 let b:current_syntax = "lprolog"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
136
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
137 " vim: ts=8