" Vim syntax file " Language: Parallax SX/B BASIC 2.0 " Syntax Ver: 1.0 " Maintainer: David Mcanulty " Last Change: Mon Mar 9 15:47:08 PDT 2009 " " Most code borrowed from basic.vim " Maintainer: Allan Kelly " Last Change: Tue Sep 14 14:24:23 BST 1999 " A bunch of useful SX/B BASIC keywords syn keyword basicStatement BANK Bank bank syn keyword basicStatement CON Con con DATA data Data WDATA Wdata wdataRAM12 syn keyword basicStatement DEC Dec dec INC Inc inc syn keyword basicStatement DEVICE device Device SX28 SX50 SX48 TURBO BANKS8 OSCHS3 OSCHS2 OSCXT2 BOR42 SYNC OPTIONX syn keyword basicStatement DO do Do LOOP loop Loop UNTIL Until until syn keyword basicStatement FOR for For NEXT next Next syn keyword basicStatement FREQ freq syn keyword basicStatement FUNC Func func ENDFUNC Endfunc endfunc syn keyword basicStatement GOSUB gosub Gosub GOTO goto Goto syn keyword basicStatement ID id syn keyword basicStatement IF if If THEN then Then ELSE else Else ENDIF Endif endif Elseif elseif elseif syn keyword basicStatement INTERRUPT Interrupt interrupt RETURNINT Returnint returnint syn keyword basicStatement IRC_CAL irc_cal IRC_SLOW irc_slow IRC_FAST irc_fast syn keyword basicStatement LOOKUP Lookup lookup syn keyword basicStatement PAUSE Pause pause syn keyword basicStatement PIN pin SCHMITT schmitt CMOS cmos INTR_RISE intr_rise OUTPUT output INPUT input syn keyword basicStatement PROGRAM Program program END End end syn keyword basicStatement PULSIN Pulsein pulsein PULSOUT Pulsout pulsout syn keyword basicStatement RETURN return Return syn keyword basicStatement STACK Stack stack SWAP Swap swap syn keyword basicStatement SUB sub Sub ENDSUB Endsub enbsub syn keyword basicStatement TASK Task task TASKS Tasks tasks ENDTASK Endtask endtask syn keyword basicStatement TOGGLE Toggle toggle syn keyword basicStatement WATCH Watch watch UBIN Ubin ubin UDEC Udec udec BREAK Break break syn keyword basicStatement WHILE while While WEND wend Wend syn keyword basicStatement VAR Var var WORD Word word BIT Bit bit BYTE Byte byte syn keyword basicStatement READ read Read "integer number, or floating point number without a dot. syn match basicNumber "\<\d\+\>" "floating point number, with dot syn match basicNumber "\<\d\+\.\d*\>" "IO ports syn match basicFunction " RA " syn match basicFunction " RB " syn match basicFunction " RC " syn match basicFunction "RA\.\d\+" syn match basicFunction "RB\.\d\+" syn match basicFunction "RC\.\d\+" syn match basicFunction "ST_[A-D]\+" syn match basicFunction "PLP_[A-D]\+" syn match basicFunction "TRIS_[A-D]\+" "Labels: syn match basicFunction "\w\+:" "builin variables syn keyword basicFunction __PARAMCNT syn match basicFunction "__PARAM\d\+" syn match basicFunction "__WPARAM\d\+" " String and Character contstants syn match basicSpecial contained "\\\d\d\d\|\\." syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial syn region basicComment start="REM" end="$" contains=basicTodo syn region basicComment start="'" end="$" contains=basicTodo syn region basicLineNumber start="^\d" end="\s" syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 " Used with OPEN statement syn match basicFilenumber "#\d\+" "syn sync ccomment basicComment " syn match basicMathsOperator "[<>+\*^/\\=-]" syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_basic_syntax_inits") if version < 508 let did_basic_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink basicLabel Label HiLink basicConditional Conditional HiLink basicRepeat Repeat HiLink basicLineNumber Comment HiLink basicNumber Number HiLink basicError Error HiLink basicStatement Statement HiLink basicString String HiLink basicComment Comment HiLink basicSpecial Special HiLink basicTodo Todo HiLink basicFunction Identifier HiLink basicTypeSpecifier Type HiLink basicFilenumber basicTypeSpecifier "hi basicMathsOperator term=bold cterm=bold gui=bold delcommand HiLink endif let b:current_syntax = "basic" " vim: ts=8