Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 2 | " 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 Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 6 | |
| 7 | " option to highlight error obsolete statements |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 8 | " add the following line to your .vimrc file : |
| 9 | " let lifelines_deprecated = 1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10 | |
| 11 | " For version 5.x: Clear all syntax items |
| 12 | " For version 6.x: Quit when a syntax file was already loaded |
| 13 | |
| 14 | if version < 600 |
| 15 | syntax clear |
| 16 | elseif exists("b:current_syntax") |
| 17 | finish |
| 18 | endif |
| 19 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 20 | " A bunch of useful LifeLines keywords 3.0.62 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 21 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 22 | syn keyword lifelinesDecl char_encoding require option include |
| 23 | syn keyword lifelinesStatement set |
| 24 | syn keyword lifelinesUser getindi geindiset getfam getint getstr choosechild |
| 25 | syn keyword lifelinesUser chooseindi choosespouse choosesubset menuchoose |
| 26 | syn keyword lifelinesUser choosefam |
| 27 | syn keyword lifelinesProc proc func return call |
| 28 | syn keyword lifelinesInclude include |
| 29 | syn keyword lifelinesDef global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 30 | syn keyword lifelinesConditional if else elsif switch |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 31 | syn keyword lifelinesRepeat continue break while |
| 32 | syn keyword lifelinesLogical and or not eq ne lt gt le ge strcmp eqstr nestr |
| 33 | syn keyword lifelinesArithm add sub mul div mod exp neg incr decr |
| 34 | syn keyword lifelinesArithm cos sin tan arccos arcsin arctan |
| 35 | syn keyword lifelinesArithm deg2dms dms2deg spdist |
| 36 | syn keyword lifelinesIndi name fullname surname givens trimname birth |
| 37 | syn keyword lifelinesIndi death burial baptism |
| 38 | syn keyword lifelinesIndi father mother nextsib prevsib sex male female |
| 39 | syn keyword lifelinesIndi pn nspouses nfamilies parents title key |
| 40 | syn keyword lifelinesIndi soundex inode root indi firstindi nextindi |
| 41 | syn keyword lifelinesIndi previndi spouses families forindi indiset |
| 42 | syn keyword lifelinesIndi addtoset deletefromset union intersect |
| 43 | syn keyword lifelinesIndi difference parentset childset spouseset siblingset |
| 44 | syn keyword lifelinesIndi ancestorset descendentset descendantset uniqueset |
| 45 | syn keyword lifelinesIndi namesort keysort valuesort genindiset getindiset |
| 46 | syn keyword lifelinesIndi forindiset lastindi writeindi |
| 47 | syn keyword lifelinesIndi inset |
| 48 | syn keyword lifelinesFam marriage husband wife nchildren firstchild |
| 49 | syn keyword lifelinesFam lastchild fnode fam firstfam nextfam lastfam |
| 50 | syn keyword lifelinesFam prevfam children forfam writefam |
| 51 | syn keyword lifelinesFam fathers mothers Parents |
| 52 | syn keyword lifelinesList list empty length enqueue dequeue requeue |
| 53 | syn keyword lifelinesList push pop setel getel forlist inlist dup clear |
| 54 | syn keyword lifelinesTable table insert lookup |
| 55 | syn keyword lifelinesGedcom xref tag value parent child sibling savenode |
| 56 | syn keyword lifelinesGedcom fornodes traverse createnode addnode |
| 57 | syn keyword lifelinesGedcom detachnode foreven fornotes forothr forsour |
| 58 | syn keyword lifelinesGedcom reference dereference getrecord |
| 59 | syn keyword lifelinesGedcom gengedcomstrong |
| 60 | syn keyword lifelinesFunct date place year long short gettoday dayformat |
| 61 | syn keyword lifelinesFunct monthformat dateformat extractdate eraformat |
| 62 | syn keyword lifelinesFunct complexdate complexformat complexpic datepic |
| 63 | syn keyword lifelinesFunct extractnames extractplaces extracttokens lower |
| 64 | syn keyword lifelinesFunct yearformat |
| 65 | syn keyword lifelinesFunct upper capitalize trim rjustify |
| 66 | syn keyword lifelinesFunct concat strconcat strlen substring index |
| 67 | syn keyword lifelinesFunct titlecase gettext |
| 68 | syn keyword lifelinesFunct d card ord alpha roman strsoundex strtoint |
| 69 | syn keyword lifelinesFunct atoi linemode pagemod col row pos pageout nl |
| 70 | syn keyword lifelinesFunct sp qt newfile outfile copyfile print lock unlock test |
| 71 | syn keyword lifelinesFunct database version system stddate program |
| 72 | syn keyword lifelinesFunct pvalue pagemode level extractdatestr debug |
| 73 | syn keyword lifelinesFunct f float int free getcol getproperty heapused |
| 74 | syn keyword lifelinesFunct sort rsort |
| 75 | syn keyword lifelinesFunct deleteel |
| 76 | syn keyword lifelinesFunct bytecode convertcode setlocale |
| 77 | " New dates functions (since 3.0.51) |
| 78 | syn keyword lifelinesFunct jd2date date2jd dayofweek setdate |
Bram Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 79 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 80 | " options to highlight as error obsolete statements |
| 81 | " please read ll-reportmanual. |
Bram Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 82 | |
| 83 | if exists("lifelines_deprecated") |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 84 | 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 Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 91 | else |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 92 | 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 Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 96 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 97 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 98 | syn region lifelinesString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lifelinesSpecial |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 99 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 100 | syn match lifelinesSpecial "\\\(\\\|\(n\|t\)\)" contained |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 101 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 102 | syn keyword lifelinesTodo contained TODO FIXME XXX |
| 103 | syn region lifelinesComment start="/\*" end="\*/" contains=lifelinesTodo |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 104 | |
Bram Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 105 | " integers |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 106 | syn match lifelinesNumber "-\=\<\d\+\>" |
Bram Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 107 | "floats, with dot |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 108 | syn match lifelinesNumber "-\=\<\d\+\.\d*\>" |
Bram Moolenaar | 7fc904b | 2006-04-13 20:37:35 +0000 | [diff] [blame] | 109 | "floats, starting with a dot |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 110 | syn match lifelinesNumber "-\=\.\d\+\>" |
| 111 | |
| 112 | " folding using {} |
| 113 | if version >= 600 |
| 114 | syn region lifelinesFoldBlock start="{" end="}" transparent fold |
| 115 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 116 | |
| 117 | "catch errors caused by wrong parenthesis |
| 118 | "adapted from original c.vim written by Bram Moolenaar |
| 119 | |
| 120 | syn cluster lifelinesParenGroup contains=lifelinesParenError |
| 121 | syn region lifelinesParen transparent start='(' end=')' contains=ALLBUT,@lifelinesParenGroup |
| 122 | syn match lifelinesParenError ")" |
| 123 | syn 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 | |
| 129 | if 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 Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 138 | 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 Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 156 | HiLink lifelinesParenError Error |
| 157 | HiLink lifelinesErrInParen Error |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 158 | HiLink lifelinesError Error |
| 159 | HiLink lifelinesTodo Todo |
| 160 | HiLink lifelinesDecl PreProc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 161 | |
| 162 | delcommand HiLink |
| 163 | endif |
| 164 | |
| 165 | let b:current_syntax = "lifelines" |
| 166 | |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 167 | " vim: ts=8 sw=4 |