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 / mac / vim55rt.sit / runtime / syntax / basic.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  7.9 KB  |  159 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    BASIC
  3. " Maintainer:    Allan Kelly <Allan.Kelly@ed.ac.uk>
  4. " Last change:    Tue Sep 14 14:24:23 BST 1999
  5.  
  6. " First version based on Micro$soft QBASIC circa 1989, as documented in
  7. " 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989.
  8. " This syntax file not a complete implementation yet.  Send suggestions to the
  9. " maintainer.
  10.  
  11. " Remove any old syntax stuff hanging around
  12. syn clear
  13. " A bunch of useful BASIC keywords
  14. syn keyword basicStatement    BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave
  15. syn keyword basicStatement    CALL call Call ABSOLUTE absolute Absolute
  16. syn keyword basicStatement    CHAIN chain Chain CHDIR chdir Chdir
  17. syn keyword basicStatement    CIRCLE circle Circle CLEAR clear Clear
  18. syn keyword basicStatement    CLOSE close Close CLS cls Cls COLOR color Color
  19. syn keyword basicStatement    COM com Com COMMON common Common
  20. syn keyword basicStatement    CONST const Const DATA data Data
  21. syn keyword basicStatement    DECLARE declare Declare DEF def Def
  22. syn keyword basicStatement    DEFDBL defdbl Defdbl DEFINT defint Defint
  23. syn keyword basicStatement    DEFLNG deflng Deflng DEFSNG defsng Defsng
  24. syn keyword basicStatement    DEFSTR defstr Defstr DIM dim Dim
  25. syn keyword basicStatement    DO do Do LOOP loop Loop
  26. syn keyword basicStatement    DRAW draw Draw END end End
  27. syn keyword basicStatement    ENVIRON environ Environ ERASE erase Erase
  28. syn keyword basicStatement    ERROR error Error EXIT exit Exit
  29. syn keyword basicStatement    FIELD field Field FILES files Files
  30. syn keyword basicStatement    FOR for For NEXT next Next
  31. syn keyword basicStatement    FUNCTION function Function GET get Get
  32. syn keyword basicStatement    GOSUB gosub Gosub GOTO goto Goto
  33. syn keyword basicStatement    IF if If THEN then Then ELSE else Else
  34. syn keyword basicStatement    INPUT input Input INPUT# input# Input#
  35. syn keyword basicStatement    IOCTL ioctl Ioctl KEY key Key
  36. syn keyword basicStatement    KILL kill Kill LET let Let
  37. syn keyword basicStatement    LINE line Line LOCATE locate Locate
  38. syn keyword basicStatement    LOCK lock Lock UNLOCK unlock Unlock
  39. syn keyword basicStatement    LPRINT lprint Lprint USING using Using
  40. syn keyword basicStatement    LSET lset Lset MKDIR mkdir Mkdir
  41. syn keyword basicStatement    NAME name Name ON on On
  42. syn keyword basicStatement    ERROR error Error OPEN open Open
  43. syn keyword basicStatement    OPTION option Option BASE base Base
  44. syn keyword basicStatement    OUT out Out PAINT paint Paint
  45. syn keyword basicStatement    PALETTE palette Palette PCOPY pcopy Pcopy
  46. syn keyword basicStatement    PEN pen Pen PLAY play Play
  47. syn keyword basicStatement    PMAP pmap Pmap POKE poke Poke
  48. syn keyword basicStatement    PRESET preset Preset PRINT print Print
  49. syn keyword basicStatement    PRINT# print# Print# USING using Using
  50. syn keyword basicStatement    PSET pset Pset PUT put Put
  51. syn keyword basicStatement    RANDOMIZE randomize Randomize READ read Read
  52. syn keyword basicStatement    REDIM redim Redim RESET reset Reset
  53. syn keyword basicStatement    RESTORE restore Restore RESUME resume Resume
  54. syn keyword basicStatement    RETURN return Return RMDIR rmdir Rmdir
  55. syn keyword basicStatement    RSET rset Rset RUN run Run
  56. syn keyword basicStatement    SEEK seek Seek SELECT select Select
  57. syn keyword basicStatement    CASE case Case SHARED shared Shared
  58. syn keyword basicStatement    SHELL shell Shell SLEEP sleep Sleep
  59. syn keyword basicStatement    SOUND sound Sound STATIC static Static
  60. syn keyword basicStatement    STOP stop Stop STRIG strig Strig
  61. syn keyword basicStatement    SUB sub Sub SWAP swap Swap
  62. syn keyword basicStatement    SYSTEM system System TIMER timer Timer
  63. syn keyword basicStatement    TROFF troff Troff TRON tron Tron
  64. syn keyword basicStatement    TYPE type Type UNLOCK unlock Unlock
  65. syn keyword basicStatement    VIEW view View WAIT wait Wait
  66. syn keyword basicStatement    WHILE while While WEND wend Wend
  67. syn keyword basicStatement    WIDTH width Width WINDOW window Window
  68. syn keyword basicStatement    WRITE write Write DATE$ date$ Date$
  69. syn keyword basicStatement    MID$ mid$ Mid$ TIME$ time$ Time$
  70.  
  71. syn keyword basicFunction    ABS abs Abs ASC asc Asc
  72. syn keyword basicFunction    ATN atn Atn CDBL cdbl Cdbl
  73. syn keyword basicFunction    CINT cint Cint CLNG clng Clng
  74. syn keyword basicFunction    COS cos Cos CSNG csng Csng
  75. syn keyword basicFunction    CSRLIN csrlin Csrlin CVD cvd Cvd
  76. syn keyword basicFunction    CVDMBF cvdmbf Cvdmbf CVI cvi Cvi
  77. syn keyword basicFunction    CVL cvl Cvl CVS cvs Cvs
  78. syn keyword basicFunction    CVSMBF cvsmbf Cvsmbf EOF eof Eof
  79. syn keyword basicFunction    ERDEV erdev Erdev ERL erl Erl
  80. syn keyword basicFunction    ERR err Err EXP exp Exp
  81. syn keyword basicFunction    FILEATTR fileattr Fileattr FIX fix Fix
  82. syn keyword basicFunction    FRE fre Fre FREEFILE freefile Freefile
  83. syn keyword basicFunction    INP inp Inp INSTR instr Instr
  84. syn keyword basicFunction    INT int Int LBOUND lbound Lbound
  85. syn keyword basicFunction    LEN len Len LOC loc Loc
  86. syn keyword basicFunction    LOF lof Lof LOG log Log
  87. syn keyword basicFunction    LPOS lpos Lpos PEEK peek Peek
  88. syn keyword basicFunction    PEN pen Pen POINT point Point
  89. syn keyword basicFunction    POS pos Pos RND rnd Rnd
  90. syn keyword basicFunction    SADD sadd Sadd SCREEN screen Screen
  91. syn keyword basicFunction    SEEK seek Seek SETMEM setmem Setmem
  92. syn keyword basicFunction    SGN sgn Sgn SIN sin Sin
  93. syn keyword basicFunction    SPC spc Spc SQR sqr Sqr
  94. syn keyword basicFunction    STICK stick Stick STRIG strig Strig
  95. syn keyword basicFunction    TAB tab Tab TAN tan Tan
  96. syn keyword basicFunction    UBOUND ubound Ubound VAL val Val
  97. syn keyword basicFunction    VALPTR valptr Valptr VALSEG valseg Valseg
  98. syn keyword basicFunction    VARPTR varptr Varptr VARSEG varseg Varseg
  99. syn keyword basicFunction    CHR$ Chr$ chr$ COMMAND$ command$ Command$
  100. syn keyword basicFunction    DATE$ date$ Date$ ENVIRON$ environ$ Environ$
  101. syn keyword basicFunction    ERDEV$ erdev$ Erdev$ HEX$ hex$ Hex$
  102. syn keyword basicFunction    INKEY$ inkey$ Inkey$ INPUT$ input$ Input$
  103. syn keyword basicFunction    IOCTL$ ioctl$ Ioctl$ LCASES$ lcases$ Lcases$
  104. syn keyword basicFunction    LAFT$ laft$ Laft$ LTRIM$ ltrim$ Ltrim$
  105. syn keyword basicFunction    MID$ mid$ Mid$ MKDMBF$ mkdmbf$ Mkdmbf$
  106. syn keyword basicFunction    MKD$ mkd$ Mkd$ MKI$ mki$ Mki$
  107. syn keyword basicFunction    MKL$ mkl$ Mkl$ MKSMBF$ mksmbf$ Mksmbf$
  108. syn keyword basicFunction    MKS$ mks$ Mks$ OCT$ oct$ Oct$
  109. syn keyword basicFunction    RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$
  110. syn keyword basicFunction    SPACE$ space$ Space$ STR$ str$ Str$
  111. syn keyword basicFunction    STRING$ string$ String$ TIME$ time$ Time$
  112. syn keyword basicFunction    UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$
  113. syn keyword basicTodo contained    TODO
  114.  
  115. "integer number, or floating point number without a dot.
  116. syn match  basicNumber        "\<\d\+\>"
  117. "floating point number, with dot
  118. syn match  basicNumber        "\<\d\+\.\d*\>"
  119. "floating point number, starting with a dot
  120. syn match  basicNumber        "\.\d\+\>"
  121.  
  122. " String and Character contstants
  123. syn match   basicSpecial contained "\\\d\d\d\|\\."
  124. syn region  basicString          start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=basicSpecial
  125.  
  126. syn region  basicComment    start="REM" end="$" contains=basicTodo
  127. syn region  basicComment    start="^[ \t]*'" end="$" contains=basicTodo
  128. syn region  basicLineNumber    start="^\d" end="\s"
  129. syn match   basicTypeSpecifier  "[a-zA-Z0-9][\$%&!#]"ms=s+1
  130. " Used with OPEN statement
  131. syn match   basicFilenumber  "#\d\+"
  132. "syn sync ccomment basicComment
  133. " syn match   basicMathsOperator "[<>+\*^/\\=-]"
  134. syn match   basicMathsOperator   "-\|=\|[:<>+\*^/\\]\|AND\|OR"
  135.  
  136. if !exists("did_basic_syntax_inits")
  137.   let did_basic_syntax_inits = 1
  138.   " The default methods for highlighting.  Can be overridden later
  139.   hi link basicLabel        Label
  140.   hi link basicConditional    Conditional
  141.   hi link basicRepeat        Repeat
  142.   hi link basicLineNumber    Comment
  143.   hi link basicNumber        Number
  144.   hi link basicError        Error
  145.   hi link basicStatement    Statement
  146.   hi link basicString        String
  147.   hi link basicComment        Comment
  148.   hi link basicSpecial        Special
  149.   hi link basicTodo        Todo
  150.   hi link basicFunction        Identifier
  151.   hi link basicTypeSpecifier Type
  152.   hi link basicFilenumber basicTypeSpecifier
  153.   hi basicMathsOperator term=bold cterm=bold gui=bold
  154. endif
  155.  
  156. let b:current_syntax = "basic"
  157.  
  158. " vim: ts=8
  159.