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