blob: f8bea015bd20d3f5352eee3a0137d329036a600f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar06b5d512010-05-22 15:37:44 +02002" Language: LifeLines (v 3.0.62) <http://lifelines.sourceforge.net>
3" Maintainer: Patrick Texier <p.texier@orsennes.com>
4" Location: <http://patrick.texier.free.fr/vim/syntax/lifelines.vim>
5" Last Change: 2010 May 7
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00006
7" option to highlight error obsolete statements
Bram Moolenaar06b5d512010-05-22 15:37:44 +02008" add the following line to your .vimrc file :
9" let lifelines_deprecated = 1
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
11" For version 5.x: Clear all syntax items
12" For version 6.x: Quit when a syntax file was already loaded
13
14if version < 600
15 syntax clear
16elseif exists("b:current_syntax")
17 finish
18endif
19
Bram Moolenaar06b5d512010-05-22 15:37:44 +020020" A bunch of useful LifeLines keywords 3.0.62
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
Bram Moolenaar06b5d512010-05-22 15:37:44 +020022syn keyword lifelinesDecl char_encoding require option include
23syn keyword lifelinesStatement set
24syn keyword lifelinesUser getindi geindiset getfam getint getstr choosechild
25syn keyword lifelinesUser chooseindi choosespouse choosesubset menuchoose
26syn keyword lifelinesUser choosefam
27syn keyword lifelinesProc proc func return call
28syn keyword lifelinesInclude include
29syn keyword lifelinesDef global
Bram Moolenaar071d4272004-06-13 20:20:40 +000030syn keyword lifelinesConditional if else elsif switch
Bram Moolenaar06b5d512010-05-22 15:37:44 +020031syn keyword lifelinesRepeat continue break while
32syn keyword lifelinesLogical and or not eq ne lt gt le ge strcmp eqstr nestr
33syn keyword lifelinesArithm add sub mul div mod exp neg incr decr
34syn keyword lifelinesArithm cos sin tan arccos arcsin arctan
35syn keyword lifelinesArithm deg2dms dms2deg spdist
36syn keyword lifelinesIndi name fullname surname givens trimname birth
37syn keyword lifelinesIndi death burial baptism
38syn keyword lifelinesIndi father mother nextsib prevsib sex male female
39syn keyword lifelinesIndi pn nspouses nfamilies parents title key
40syn keyword lifelinesIndi soundex inode root indi firstindi nextindi
41syn keyword lifelinesIndi previndi spouses families forindi indiset
42syn keyword lifelinesIndi addtoset deletefromset union intersect
43syn keyword lifelinesIndi difference parentset childset spouseset siblingset
44syn keyword lifelinesIndi ancestorset descendentset descendantset uniqueset
45syn keyword lifelinesIndi namesort keysort valuesort genindiset getindiset
46syn keyword lifelinesIndi forindiset lastindi writeindi
47syn keyword lifelinesIndi inset
48syn keyword lifelinesFam marriage husband wife nchildren firstchild
49syn keyword lifelinesFam lastchild fnode fam firstfam nextfam lastfam
50syn keyword lifelinesFam prevfam children forfam writefam
51syn keyword lifelinesFam fathers mothers Parents
52syn keyword lifelinesList list empty length enqueue dequeue requeue
53syn keyword lifelinesList push pop setel getel forlist inlist dup clear
54syn keyword lifelinesTable table insert lookup
55syn keyword lifelinesGedcom xref tag value parent child sibling savenode
56syn keyword lifelinesGedcom fornodes traverse createnode addnode
57syn keyword lifelinesGedcom detachnode foreven fornotes forothr forsour
58syn keyword lifelinesGedcom reference dereference getrecord
59syn keyword lifelinesGedcom gengedcomstrong
60syn keyword lifelinesFunct date place year long short gettoday dayformat
61syn keyword lifelinesFunct monthformat dateformat extractdate eraformat
62syn keyword lifelinesFunct complexdate complexformat complexpic datepic
63syn keyword lifelinesFunct extractnames extractplaces extracttokens lower
64syn keyword lifelinesFunct yearformat
65syn keyword lifelinesFunct upper capitalize trim rjustify
66syn keyword lifelinesFunct concat strconcat strlen substring index
67syn keyword lifelinesFunct titlecase gettext
68syn keyword lifelinesFunct d card ord alpha roman strsoundex strtoint
69syn keyword lifelinesFunct atoi linemode pagemod col row pos pageout nl
70syn keyword lifelinesFunct sp qt newfile outfile copyfile print lock unlock test
71syn keyword lifelinesFunct database version system stddate program
72syn keyword lifelinesFunct pvalue pagemode level extractdatestr debug
73syn keyword lifelinesFunct f float int free getcol getproperty heapused
74syn keyword lifelinesFunct sort rsort
75syn keyword lifelinesFunct deleteel
76syn keyword lifelinesFunct bytecode convertcode setlocale
77" New dates functions (since 3.0.51)
78syn keyword lifelinesFunct jd2date date2jd dayofweek setdate
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000079
Bram Moolenaar06b5d512010-05-22 15:37:44 +020080" options to highlight as error obsolete statements
81" please read ll-reportmanual.
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000082
83if exists("lifelines_deprecated")
Bram Moolenaar06b5d512010-05-22 15:37:44 +020084 syn keyword lifelinesError getintmsg getindimsg getstrmsg
85 syn keyword lifelinesError gengedcom gengedcomweak deletenode
86 syn keyword lifelinesError save strsave
87 syn keyword lifelinesError lengthset
88 if version >= 700
89 let g:omni_syntax_group_exclude_lifelines = 'lifelinesError'
90 endif
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000091else
Bram Moolenaar06b5d512010-05-22 15:37:44 +020092 syn keyword lifelinesUser getintmsg getindimsg getstrmsg
93 syn keyword lifelinesGedcom gengedcom gengedcomweak deletenode
94 syn keyword lifelinesFunct save strsave
95 syn keyword lifelinesIndi lengthset
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000096endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000097
Bram Moolenaar06b5d512010-05-22 15:37:44 +020098syn region lifelinesString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lifelinesSpecial
Bram Moolenaar071d4272004-06-13 20:20:40 +000099
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200100syn match lifelinesSpecial "\\\(\\\|\(n\|t\)\)" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200102syn keyword lifelinesTodo contained TODO FIXME XXX
103syn region lifelinesComment start="/\*" end="\*/" contains=lifelinesTodo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000105" integers
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200106syn match lifelinesNumber "-\=\<\d\+\>"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000107"floats, with dot
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200108syn match lifelinesNumber "-\=\<\d\+\.\d*\>"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000109"floats, starting with a dot
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200110syn match lifelinesNumber "-\=\.\d\+\>"
111
112" folding using {}
113if version >= 600
114 syn region lifelinesFoldBlock start="{" end="}" transparent fold
115endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116
117"catch errors caused by wrong parenthesis
118"adapted from original c.vim written by Bram Moolenaar
119
120syn cluster lifelinesParenGroup contains=lifelinesParenError
121syn region lifelinesParen transparent start='(' end=')' contains=ALLBUT,@lifelinesParenGroup
122syn match lifelinesParenError ")"
123syn match lifelinesErrInParen contained "[{}]"
124
125" Define the default highlighting.
126" For version 5.7 and earlier: only when not done already
127" For version 5.8 and later: only when an item doesn't have highlighting yet
128
129if version >= 508 || !exists("did_lifelines_syn_inits")
130 if version < 508
131 let did_lifelines_syn_inits = 1
132 command -nargs=+ HiLink hi link <args>
133 else
134 command -nargs=+ HiLink hi def link <args>
135 endif
136
137 HiLink lifelinesConditional Conditional
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200138 HiLink lifelinesArithm Operator
139 HiLink lifelinesLogical Conditional
140 HiLink lifelinesInclude Include
141 HiLink lifelinesComment Comment
142 HiLink lifelinesStatement Statement
143 HiLink lifelinesUser Statement
144 HiLink lifelinesFunct Statement
145 HiLink lifelinesTable Statement
146 HiLink lifelinesGedcom Statement
147 HiLink lifelinesList Statement
148 HiLink lifelinesRepeat Repeat
149 HiLink lifelinesFam Statement
150 HiLink lifelinesIndi Statement
151 HiLink lifelinesProc Statement
152 HiLink lifelinesDef Statement
153 HiLink lifelinesString String
154 HiLink lifelinesSpecial Special
155 HiLink lifelinesNumber Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156 HiLink lifelinesParenError Error
157 HiLink lifelinesErrInParen Error
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200158 HiLink lifelinesError Error
159 HiLink lifelinesTodo Todo
160 HiLink lifelinesDecl PreProc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161
162 delcommand HiLink
163endif
164
165let b:current_syntax = "lifelines"
166
Bram Moolenaar06b5d512010-05-22 15:37:44 +0200167" vim: ts=8 sw=4