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

  1. " Vim syntax file
  2. " Language:    BASIC
  3. " Maintainer:    Allan Kelly <Allan.Kelly@ed.ac.uk>
  4. " Last change:    1998 February 19
  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 BLOAD BSAVE CALL ABSOLUTE CHAIN CHDIR CIRCLE
  15. syn keyword basicStatement    CLEAR CLOSE CLS COLOR COM COMMON CONST DATA 
  16. syn keyword basicStatement    DECLARE DEF DEFDBL DEFINT DEFLNG DEFSNG DEFSTR DIM
  17. syn keyword basicStatement    DO LOOP DRAW END ENVIRON ERASE ERROR EXIT FIELD
  18. syn keyword basicStatement    FILES FOR NEXT FUNCTION GET GOSUB GOTO IF THEN ELSE
  19. syn keyword basicStatement    INPUT INPUT# IOCTL KEY KILL LET LINE LOCATE
  20. syn keyword basicStatement    LOCK UNLOCK LPRINT USING LSET MKDIR NAME 
  21. syn keyword basicStatement    ON ERROR OPEN OPTION BASE OUT PAINT PALETTE PCOPY
  22. syn keyword basicStatement    PEN PLAY PMAP POKE PRESET PRINT PRINT# USING PSET
  23. syn keyword basicStatement    PUT RANDOMIZE READ REDIM RESET RESTORE RESUME 
  24. syn keyword basicStatement    RETURN RMDIR RSET RUN SEEK SELECT CASE
  25. syn keyword basicStatement    SHARED SHELL SLEEP SOUND STATIC STOP STRIG SUB
  26. syn keyword basicStatement    SWAP SYSTEM TIMER TROFF TRON TYPE UNLOCK
  27. syn keyword basicStatement    VIEW WAIT WHILE WEND WIDTH WINDOW WRITE
  28. syn keyword basicStatement    DATE$ MID$ TIME$
  29.  
  30. syn keyword basicFunction    ABS ASC ATN CDBL CINT CLNG COS CSNG CSRLIN CVD CVDMBF
  31. syn keyword basicFunction    CVI CVL CVS CVSMBF EOF ERDEV ERL ERR EXP FILEATTR
  32. syn keyword basicFunction    FIX FRE FREEFILE INP INSTR INT LBOUND LEN LOC LOF
  33. syn keyword basicFunction    LOG LPOS PEEK PEN POINT POS RND SADD SCREEN SEEK
  34. syn keyword basicFunction    SETMEM SGN SIN SPC SQR STICK STRIG TAB TAN UBOUND
  35. syn keyword basicFunction    VAL VALPTR VALSEG VARPTR VARSEG
  36. syn keyword basicFunction    CHR\$ COMMAND$ DATE$ ENVIRON$ ERDEV$ HEX$ INKEY$
  37. syn keyword basicFunction    INPUT$ IOCTL$ LCASES$ LAFT$ LTRIM$ MID$ MKDMBF$ MKD$
  38. syn keyword basicFunction    MKI$ MKL$ MKSMBF$ MKS$ OCT$ RIGHT$ RTRIM$ SPACE$
  39. syn keyword basicFunction    STR$ STRING$ TIME$ UCASE$ VARPTR$
  40. syn keyword basicTodo contained    TODO
  41.  
  42. "integer number, or floating point number without a dot.
  43. syn match  basicNumber        "\<\d\+\>"
  44. "floating point number, with dot
  45. syn match  basicNumber        "\<\d\+\.\d*\>"
  46. "floating point number, starting with a dot
  47. syn match  basicNumber        "\.\d\+\>"
  48.  
  49. " String and Character contstants
  50. syn match   basicSpecial contained "\\\d\d\d\|\\."
  51. syn region  basicString          start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=basicSpecial
  52.  
  53. syn region  basicComment    start="REM" end="$" contains=basicTodo
  54. syn region  basicLineNumber    start="^\d" end="\s"
  55. syn match   basicTypeSpecifier  "[a-zA-Z0-9][\$%&!#]"ms=s+1
  56. " Used with OPEN statement
  57. syn match   basicFilenumber  "#\d\+"
  58. "syn sync ccomment basicComment
  59. " syn match   basicMathsOperator "[<>+\*^/\\=-]"
  60. syn match   basicMathsOperator   "-\|=\|[:<>+\*^/\\]\|AND\|OR"
  61.  
  62. if !exists("did_basic_syntax_inits")
  63.   let did_basic_syntax_inits = 1
  64.   " The default methods for highlighting.  Can be overridden later
  65.   hi link basicLabel        Label
  66.   hi link basicConditional    Conditional
  67.   hi link basicRepeat        Repeat
  68.   hi link basicLineNumber    Comment
  69.   hi link basicNumber        Number
  70.   hi link basicError        Error
  71.   hi link basicStatement    Statement
  72.   hi link basicString        String
  73.   hi link basicComment        Comment
  74.   hi link basicSpecial        Special
  75.   hi link basicTodo        Todo
  76.   hi link basicFunction        Identifier
  77.   hi link basicTypeSpecifier Type
  78.   hi link basicFilenumber basicTypeSpecifier
  79.   hi basicMathsOperator term=bold cterm=bold gui=bold
  80. endif
  81.  
  82. let b:current_syntax = "basic"
  83.  
  84. " vim: ts=8
  85.