home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / dos / syntax / grads.vim < prev    next >
Encoding:
Text File  |  2010-08-14  |  2.1 KB  |  87 lines

  1. " Vim syntax file
  2. " Language:    grads (GrADS scripts)
  3. " Maintainer:    Stefan Fronzek (sfronzek at gmx dot net)
  4. " Last change: 13 Feb 2004
  5.  
  6. " Grid Analysis and Display System (GrADS); http://grads.iges.org/grads
  7. " This syntax file defines highlighting for only very few features of
  8. " the GrADS scripting language.
  9.  
  10. " For version 5.x: Clear all syntax items
  11. " For version 6.x: Quit when a syntax file was already loaded
  12. if version < 600
  13.   syntax clear
  14. elseif exists("b:current_syntax")
  15.   finish
  16. endif
  17.  
  18. " GrADS is entirely case-insensitive.
  19. syn case ignore
  20.  
  21. " The keywords
  22.  
  23. syn keyword gradsStatement    if else endif break exit return
  24. syn keyword gradsStatement    while endwhile say prompt pull function
  25. syn keyword gradsStatement subwrd sublin substr read write close
  26. " String
  27.  
  28. syn region gradsString        start=+'+ end=+'+
  29.  
  30. " Integer number
  31. syn match  gradsNumber        "[+-]\=\<[0-9]\+\>"
  32.  
  33. " Operator
  34.  
  35. "syn keyword gradsOperator    | ! % & != >=
  36. "syn match gradsOperator        "[^\.]not[^a-zA-Z]"
  37.  
  38. " Variables
  39.  
  40. syn keyword gradsFixVariables    lat lon lev result rec rc
  41. syn match gradsglobalVariables    "_[a-zA-Z][a-zA-Z0-9]*"
  42. syn match gradsVariables        "[a-zA-Z][a-zA-Z0-9]*"
  43. syn match gradsConst        "#[A-Z][A-Z_]+"
  44.  
  45. " Comments
  46.  
  47. syn match gradsComment    "\*.*"
  48.  
  49. " Typical Typos
  50.  
  51. " for C programmers:
  52. " syn match gradsTypos    "=="
  53. " syn match gradsTypos    "!="
  54.  
  55. " Define the default highlighting.
  56. " For version 5.7 and earlier: only when not done already
  57. " For version 5.8 and later: only when an item doesn't hgs highlighting+yet
  58. if version >= 508 || !exists("did_gs_syn_inits")
  59.   if version < 508
  60.     let did_gs_syn_inits = 1
  61.     command -nargs=+ HiLink hi link <args>
  62.   else
  63.     command -nargs=+ HiLink hi def link <args>
  64.   endif
  65.  
  66.   HiLink gradsStatement        Statement
  67.  
  68.   HiLink gradsString        String
  69.   HiLink gradsNumber        Number
  70.  
  71.   HiLink gradsFixVariables    Special
  72.   HiLink gradsVariables        Identifier
  73.   HiLink gradsglobalVariables    Special
  74.   HiLink gradsConst        Special
  75.  
  76.   HiLink gradsClassMethods    Function
  77.  
  78.   HiLink gradsOperator        Operator
  79.   HiLink gradsComment        Comment
  80.  
  81.   HiLink gradsTypos        Error
  82.  
  83.   delcommand HiLink
  84. endif
  85.  
  86. let b:current_syntax = "grads"
  87.