2 " Language: Parrot Assembler
3 " Maintainer: Scott Beck <scott@gossamer-threads.com>
4 " Last Change: 2002 Feb 28
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 syn include @Pod syntax/pod.vim
15 syn region myPod start="^=pod" start="^=item" start="^=head" end="^=cut" keepend contains=@Pod
17 syn match pasmIdentifier "[A-Za-z0-9_]\+"
18 syn match pasmLabel "[A-Za-z0-9_]\+:"he=e-1
19 syn match pasmComment "#.*"
21 " Only have 32 registers
22 syn match pasmINT "I\(\([1-2][0-9]\)\|\(3[0-2]\)\|[1-9]\)"
23 syn match pasmSTR "S\(\([1-2][0-9]\)\|\(3[0-2]\)\|[1-9]\)"
24 syn match pasmFLT "N\(\([1-2][0-9]\)\|\(3[0-2]\)\|[1-9]\)"
25 syn match pasmPMC "P\(\([1-2][0-9]\)\|\(3[0-2]\)\|[1-9]\)"
27 syn match pasmNumber "[0-9]\+"
28 syn match pasmString +"[^"]\+"+
30 syn keyword pasmOpBasic end noop
31 syn keyword pasmOpSystem close err open readline ord print read time write
32 syn keyword pasmOpRegLoad set set_keyed clone
33 syn keyword pasmOpCond eq ne lt le gt ge if unless
34 syn keyword pasmOpArith abs add cmod dec div inc mod mul not pow sub
35 syn keyword pasmOpString chopm concat repeat length substr
36 syn keyword pasmOpMath acos asec asin atan cos cosh exp ln log10 log2 sec sech sin sinh tan tanh
37 syn keyword pasmOpBit and not or shl shr xor
38 syn keyword pasmOpFlags debug bounds profile trace
39 syn keyword pasmOpReg cleari clearn clearp clears popi popn popp pops pushi pushn pushp pushs
40 syn keyword pasmOpRegStack entrytype save restore rotate_up
41 syn keyword pasmOpCtrlFlow branch bsr jsr jump
42 syn keyword pasmOpSymbolTbl find_global
43 syn keyword pasmOpMisc newinterp runinterp new find_type ret sleep setline getline setfile getfile setpackage getpackage warningson warningsoff
45 " Define the default highlighting.
46 " For version 5.7 and earlier: only when not done already
47 " For version 5.8 and later: only when an item doesn't have highlighting yet
48 if version >= 508 || !exists("did_pasm_syntax_inits")
50 let did_pasm_syntax_inits = 1
51 command -nargs=+ HiLink hi link <args>
53 command -nargs=+ HiLink hi def link <args>
56 HiLink pasmLabel Label
57 HiLink pasmIdentifier Identifier
62 HiLink pasmNumber Number
63 HiLink pasmString String
64 HiLink pasmComment Comment
65 HiLink pasmOp Statement
66 HiLink pasmOpBasic pasmOp
67 HiLink pasmOpSystem pasmOp
68 HiLink pasmOpRegLoad pasmOp
69 HiLink pasmOpCond pasmOp
70 HiLink pasmOpArith pasmOp
71 HiLink pasmOpString pasmOp
72 HiLink pasmOpMath pasmOp
73 HiLink pasmOpBit pasmOp
74 HiLink pasmOpFlags pasmOp
75 HiLink pasmOpReg pasmOp
76 HiLink pasmOpRegStack pasmOp
77 HiLink pasmOpCtrlFlow pasmOp
78 HiLink pasmOpSymbolTbl pasmOp
79 HiLink pasmOpMisc pasmOp
84 let b:current_syntax = "pasm"