blob: c6618adacbef5fb5357e8af4f3fdfe5550995731 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: PL/M
3" Maintainer: Philippe Coulonges <cphil@cphil.net>
4" Last change: 2003 May 11
5
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02006" quit when a syntax file was already loaded
7if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00008 finish
9endif
10
11" PL/M is a case insensitive language
12syn case ignore
13
14syn keyword plmTodo contained TODO FIXME XXX
15
16" String
17syn region plmString start=+'+ end=+'+
18
19syn match plmOperator "[@=\+\-\*\/\<\>]"
20
21syn match plmIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
22
23syn match plmDelimiter "[();,]"
24
25syn region plmPreProc start="^\s*\$\s*" skip="\\$" end="$"
26
27" FIXME : No Number support for floats, as I'm working on an embedded
28" project that doesn't use any.
29syn match plmNumber "-\=\<\d\+\>"
30syn match plmNumber "\<[0-9a-fA-F]*[hH]*\>"
31
32" If you don't like tabs
33"syn match plmShowTab "\t"
34"syn match plmShowTabc "\t"
35
36"when wanted, highlight trailing white space
37if exists("c_space_errors")
38 syn match plmSpaceError "\s*$"
39 syn match plmSpaceError " \+\t"me=e-1
40endif
41
42"
43 " Use the same control variable as C language for I believe
44 " users will want the same behavior
45if exists("c_comment_strings")
46 " FIXME : don't work fine with c_comment_strings set,
47 " which I don't care as I don't use
48
49 " A comment can contain plmString, plmCharacter and plmNumber.
50 " But a "*/" inside a plmString in a plmComment DOES end the comment! So we
51 " need to use a special type of plmString: plmCommentString, which also ends on
52 " "*/", and sees a "*" at the start of the line as comment again.
53 syntax match plmCommentSkip contained "^\s*\*\($\|\s\+\)"
54 syntax region plmCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=plmSpecial,plmCommentSkip
55 syntax region plmComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=plmSpecial
56 syntax region plmComment start="/\*" end="\*/" contains=plmTodo,plmCommentString,plmCharacter,plmNumber,plmFloat,plmSpaceError
57 syntax match plmComment "//.*" contains=plmTodo,plmComment2String,plmCharacter,plmNumber,plmSpaceError
58else
59 syn region plmComment start="/\*" end="\*/" contains=plmTodo,plmSpaceError
60 syn match plmComment "//.*" contains=plmTodo,plmSpaceError
61endif
62
63syntax match plmCommentError "\*/"
64
65syn keyword plmReserved ADDRESS AND AT BASED BY BYTE CALL CASE
66syn keyword plmReserved DATA DECLARE DISABLE DO DWORD
67syn keyword plmReserved ELSE ENABLE END EOF EXTERNAL
68syn keyword plmReserved GO GOTO HALT IF INITIAL INTEGER INTERRUPT
69syn keyword plmReserved LABEL LITERALLY MINUS MOD NOT OR
70syn keyword plmReserved PLUS POINTER PROCEDURE PUBLIC
71syn keyword plmReserved REAL REENTRANT RETURN SELECTOR STRUCTURE
72syn keyword plmReserved THEN TO WHILE WORD XOR
73syn keyword plm386Reserved CHARINT HWORD LONGINT OFFSET QWORD SHORTINT
74
75syn keyword plmBuiltIn ABS ADJUSTRPL BLOCKINPUT BLOCKINWORD BLOCKOUTPUT
76syn keyword plmBuiltIn BLOCKOUTWORD BUILPTR CARRY CAUSEINTERRUPT CMPB
77syn keyword plmBuiltIn CMPW DEC DOUBLE FINDB FINDRB FINDRW FINDW FIX
78syn keyword plmBuiltIn FLAGS FLOAT GETREALERROR HIGH IABS INITREALMATHUNIT
79syn keyword plmBuiltIn INPUT INT INWORD LAST LOCKSET LENGTH LOW MOVB MOVE
80syn keyword plmBuiltIn MOVRB MOVRW MOVW NIL OUTPUT OUTWORD RESTOREREALSTATUS
81syn keyword plmBuiltIn ROL ROR SAL SAVEREALSTATUS SCL SCR SELECTOROF SETB
82syn keyword plmBuiltIn SETREALMODE SETW SHL SHR SIGN SIGNED SIZE SKIPB
83syn keyword plmBuiltIn SKIPRB SKIPRW SKIPW STACKBASE STACKPTR TIME SIZE
84syn keyword plmBuiltIn UNSIGN XLAT ZERO
85syn keyword plm386BuiltIn INTERRUPT SETINTERRUPT
86syn keyword plm286BuiltIn CLEARTASKSWITCHEDFLAG GETACCESSRIGHTS
87syn keyword plm286BuiltIn GETSEGMENTLIMIT LOCALTABLE MACHINESTATUS
88syn keyword plm286BuiltIn OFFSETOF PARITY RESTOREGLOBALTABLE
89syn keyword plm286BuiltIn RESTOREINTERRUPTTABLE SAVEGLOBALTABLE
90syn keyword plm286BuiltIn SAVEINTERRUPTTABLE SEGMENTREADABLE
91syn keyword plm286BuiltIn SEGMENTWRITABLE TASKREGISTER WAITFORINTERRUPT
92syn keyword plm386BuiltIn CONTROLREGISTER DEBUGREGISTER FINDHW
93syn keyword plm386BuiltIn FINDRHW INHWORD MOVBIT MOVRBIT MOVHW MOVRHW
94syn keyword plm386BuiltIn OUTHWORD SCANBIT SCANRBIT SETHW SHLD SHRD
95syn keyword plm386BuiltIn SKIPHW SKIPRHW TESTREGISTER
96syn keyword plm386w16BuiltIn BLOCKINDWORD BLOCKOUTDWORD CMPD FINDD
97syn keyword plm386w16BuiltIn FINDRD INDWORD MOVD MOVRD OUTDWORD
98syn keyword plm386w16BuiltIn SETD SKIPD SKIPRD
99
100syn sync lines=50
101
102" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200103" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200105" The default methods for highlighting. Can be overridden later
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200106" hi def link plmLabel Label
107" hi def link plmConditional Conditional
108" hi def link plmRepeat Repeat
109hi def link plmTodo Todo
110hi def link plmNumber Number
111hi def link plmOperator Operator
112hi def link plmDelimiter Operator
113"hi def link plmShowTab Error
114"hi def link plmShowTabc Error
115hi def link plmIdentifier Identifier
116hi def link plmBuiltIn Statement
117hi def link plm286BuiltIn Statement
118hi def link plm386BuiltIn Statement
119hi def link plm386w16BuiltIn Statement
120hi def link plmReserved Statement
121hi def link plm386Reserved Statement
122hi def link plmPreProc PreProc
123hi def link plmCommentError plmError
124hi def link plmCommentString plmString
125hi def link plmComment2String plmString
126hi def link plmCommentSkip plmComment
127hi def link plmString String
128hi def link plmComment Comment
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
Bram Moolenaar071d4272004-06-13 20:20:40 +0000130
131let b:current_syntax = "plm"
132
133" vim: ts=8 sw=2
134