source: git/trunk/vim/syntax/survex.vim @ 7bb8184

Last change on this file since 7bb8184 was 7bb8184, checked in by Olly Betts <olly@…>, 13 years ago

Retagging 1.2.0

git-svn-id: file:///home/survex-svn/survex/tags/1.2.0@3664 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 6.5 KB
Line 
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
28if version < 600
29   syntax clear
30elseif exists("b:current_syntax")
31   finish
32endif
33
34" Always ignore case
35syn case ignore
36
37" * introduces a command
38syn match svxAsterisk "^\s*\*" nextgroup=SvxCmd,SvxCmdDeprecated skipwhite
39
40" Fudgery - this is used to mask out anything else from matching.
41syn match svxAnything ".*" contained
42
43" Command names: these first few take no interesting arguments
44syn keyword svxCmd contained    begin date
45syn keyword svxCmd contained    end entrance equate export
46syn keyword svxCmd contained    include require
47syn keyword svxCmd contained    solve title truncate
48
49syn keyword svxCmdDeprecated contained  default prefix
50
51" These commands accept the whole of the rest of the line as argument, irrespective of whitespace.
52syn keyword svxCmd contained    copyright instrument team nextgroup=svxAnything
53
54syn keyword svxCmd      calibrate sd units      contained nextgroup=svxQty skipwhite
55syn keyword svxQty contained    altitude backbearing backclino nextgroup=svxQty,svxUnit skipwhite
56syn keyword svxQty contained    backcompass backgradient bearing clino nextgroup=svxQty,svxUnit skipwhite
57syn keyword svxQty contained    compass count counter declination nextgroup=svxQty,svxUnit skipwhite
58syn keyword svxQty contained    default depth dx dy dz easting gradient nextgroup=svxQty,svxUnit skipwhite
59syn keyword svxQty contained    length level northing plumb position nextgroup=svxQty,svxUnit skipwhite
60syn keyword svxQty contained    tape nextgroup=svxQty,svxUnit skipwhite
61
62syn keyword svxCmd      case    contained nextgroup=svxCase skipwhite
63syn keyword svxCase contained   preserve toupper tolower contained
64
65syn keyword svxCmd      data    contained nextgroup=svxStyle skipwhite
66syn keyword svxStyle contained  default normal diving topofil nextgroup=svxField skipwhite
67syn keyword svxStyle contained  cartesian cylpolar nosurvey nextgroup=svxField skipwhite
68syn keyword svxStyle contained  passage nextgroup=svxField skipwhite
69
70syn keyword svxField contained nextgroup=svxField skipwhite     altitude backbearing backclino
71syn keyword svxField contained nextgroup=svxField skipwhite     backcompass backgradient bearing clino
72syn keyword svxField contained nextgroup=svxField skipwhite     compass count counter depth depthchange
73syn keyword svxField contained nextgroup=svxField skipwhite     direction dx dy dz easting from
74syn keyword svxField contained nextgroup=svxField skipwhite     fromcount fromdepth gradient ignore
75syn keyword svxField contained nextgroup=svxField skipwhite     ignoreall length newline northing
76syn keyword svxField contained nextgroup=svxField skipwhite     station tape to tocount todepth
77syn keyword svxField contained nextgroup=svxField skipwhite     left right up down ceiling floor
78
79syn keyword svxCmd contained nextgroup=svxFlag skipwhite        flags
80syn keyword svxFlag contained nextgroup=svxFlag skipwhite       not duplicate surface splay
81
82syn keyword svxCmd contained nextgroup=svxInferrable skipwhite  infer
83syn keyword svxInferrable contained nextgroup=svxOnOff skipwhite plumbs equates exports
84syn keyword svxOnOff contained on off
85
86syn keyword svxCmd contained nextgroup=svxVar,svxVarDeprecated skipwhite    set
87syn keyword svxVar contained               blank comment decimal eol keyword minus
88syn keyword svxVar contained               names omit plus separator
89syn keyword svxVarDeprecated contained     root
90
91syn keyword svxCmd contained nextgroup=svxQty skipwhite units
92syn keyword svxUnit contained           yards feet metric metres meters
93syn keyword svxUnit contained           deg degrees grads mils percent percentage
94syn keyword svxUnit contained           deg degrees grads mils minutes
95
96syn keyword svxCmd contained nextgroup=svxRef skipwhite fix
97syn keyword svxRef contained            reference
98
99" Miscellaneous things that are spotted everywhere
100syn keyword svxMisc             - down up
101
102" Comments
103syn match svxComment ";.*"
104
105" Strings (double-quote)
106syn 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
111syn 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
116if 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
142endif
143
144let b:current_syntax = "survex"
Note: See TracBrowser for help on using the repository browser.