7
|
1 " Vim syntax file
|
|
2 " Language: OPL
|
|
3 " Maintainer: Czo <Olivier.Sirol@lip6.fr>
|
2034
|
4 " $Id: opl.vim,v 1.1 2004/06/13 17:34:11 vimboss Exp $
|
7
|
5
|
|
6 " Open Psion Language... (EPOC16/EPOC32)
|
|
7
|
|
8 " For version 5.x: Clear all syntax items
|
|
9 " For version 6.x: Quit when a syntax file was already loaded
|
|
10 if version < 600
|
|
11 syntax clear
|
|
12 elseif exists("b:current_syntax")
|
|
13 finish
|
|
14 endif
|
|
15
|
|
16 " case is not significant
|
|
17 syn case ignore
|
|
18
|
|
19 " A bunch of useful OPL keywords
|
|
20 syn keyword OPLStatement proc endp abs acos addr adjustalloc alert alloc app
|
|
21 syn keyword OPLStatement append appendsprite asc asin at atan back beep
|
|
22 syn keyword OPLStatement begintrans bookmark break busy byref cache
|
|
23 syn keyword OPLStatement cachehdr cacherec cachetidy call cancel caption
|
|
24 syn keyword OPLStatement changesprite chr$ clearflags close closesprite cls
|
|
25 syn keyword OPLStatement cmd$ committrans compact compress const continue
|
|
26 syn keyword OPLStatement copy cos count create createsprite cursor
|
|
27 syn keyword OPLStatement datetosecs datim$ day dayname$ days daystodate
|
|
28 syn keyword OPLStatement dbuttons dcheckbox dchoice ddate declare dedit
|
|
29 syn keyword OPLStatement deditmulti defaultwin deg delete dfile dfloat
|
|
30 syn keyword OPLStatement dialog diaminit diampos dinit dir$ dlong do dow
|
|
31 syn keyword OPLStatement dposition drawsprite dtext dtime dxinput edit else
|
|
32 syn keyword OPLStatement elseif enda endif endv endwh entersend entersend0
|
|
33 syn keyword OPLStatement eof erase err err$ errx$ escape eval exist exp ext
|
|
34 syn keyword OPLStatement external find findfield findlib first fix$ flags
|
|
35 syn keyword OPLStatement flt font freealloc gat gborder gbox gbutton
|
|
36 syn keyword OPLStatement gcircle gclock gclose gcls gcolor gcopy gcreate
|
|
37 syn keyword OPLStatement gcreatebit gdrawobject gellipse gen$ get get$
|
|
38 syn keyword OPLStatement getcmd$ getdoc$ getevent getevent32 geteventa32
|
|
39 syn keyword OPLStatement geteventc getlibh gfill gfont ggmode ggrey gheight
|
|
40 syn keyword OPLStatement gidentity ginfo ginfo32 ginvert giprint glineby
|
|
41 syn keyword OPLStatement glineto gloadbit gloadfont global gmove gorder
|
|
42 syn keyword OPLStatement goriginx goriginy goto gotomark gpatt gpeekline
|
|
43 syn keyword OPLStatement gpoly gprint gprintb gprintclip grank gsavebit
|
|
44 syn keyword OPLStatement gscroll gsetpenwidth gsetwin gstyle gtmode gtwidth
|
|
45 syn keyword OPLStatement gunloadfont gupdate guse gvisible gwidth gx
|
|
46 syn keyword OPLStatement gxborder gxprint gy hex$ hour iabs icon if include
|
|
47 syn keyword OPLStatement input insert int intf intrans key key$ keya keyc
|
|
48 syn keyword OPLStatement killmark kmod last lclose left$ len lenalloc
|
|
49 syn keyword OPLStatement linklib ln loadlib loadm loc local lock log lopen
|
|
50 syn keyword OPLStatement lower$ lprint max mcard mcasc mean menu mid$ min
|
|
51 syn keyword OPLStatement minit minute mkdir modify month month$ mpopup
|
|
52 syn keyword OPLStatement newobj newobjh next notes num$ odbinfo off onerr
|
|
53 syn keyword OPLStatement open openr opx os parse$ path pause peek pi
|
|
54 syn keyword OPLStatement pointerfilter poke pos position possprite print
|
|
55 syn keyword OPLStatement put rad raise randomize realloc recsize rename
|
|
56 syn keyword OPLStatement rept$ return right$ rmdir rnd rollback sci$ screen
|
|
57 syn keyword OPLStatement screeninfo second secstodate send setdoc setflags
|
|
58 syn keyword OPLStatement setname setpath sin space sqr statuswin
|
|
59 syn keyword OPLStatement statwininfo std stop style sum tan testevent trap
|
|
60 syn keyword OPLStatement type uadd unloadlib unloadm until update upper$
|
|
61 syn keyword OPLStatement use usr usr$ usub val var vector week while year
|
|
62 " syn keyword OPLStatement rem
|
|
63
|
|
64
|
|
65 syn match OPLNumber "\<\d\+\>"
|
|
66 syn match OPLNumber "\<\d\+\.\d*\>"
|
|
67 syn match OPLNumber "\.\d\+\>"
|
|
68
|
|
69 syn region OPLString start=+"+ end=+"+
|
|
70 syn region OPLComment start="REM[\t ]" end="$"
|
|
71 syn match OPLMathsOperator "-\|=\|[:<>+\*^/\\]"
|
|
72
|
|
73 " Define the default highlighting.
|
|
74 " For version 5.7 and earlier: only when not done already
|
|
75 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
76 if version >= 508 || !exists("did_OPL_syntax_inits")
|
|
77 if version < 508
|
|
78 let did_OPL_syntax_inits = 1
|
|
79 command -nargs=+ HiLink hi link <args>
|
|
80 else
|
|
81 command -nargs=+ HiLink hi def link <args>
|
|
82 endif
|
|
83
|
|
84 HiLink OPLStatement Statement
|
|
85 HiLink OPLNumber Number
|
|
86 HiLink OPLString String
|
|
87 HiLink OPLComment Comment
|
|
88 HiLink OPLMathsOperator Conditional
|
|
89 " HiLink OPLError Error
|
|
90
|
|
91 delcommand HiLink
|
|
92 endif
|
|
93
|
|
94 let b:current_syntax = "opl"
|
|
95
|
|
96 " vim: ts=8
|