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