[7bb8184] | 1 | " Vim syntax file |
---|
| 2 | " Language: Survex |
---|
| 3 | " Maintainer: David Loeffler <dave@cucc.survex.com> |
---|
| 4 | " Last Change: $Date: 2006-07-04 03:18:25 $ |
---|
| 5 | " Filenames: *.svx |
---|
| 6 | " URL: [NONE] |
---|
| 7 | " Note: The definitions below are taken from the Survex user manual as of February 2005, for version 1.0.34; several inconsistencies discovered in the process were clarified by reference to source code. Since updated for version 1.1.8. |
---|
| 8 | " |
---|
| 9 | " Copyright (C) 2005 David Loeffler |
---|
| 10 | " Copyright (C) 2006 Olly Betts |
---|
| 11 | " |
---|
| 12 | " This program is free software; you can redistribute it and/or modify |
---|
| 13 | " it under the terms of the GNU General Public License as published by |
---|
| 14 | " the Free Software Foundation; either version 2 of the License, or |
---|
| 15 | " (at your option) any later version. |
---|
| 16 | " |
---|
| 17 | " This program is distributed in the hope that it will be useful, |
---|
| 18 | " but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 19 | " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 20 | " GNU General Public License for more details. |
---|
| 21 | " |
---|
| 22 | " You should have received a copy of the GNU General Public License |
---|
| 23 | " along with this program; if not, write to the Free Software |
---|
| 24 | " Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 25 | |
---|
| 26 | " For version 5.x: Clear all syntax items |
---|
| 27 | " For version 6.x: Quit when a syntax file was already loaded |
---|
| 28 | if version < 600 |
---|
| 29 | syntax clear |
---|
| 30 | elseif exists("b:current_syntax") |
---|
| 31 | finish |
---|
| 32 | endif |
---|
| 33 | |
---|
| 34 | " Always ignore case |
---|
| 35 | syn case ignore |
---|
| 36 | |
---|
| 37 | " * introduces a command |
---|
| 38 | syn match svxAsterisk "^\s*\*" nextgroup=SvxCmd,SvxCmdDeprecated skipwhite |
---|
| 39 | |
---|
| 40 | " Fudgery - this is used to mask out anything else from matching. |
---|
| 41 | syn match svxAnything ".*" contained |
---|
| 42 | |
---|
| 43 | " Command names: these first few take no interesting arguments |
---|
| 44 | syn keyword svxCmd contained begin date |
---|
| 45 | syn keyword svxCmd contained end entrance equate export |
---|
| 46 | syn keyword svxCmd contained include require |
---|
| 47 | syn keyword svxCmd contained solve title truncate |
---|
| 48 | |
---|
| 49 | syn keyword svxCmdDeprecated contained default prefix |
---|
| 50 | |
---|
| 51 | " These commands accept the whole of the rest of the line as argument, irrespective of whitespace. |
---|
| 52 | syn keyword svxCmd contained copyright instrument team nextgroup=svxAnything |
---|
| 53 | |
---|
| 54 | syn keyword svxCmd calibrate sd units contained nextgroup=svxQty skipwhite |
---|
| 55 | syn keyword svxQty contained altitude backbearing backclino nextgroup=svxQty,svxUnit skipwhite |
---|
| 56 | syn keyword svxQty contained backcompass backgradient bearing clino nextgroup=svxQty,svxUnit skipwhite |
---|
| 57 | syn keyword svxQty contained compass count counter declination nextgroup=svxQty,svxUnit skipwhite |
---|
| 58 | syn keyword svxQty contained default depth dx dy dz easting gradient nextgroup=svxQty,svxUnit skipwhite |
---|
| 59 | syn keyword svxQty contained length level northing plumb position nextgroup=svxQty,svxUnit skipwhite |
---|
| 60 | syn keyword svxQty contained tape nextgroup=svxQty,svxUnit skipwhite |
---|
| 61 | |
---|
| 62 | syn keyword svxCmd case contained nextgroup=svxCase skipwhite |
---|
| 63 | syn keyword svxCase contained preserve toupper tolower contained |
---|
| 64 | |
---|
| 65 | syn keyword svxCmd data contained nextgroup=svxStyle skipwhite |
---|
| 66 | syn keyword svxStyle contained default normal diving topofil nextgroup=svxField skipwhite |
---|
| 67 | syn keyword svxStyle contained cartesian cylpolar nosurvey nextgroup=svxField skipwhite |
---|
| 68 | syn keyword svxStyle contained passage nextgroup=svxField skipwhite |
---|
| 69 | |
---|
| 70 | syn keyword svxField contained nextgroup=svxField skipwhite altitude backbearing backclino |
---|
| 71 | syn keyword svxField contained nextgroup=svxField skipwhite backcompass backgradient bearing clino |
---|
| 72 | syn keyword svxField contained nextgroup=svxField skipwhite compass count counter depth depthchange |
---|
| 73 | syn keyword svxField contained nextgroup=svxField skipwhite direction dx dy dz easting from |
---|
| 74 | syn keyword svxField contained nextgroup=svxField skipwhite fromcount fromdepth gradient ignore |
---|
| 75 | syn keyword svxField contained nextgroup=svxField skipwhite ignoreall length newline northing |
---|
| 76 | syn keyword svxField contained nextgroup=svxField skipwhite station tape to tocount todepth |
---|
| 77 | syn keyword svxField contained nextgroup=svxField skipwhite left right up down ceiling floor |
---|
| 78 | |
---|
| 79 | syn keyword svxCmd contained nextgroup=svxFlag skipwhite flags |
---|
| 80 | syn keyword svxFlag contained nextgroup=svxFlag skipwhite not duplicate surface splay |
---|
| 81 | |
---|
| 82 | syn keyword svxCmd contained nextgroup=svxInferrable skipwhite infer |
---|
| 83 | syn keyword svxInferrable contained nextgroup=svxOnOff skipwhite plumbs equates exports |
---|
| 84 | syn keyword svxOnOff contained on off |
---|
| 85 | |
---|
| 86 | syn keyword svxCmd contained nextgroup=svxVar,svxVarDeprecated skipwhite set |
---|
| 87 | syn keyword svxVar contained blank comment decimal eol keyword minus |
---|
| 88 | syn keyword svxVar contained names omit plus separator |
---|
| 89 | syn keyword svxVarDeprecated contained root |
---|
| 90 | |
---|
| 91 | syn keyword svxCmd contained nextgroup=svxQty skipwhite units |
---|
| 92 | syn keyword svxUnit contained yards feet metric metres meters |
---|
| 93 | syn keyword svxUnit contained deg degrees grads mils percent percentage |
---|
| 94 | syn keyword svxUnit contained deg degrees grads mils minutes |
---|
| 95 | |
---|
| 96 | syn keyword svxCmd contained nextgroup=svxRef skipwhite fix |
---|
| 97 | syn keyword svxRef contained reference |
---|
| 98 | |
---|
| 99 | " Miscellaneous things that are spotted everywhere |
---|
| 100 | syn keyword svxMisc - down up |
---|
| 101 | |
---|
| 102 | " Comments |
---|
| 103 | syn match svxComment ";.*" |
---|
| 104 | |
---|
| 105 | " Strings (double-quote) |
---|
| 106 | syn region svxString start=+"+ end=+"+ |
---|
| 107 | |
---|
| 108 | " Catch errors caused by filenames containing whitespace |
---|
| 109 | " This is just an example really, to show the kind of |
---|
| 110 | " error-trapping that's possible |
---|
| 111 | syn match svxFilenameError "\*include\s*[^"]\+\s\+[^\s"]\+" |
---|
| 112 | |
---|
| 113 | " Define the default highlighting. |
---|
| 114 | " For version 5.7 and earlier: only when not done already |
---|
| 115 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
---|
| 116 | if version >= 508 || !exists("did_survex_syn_inits") |
---|
| 117 | if version < 508 |
---|
| 118 | let did_survex_syn_inits = 1 |
---|
| 119 | command -nargs=+ HiLink hi link <args> |
---|
| 120 | else |
---|
| 121 | command -nargs=+ HiLink hi def link <args> |
---|
| 122 | endif |
---|
| 123 | |
---|
| 124 | HiLink svxString String |
---|
| 125 | HiLink svxComment Comment |
---|
| 126 | HiLink svxCmd Statement |
---|
| 127 | HiLink svxStyle Type |
---|
| 128 | HiLink svxUnit Identifier |
---|
| 129 | HiLink svxQty Identifier |
---|
| 130 | HiLink svxCase Identifier |
---|
| 131 | HiLink svxField Identifier |
---|
| 132 | HiLink svxFlag Identifier |
---|
| 133 | HiLink svxInferrable Identifier |
---|
| 134 | HiLink svxOnOff Special |
---|
| 135 | HiLink svxVar Identifier |
---|
| 136 | HiLink svxMisc Special |
---|
| 137 | HiLink svxAsterisk Statement |
---|
| 138 | HiLink svxFilenameError Error |
---|
| 139 | HiLink svxCmdDeprecated Todo |
---|
| 140 | HiLink svxVarDeprecated Todo |
---|
| 141 | delcommand HiLink |
---|
| 142 | endif |
---|
| 143 | |
---|
| 144 | let b:current_syntax = "survex" |
---|