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