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