annotate runtime/syntax/mix.vim @ 6539:6da912e32896 v7.4.596

updated for version 7.4.596 Problem: Tiny build doesn't compile. (Ike Devolder) Solution: Add #ifdef.
author Bram Moolenaar <bram@vim.org>
date Tue, 27 Jan 2015 13:33:23 +0100
parents 0c37f66b4f3b
children 656ab57d1ddc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: MIX (Donald Knuth's assembly language used in TAOCP)
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Wu Yongwei <wuyongwei@gmail.com>
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Filenames: *.mixal *.mix
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 " Last Change: 2013 Nov 13
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " Quit when a syntax file was already loaded
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 if exists("b:current_syntax")
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 finish
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 endif
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 let s:cpo_save = &cpo
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 set cpo&vim
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 syn case ignore
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 " Special processing of ALF directive: implementations vary whether quotation
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 " marks are needed
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixAlfDirective,mixString nextgroup=mixEndComment contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 " Region for parameters
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 syn match mixParam #[-+*/:=0-9a-z,()"]\+# contains=mixIdentifier,mixSpecial,mixNumber,mixString,mixLabel nextgroup=mixEndComment contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 " Comment at the line end
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 syn match mixEndComment ".*" contains=mixRegister contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 " Identifier; must go before literals
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 syn match mixIdentifier "[a-z0-9_]\+" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 " Literals
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 syn match mixSpecial "[-+*/:=]" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syn match mixNumber "[0-9]\+\>" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 syn region mixString start=+"+ skip=+\\"+ end=+"+ contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 " Labels
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 syn match mixLabel "^[a-z0-9_]\{,10\}\s\+" nextgroup=mixAlfSpecial,mixOpcode,mixDirective
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 syn match mixLabel "[0-9][BF]" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 " Comments
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 syn match mixComment "^\*.*" contains=mixRegister
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 " Directives
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 syn keyword mixDirective ORIG EQU CON END nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 syn keyword mixDirective ALF nextgroup=mixAlfParam contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 " Opcodes
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 syn keyword mixOpcode NOP HLT NUM CHAR FLOT FIX nextgroup=mixEndComment contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 syn keyword mixOpcode FADD FSUB FMUL FDIV FCMP MOVE ADD SUB MUL DIV IOC IN OUT JRED JBUS JMP JSJ JOV JNOV JL JE JG JLE JNE JGE SLA SRA SLAX SRAX SLC SRC nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 syn match mixOpcode "LD[AX1-6]N\?\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 syn match mixOpcode "ST[AX1-6JZ]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 syn match mixOpcode "EN[TN][AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 syn match mixOpcode "INC[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 syn match mixOpcode "DEC[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 syn match mixOpcode "CMP[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 syn match mixOpcode "J[AX1-6]N\?[NZP]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 " Switch back to being case sensitive
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 syn case match
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 " Registers (only to used in comments now)
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 syn keyword mixRegister rA rX rI1 rI2 rI3 rI4 rI5 rI6 rJ contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 " The default highlighting
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 hi def link mixRegister Special
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 hi def link mixLabel Define
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 hi def link mixComment Comment
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 hi def link mixEndComment Comment
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 hi def link mixDirective Keyword
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 hi def link mixOpcode Keyword
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 hi def link mixSpecial Special
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 hi def link mixNumber Number
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 hi def link mixString String
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 hi def link mixAlfParam String
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 hi def link mixIdentifier Identifier
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 let b:current_syntax = "mix"
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 let &cpo = s:cpo_save
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 unlet s:cpo_save
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 " vim: ts=8