home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / asm.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  2.0 KB  |  86 lines

  1. " Vim syntax file
  2. " Language:    GNU Assembler
  3. " Maintainer:    Kevin Dahlhausen <ap096@po.cwru.edu>
  4. " Last change:    1997 April 20
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. syn case ignore
  10.  
  11.  
  12. " storage types
  13. syn match asmType "\.long"
  14. syn match asmType "\.ascii"
  15. syn match asmType "\.asciz"
  16. syn match asmType "\.byte"
  17. syn match asmType "\.double"
  18. syn match asmType "\.float"
  19. syn match asmType "\.hword"
  20. syn match asmType "\.int"
  21. syn match asmType "\.octa"
  22. syn match asmType "\.quad"
  23. syn match asmType "\.short"
  24. syn match asmType "\.single"
  25. syn match asmType "\.space"
  26. syn match asmType "\.string"
  27. syn match asmType "\.word"
  28.  
  29. syn match asmLabel        "[a-z_][a-z0-9_]*:"he=e-1
  30. syn match asmIdentifier     "[a-z_][a-z0-9_]*"
  31.  
  32. " Various #'s as defined by GAS ref manual sec 3.6.2.1
  33. " Technically, the first decNumber def is actually octal,
  34. " since the value of 0-7 octal is the same as 0-7 decimal,
  35. " I prefer to map it as decimal:
  36. syn match decNumber        "0\+[1-7]\=[\t\n$,; ]"
  37. syn match decNumber        "[1-9]\d*"
  38. syn match octNumber        "0[0-7][0-7]\+"
  39. syn match hexNumber        "0[xX][0-9a-fA-F]\+"
  40. syn match binNumber        "0[bB][0-1]*"
  41.  
  42.  
  43. syn match asmSpecialComment    ";\*\*\*.*"
  44. syn match asmComment        ";.*"hs=s+1
  45.  
  46. syn match asmInclude        "\.include"
  47. syn match asmCond        "\.if"
  48. syn match asmCond        "\.else"
  49. syn match asmCond        "\.endif"
  50. syn match asmMacro        "\.macro"
  51. syn match asmMacro        "\.endm"
  52.  
  53. syn match asmDirective        "\.[a-z][a-z]\+"
  54.  
  55.  
  56. syn case match
  57.  
  58. if !exists("did_asm_syntax_inits")
  59.   let did_asm_syntax_inits = 1
  60.  
  61.   " The default methods for highlighting.  Can be overridden later
  62.   hi link asmSection    Special
  63.   hi link asmLabel    Label
  64.   hi link asmComment    Comment
  65.   hi link asmDirective    Statement
  66.  
  67.   hi link asmInclude    Include
  68.   hi link asmCond    PreCondit
  69.   hi link asmMacro    Macro
  70.  
  71.   hi link hexNumber    Number
  72.   hi link decNumber    Number
  73.   hi link octNumber    Number
  74.   hi link binNumber    Number
  75.  
  76.   " My default color overrides:
  77.   hi asmSpecialComment ctermfg=red
  78.   hi asmIdentifier ctermfg=lightcyan
  79.   hi asmType ctermbg=black ctermfg=brown
  80.  
  81. endif
  82.  
  83. let b:current_syntax = "asm"
  84.  
  85. " vim: ts=8
  86.