4 " Last Change: 2006 Feb 21
5 " Maintainer: Gero Kuhlmann <gero@gkminix.han.de>
7 " $Id: mgl.vim,v 1.1 2006/02/21 22:08:20 vimboss Exp $
11 elseif exists("b:current_syntax")
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
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
38 syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape
39 syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC
41 syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape
42 syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC
44 syn match mglStringEscape contained "''"
45 syn match mglStringEscapeGPC contained '""'
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 "[][]"
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]\+\>"
65 syn region mglComment start="(\*" end="\*)"
66 syn region mglComment start="{" end="}"
67 syn region mglComment start="//" end="$"
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
79 syn region mglPreProc start="(\*\$" end="\*)"
80 syn region mglPreProc start="{\$" end="}"
82 syn keyword mglException try except raise
83 syn keyword mglPredefined exception
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")
91 let did_mgl_syn_inits = 1
92 command -nargs=+ HiLink hi link <args>
94 command -nargs=+ HiLink hi def link <args>
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
126 let b:current_syntax = "mgl"