680
|
1 " Vim syntax file
|
|
2 " Language: MGL
|
|
3 " Version: 1.0
|
|
4 " Last Change: 2006 Feb 21
|
|
5 " Maintainer: Gero Kuhlmann <gero@gkminix.han.de>
|
|
6 "
|
2034
|
7 " $Id: mgl.vim,v 1.1 2006/02/21 22:08:20 vimboss Exp $
|
680
|
8 "
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15
|
|
16 syn sync lines=250
|
|
17
|
|
18 syn keyword mglBoolean true false
|
|
19 syn keyword mglConditional if else then
|
|
20 syn keyword mglConstant nil
|
|
21 syn keyword mglPredefined maxint
|
|
22 syn keyword mglLabel case goto label
|
|
23 syn keyword mglOperator to downto in of with
|
|
24 syn keyword mglOperator and not or xor div mod
|
|
25 syn keyword mglRepeat do for repeat while to until
|
|
26 syn keyword mglStatement procedure function break continue return restart
|
|
27 syn keyword mglStatement program begin end const var type
|
|
28 syn keyword mglStruct record
|
|
29 syn keyword mglType integer string char boolean char ipaddr array
|
|
30
|
|
31
|
|
32 " String
|
|
33 if !exists("mgl_one_line_string")
|
|
34 syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape
|
|
35 syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC
|
|
36 else
|
|
37 "wrong strings
|
|
38 syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape
|
|
39 syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC
|
|
40 "right strings
|
|
41 syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape
|
|
42 syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC
|
|
43 end
|
|
44 syn match mglStringEscape contained "''"
|
|
45 syn match mglStringEscapeGPC contained '""'
|
|
46
|
|
47
|
|
48 if exists("mgl_symbol_operator")
|
|
49 syn match mglSymbolOperator "[+\-/*=\%]"
|
|
50 syn match mglSymbolOperator "[<>]=\="
|
|
51 syn match mglSymbolOperator "<>"
|
|
52 syn match mglSymbolOperator ":="
|
|
53 syn match mglSymbolOperator "[()]"
|
|
54 syn match mglSymbolOperator "\.\."
|
|
55 syn match mglMatrixDelimiter "(."
|
|
56 syn match mglMatrixDelimiter ".)"
|
|
57 syn match mglMatrixDelimiter "[][]"
|
|
58 endif
|
|
59
|
|
60 syn match mglNumber "-\=\<\d\+\>"
|
|
61 syn match mglHexNumber "\$[0-9a-fA-F]\+\>"
|
|
62 syn match mglCharacter "\#[0-9]\+\>"
|
|
63 syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>"
|
|
64
|
|
65 syn region mglComment start="(\*" end="\*)"
|
|
66 syn region mglComment start="{" end="}"
|
|
67 syn region mglComment start="//" end="$"
|
|
68
|
|
69 if !exists("mgl_no_functions")
|
|
70 syn keyword mglFunction dispose new
|
|
71 syn keyword mglFunction get load print select
|
|
72 syn keyword mglFunction odd pred succ
|
|
73 syn keyword mglFunction chr ord abs sqr
|
|
74 syn keyword mglFunction exit
|
|
75 syn keyword mglOperator at timeout
|
|
76 endif
|
|
77
|
|
78
|
|
79 syn region mglPreProc start="(\*\$" end="\*)"
|
|
80 syn region mglPreProc start="{\$" end="}"
|
|
81
|
|
82 syn keyword mglException try except raise
|
|
83 syn keyword mglPredefined exception
|
|
84
|
|
85
|
|
86 " Define the default highlighting.
|
|
87 " For version 5.7 and earlier: only when not done already
|
|
88 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
89 if version >= 508 || !exists("did_mgl_syn_inits")
|
|
90 if version < 508
|
|
91 let did_mgl_syn_inits = 1
|
|
92 command -nargs=+ HiLink hi link <args>
|
|
93 else
|
|
94 command -nargs=+ HiLink hi def link <args>
|
|
95 endif
|
|
96
|
|
97 HiLink mglBoolean Boolean
|
|
98 HiLink mglComment Comment
|
|
99 HiLink mglConditional Conditional
|
|
100 HiLink mglConstant Constant
|
|
101 HiLink mglException Exception
|
|
102 HiLink mglFunction Function
|
|
103 HiLink mglLabel Label
|
|
104 HiLink mglMatrixDelimiter Identifier
|
|
105 HiLink mglNumber Number
|
|
106 HiLink mglHexNumber Number
|
|
107 HiLink mglCharacter Number
|
|
108 HiLink mglIpAddr Number
|
|
109 HiLink mglOperator Operator
|
|
110 HiLink mglPredefined mglFunction
|
|
111 HiLink mglPreProc PreProc
|
|
112 HiLink mglRepeat Repeat
|
|
113 HiLink mglStatement Statement
|
|
114 HiLink mglString String
|
|
115 HiLink mglStringEscape Special
|
|
116 HiLink mglStringEscapeGPC Special
|
|
117 HiLink mglStringError Error
|
|
118 HiLink mglStruct mglStatement
|
|
119 HiLink mglSymbolOperator mglOperator
|
|
120 HiLink mglType Type
|
|
121
|
|
122 delcommand HiLink
|
|
123 endif
|
|
124
|
|
125
|
|
126 let b:current_syntax = "mgl"
|
|
127
|
|
128 " vim: ts=8 sw=2
|