Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
freebasic.vim675 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:		FreeBASIC3" Maintainer:		Doug Kearns <dougkearns@gmail.com>4" Previous Maintainer:	Mark Manning <markem@sim1.us>5" Last Change:		2023 Aug 146"7" Description:8"9"	Based originally on the work done by Allan Kelly <Allan.Kelly@ed.ac.uk>10"	Updated by Mark Manning <markem@sim1.us>11"	Applied FreeBASIC support to the already excellent support12"	for standard basic syntax (like QB).13"14"	First version based on Micro$soft QBASIC circa15"	1989, as documented in 'Learn BASIC Now' by16"	Halvorson&Rygmyr. Microsoft Press 1989.  This syntax file17"	not a complete implementation yet.  Send suggestions to18"	the maintainer.19"20"	TODO: split this into separate dialect-based files, possibly with a common base21"22"	Quit when a (custom) syntax file was already loaded (Taken from c.vim)23"24if exists("b:current_syntax")25  finish26endif27"28"	Dialect detection29"30let s:lang = freebasic#GetDialect()31"32"	Whitespace Errors33"34if exists("freebasic_space_errors")35  if !exists("freebasic_no_trail_space_error")36    syn match freebasicSpaceError display excludenl "\s\+$"37  endif38  if !exists("freebasic_no_tab_space_error")39    syn match freebasicSpaceError display " \+\t"me=e-140  endif41endif42"43"	Be sure to turn on the "case ignore" since current versions44"	of freebasic support both upper as well as lowercase45"	letters. - MEM 10/1/200646"47syn case ignore48"49"	Do the Basic variables names first.  This is because it50"	is the most inclusive of the tests.  Later on we change51"	this so the identifiers are split up into the various52"	types of identifiers like functions, basic commands and53"	such. MEM 9/9/200654"55if s:lang =~# '\<\%(qb\|fblite\)\>'56  syn iskeyword @,48-57,_,192-255,.57  syn match	freebasicIdentifier		"\<\h\%(\w\|\.\)*\>"58  syn match	freebasicGenericFunction	"\<\h\%(\w\|\.\)*\>\ze\s*("59else60  syn iskeyword @,48-57,_,192-25561  syn match	freebasicIdentifier		"\<\h\w*\>"62  syn match	freebasicGenericFunction	"\<\h\w*\>\ze\s*("63endif64"65"	This list of keywords is taken directly from the FreeBASIC66"	user's guide as presented by the FreeBASIC online site.67"68syn keyword	freebasicArrays			ERASE LBOUND PRESERVE REDIM UBOUND69 70" array.bi71syn keyword	freebasicArrays			ARRAYLEN ARRAYSIZE72if s:lang == "fb"73  syn keyword	freebasicArrays			ArrayConstDescriptorPtr ArrayDescriptorPtr FBARRAY74endif75 76if s:lang == "qb"77  syn keyword	freebasicAsm			__ASM78  syn match	freebasicAsm			"\<end\s\+__asm\>"79else80  syn keyword	freebasicAsm			ASM81  syn match	freebasicAsm			"\<end\s\+asm\>"82endif83 84if s:lang == "qb"85  syn keyword	freebasicBitManipulation	__BIT __BITRESET __BITSET __HIBYTE __HIWORD __LOBYTE __LOWORD86else87  syn keyword	freebasicBitManipulation	BIT BITRESET BITSET HIBYTE HIWORD LOBYTE LOWORD88endif89 90if s:lang != "fb"91  syn keyword	freebasicCompilerSwitches	DEFDBL DEFINT DEFLNG DEFSNG DEFSTR92endif93if s:lang == "qb"94  syn keyword	freebasicCompilerSwitches	__DEFBYTE __DEFLONGINT __DEFSHORT __DEFUBYTE __DEFUINT __DEFULONGINT __DEFUSHORT95elseif s:lang == "fblite" || s:lang == "deprecated"96  syn keyword	freebasicCompilerSwitches	DEFBYTE DEFLONGINT DEFSHORT DEFUBYTE DEFUINT DEFUILONGINT DEFUSHORT97endif98 99syn match	freebasicCompilerSwitches	"\<option\s\+\%(BASE\|BYVAL\|DYNAMIC\|ESCAPE\|EXPLICIT\|GOSUB\|NOGOSUB\)\>"100syn match	freebasicCompilerSwitches	"\<option\s\+\%(NOKEYWORD\|PRIVATE\|STATIC\)\>"101 102syn keyword	freebasicData			DATA READ RESTORE103 104syn keyword	freebasicProgramFlow		EXIT GOTO RETURN SLEEP105syn match	freebasicProgramFlow		"\<end\>"106if s:lang == "qb"107  syn keyword	freebasicProgramFlow		__SLEEP108endif109if s:lang == "fblite" || s:lang == "qb"110  syn keyword	freebasicProgramFlow		GOSUB111endif112if s:lang == "fb" || s:lang == "deprecated"113  syn keyword	freebasicProgramFlow		SCOPE114  syn match	freebasicProgramFlow		"\<end\s\+scope\>"115endif116 117if s:lang == "fblite" || s:lang == "qb"118  syn region	freebasicConditional		matchgroup=freebasicConditional start="\<on\>" end="\<gosub\>" transparent119  syn region	freebasicConditional		matchgroup=freebasicConditional start="\<on\>" end="\<goto\>"  transparent120endif121syn keyword	freebasicConditional		IF THEN ELSE ELSEIF122if s:lang == "qb"123  syn keyword	freebasicConditional		__IIF __WITH124  syn match	freebasicConditional		"\<end\s\+__with\>"125else126  syn keyword	freebasicConditional		IIF WITH127  syn match	freebasicConditional		"\<end\s\+with\>"128endif129syn match	freebasicConditional		"\<end\s\+if\>"130syn match	freebasicConditional		"\<select\s\+case\>"131syn match	freebasicConditional		"\<case\>"132syn match	freebasicConditional		"\<case\s\+is\>"133syn match	freebasicConditional		"\<end\s\+select\>"134 135syn keyword	freebasicConsole		BEEP CLS CSRLIN LOCATE PRINT POS SPC TAB USING VIEW WIDTH136syn match	freebasicConsole		"?"137 138syn keyword	freebasicDataTypes		SINGLE DOUBLE INTEGER LONG139syn match	freebasicDataTypes		"\<string\>"140syn keyword	freebasicDataTypes		AS DIM CONST ENUM SHARED TYPE141syn match	freebasicDataTypes		"\<end\s\+enum\>"142syn match	freebasicDataTypes		"\<end\s\+type\>"143if s:lang == "qb"144  syn keyword	freebasicDataTypes		__BOOLEAN __BYTE __LONGINT __SHORT __UBYTE __UINTEGER __ULONG __ULONGINT __UNSIGNED __USHORT __ZSTRING145  syn match	freebasicDataTypes		"\<__WSTRING\>"146  syn keyword	freebasicDataTypes		__EXPLICIT __EXTENDS __IMPLEMENTS __OBJECT __POINTER __PTR __SIZEOF __TYPEOF147  syn keyword	freebasicDataTypes		__UNION148  syn match	freebasicDataTypes		"\<end\s\+__union\>"149else150  syn keyword	freebasicDataTypes		BOOLEAN BYTE LONGINT SHORT UBYTE UINTEGER ULONG ULONGINT UNSIGNED USHORT ZSTRING151  syn match	freebasicDataTypes		"\<WSTRING\>"152  syn keyword	freebasicDataTypes		EXPLICIT EXTENDS IMPLEMENTS OBJECT POINTER PTR SIZEOF TYPEOF153  syn keyword	freebasicDataTypes		UNION154  syn match	freebasicDataTypes		"\<end\s\+union\>"155endif156if s:lang == "fb"157  syn keyword	freebasicDataTypes		BASE CLASS THIS VAR158endif159 160if s:lang == "qb"161  syn match	freebasicDateTime		"\<\%(date\|time\)\$"162elseif s:lang == "fblite" || s:lang == "deprecated"163  syn match	freebasicDateTime		"\<\%(date\|time\)\>\$\="164else " fb165  syn keyword	freebasicDateTime		DATE TIME166endif167syn keyword	freebasicDateTime		SETDATE SETTIME168 169" datetime.bi170syn keyword	freebasicDateTime		DATEADD DATEDIFF DATEPART DATESERIAL DATEVALUE DAY HOUR ISDATE MINUTE171syn keyword	freebasicDateTime		MONTH MONTHNAME NOW SECOND TIMESERIAL TIMEVALUE172syn keyword	freebasicDateTime		TIMER YEAR WEEKDAY WEEKDAYNAME173 174syn keyword	freebasicDebug			STOP175if s:lang == "qb"176  syn keyword	freebasicDebug			__ASSERT __ASSERTWARN177else178  syn keyword	freebasicDebug			ASSERT ASSERTWARN179endif180 181syn keyword	freebasicErrorHandling		ERR ERL ERROR182if s:lang == "qb"183  syn keyword	freebasicErrorHandling		__ERFN __ERMN184  syn match	freebasicErrorHandling		"\<on\s\+error\>"185else186  syn keyword	freebasicErrorHandling		ERFN ERMN187  syn match	freebasicErrorHandling		"\<on\s\+\%(local\s\+\)\=error\>"188endif189if s:lang != "fb"190  syn match	freebasicErrorHandling		"\<resume\%(\s\+next\)\=\>"191endif192 193syn match	freebasicFiles			"\<get\s\+#\>"194syn match	freebasicFiles			"\<input\s\+#\>"195syn match	freebasicFiles			"\<line\s\+input\s\+#\>"196syn match	freebasicFiles			"\<put\s\+#\>"197syn keyword	freebasicFiles			ACCESS APPEND BINARY CLOSE EOF FREEFILE INPUT LOC198syn keyword	freebasicFiles			LOCK LOF OUTPUT RANDOM RESET SEEK UNLOCK WRITE199syn match	freebasicFiles			"\<open\>"200if s:lang == "qb"201  syn keyword	freebasicFiles			__ENCODING202else203  syn keyword	freebasicFiles			ENCODING WINPUT204  syn match	freebasicFiles			"\<open\s\+\%(cons\|err\|pipe\|scrn\)\>"205endif206 207" file.bi208syn keyword	freebasicFiles			FILEATTR FILECOPY FILEDATETIME FILEEXISTS FILEFLUSH FILELEN FILESETEOF209 210syn keyword	freebasicFunctions		ALIAS BYREF BYVAL CDECL DECLARE LIB NAKED PASCAL STATIC STDCALL211syn match	freebasicFunctions		"\<option\ze\s*("212 213if s:lang == "qb"214  syn keyword	freebasicFunctions		__CVA_ARG __CVA_COPY __CVA_END __CVA_LIST __CVA_START215  syn keyword	freebasicFunctions		__VA_ARG __VA_FIRST __VA_NEXT216else217  syn keyword	freebasicFunctions		CVA_ARG CVA_COPY CVA_END CVA_LIST CVA_START218  syn keyword	freebasicFunctions		VA_ARG VA_FIRST VA_NEXT219  syn keyword	freebasicFunctions		ANY OVERLOAD220endif221 222syn keyword	freebasicFunctions		FUNCTION SUB223syn match	freebasicFunctions		"\<end\s\+function\>"224syn match	freebasicFunctions		"\<end\s\+sub\>"225 226if s:lang == "fb"227  syn keyword	freebasicFunctions		ABSTRACT OVERRIDE VIRTUAL __THISCALL228  syn keyword	freebasicFunctions		CONSTRUCTOR DESTRUCTOR OPERATOR PROPERTY229  syn match	freebasicFunctions		"\<end\s\+constructor\>"230  syn match	freebasicFunctions		"\<end\s\+destructor\>"231  syn match	freebasicFunctions		"\<end\s\+operator\>"232  syn match	freebasicFunctions		"\<end\s\+property\>"233else234  syn keyword	freebasicFunctions		CALL235endif236 237syn match	freebasicGraphics		"\<palette\s\+get\>"238syn keyword	freebasicGraphics		ADD ALPHA BLOAD BSAVE CIRCLE CLS COLOR DRAW GET239syn keyword	freebasicGraphics		LINE PAINT PALETTE PCOPY PMAP POINT240syn keyword	freebasicGraphics		PRESET PSET PUT SCREEN241syn keyword	freebasicGraphics		TRANS WINDOW242if s:lang == "qb"243  syn keyword	freebasicGraphics		__FLIP __IMAGECONVERTROW __IMAGECREATE __IMAGEDESTROY __IMAGEINFO __POINTCOORD244  syn keyword	freebasicGraphics		__RGB __RGBA __SCREENCOPY __SCREENCONTROL __SCREENEVENT __SCREENGLPROC __SCREENINFO245  syn keyword	freebasicGraphics		__SCREENLIST __SCREENLOCK __SCREENPTR __SCREENRES __SCREENSET __SCREENSYNC246  syn keyword	freebasicGraphics		__SCREENUNLOCK __WINDOWTITLE247else248  syn keyword	freebasicGraphics		CUSTOM249  syn keyword	freebasicGraphics		FLIP IMAGECONVERTROW IMAGECREATE IMAGEDESTROY IMAGEINFO POINTCOORD250  syn keyword	freebasicGraphics		RGB RGBA SCREENCOPY SCREENCONTROL SCREENEVENT SCREENGLPROC SCREENINFO251  syn keyword	freebasicGraphics		SCREENLIST SCREENLOCK SCREENPTR SCREENRES SCREENSET SCREENSYNC252  syn keyword	freebasicGraphics		SCREENUNLOCK WINDOWTITLE253endif254 255if s:lang != "qb"256  syn match	freebasicHardware		"\<open\s\+\%(com\|lpt\)\>"257endif258syn keyword	freebasicHardware		INP OUT WAIT LPOS LPRINT259 260syn keyword	freebasicMath			ABS ATN COS EXP FIX FRAC INT LOG MOD RANDOMIZE RND SGN SIN SQR TAN261 262if s:lang == "qb"263  syn keyword	freebasicMath			__ACOS __ASIN __ATAN2264else265  syn keyword	freebasicMath			ACOS ASIN ATAN2266endif267 268if s:lang == "qb"269  syn keyword	freebasicMemory			__ALLOCATE __CALLOCATE __DEALLOCATE __REALLOCATE270else271  syn keyword	freebasicMemory			ALLOCATE CALLOCATE DEALLOCATE REALLOCATE272  syn keyword	freebasicMemory			PEEK POKE CLEAR FB_MEMCOPY FB_MEMCOPYCLEAR FB_MEMMOVE SWAP SADD273  syn keyword	freebasicMemory			FIELD FRE274endif275 276syn keyword	freebasicMisc			LET TO277if s:lang == "qb"278  syn keyword freebasicMisc			__OFFSETOF279else280  syn keyword freebasicMisc			OFFSETOF281endif282 283syn keyword	freebasicModularizing		CHAIN COMMON284if s:lang == "fb"285  syn keyword	freebasicModularizing		EXTERN286  syn match	freebasicModularizing		"\<end\s\+extern\>"287  syn keyword	freebasicModularizing		PROTECTED288endif289if s:lang == "qb"290  syn keyword	freebasicModularizing		__EXPORT __IMPORT __DYLIBFREE __DYLIBLOAD __DYLIBSYMBOL291else292  syn keyword	freebasicModularizing		EXPORT IMPORT DYLIBFREE DYLIBLOAD DYLIBSYMBOL293  syn keyword	freebasicModularizing		PRIVATE PUBLIC294  syn keyword	freebasicModularizing		NAMESPACE295  syn match	freebasicModularizing		"\<end\s\+namespace\>"296endif297 298if s:lang != "qb"299  syn keyword	freebasicMultithreading		MUTEXCREATE MUTEXDESTROY MUTEXLOCK MUTEXUNLOCK THREADCREATE THREADWAIT300  syn keyword	freebasicMultithreading		CONDBROADCAST CONDCREATE CONDDESTROY CONDSIGNAL CONDWAIT301  syn keyword	freebasicMultithreading		THREADCALL THREADDETACH THREADSELF302endif303 304syn keyword	freebasicShell			CHDIR KILL NAME MKDIR RMDIR RUN SETENVIRON305if s:lang == "qb"306  syn keyword	freebasicShell			__CURDIR __DIR __EXEC __EXEPATH307  syn match	freebasicString			"\<\%(command\|environ\)\$"308else309  " fbio.bi310  syn keyword	freebasicShell			ISREDIRECTED311  syn keyword	freebasicShell			CURDIR DIR EXEC EXEPATH312  syn match	freebasicString			"\<\%(command\|environ\)\>\$\="313endif314 315syn keyword	freebasicEnviron		SHELL SYSTEM316 317syn keyword	freebasicLoops			FOR LOOP WHILE WEND DO STEP UNTIL NEXT318if s:lang == "qb"319  syn keyword	freebasicLoops			__CONTINUE320else321  syn keyword	freebasicLoops			CONTINUE322endif323"324"	File numbers325"326syn match	freebasicFilenumber		"#\d\+"327syn match	freebasicFilenumber		"#\a[[:alpha:].]*[%&!#]\="328 329syn match	freebasicMetacommand		"$\s*\%(dynamic\|static\)"330syn match	freebasicMetacommand		"$\s*include\s*\%(once\)\=\s*:\s*'[^']\+'"331syn match	freebasicMetacommand		'$\s*include\s*\%(once\)\=\s*:\s*"[^"]\+"'332syn match	freebasicMetacommand		'$\s*lang\s*:\s*"[^"]\+"'333"334"	Intrinsic defines335"336syn keyword	freebasicPredefined		__DATE__ __DATE_ISO__337syn keyword	freebasicPredefined		__FB_64BIT__ __FB_ARGC__ __FB_ARG_COUNT__ __FB_ARG_EXTRACT__ __FB_ARG_LEFTOF__338syn keyword	freebasicPredefined		__FB_ARG_RIGHTOF__ __FB_ARGV__ __FB_ARM__ __FB_ASM__ __FB_BACKEND__339syn keyword	freebasicPredefined		__FB_BIGENDIAN__ __FB_BUILD_DATE__ __FB_BUILD_DATE_ISO__ __FB_BUILD_SHA1__340syn keyword	freebasicPredefined		__FB_CYGWIN__ __FB_DARWIN__ __FB_DEBUG__ __FB_DOS__ __FB_ERR__ __FB_EVAL__341syn keyword	freebasicPredefined		__FB_FPMODE__ __FB_FPU__ __FB_FREEBSD__ __FB_GCC__ __FB_GUI__ __FB_IIF__ __FB_JOIN__342syn keyword	freebasicPredefined		__FB_LANG__ __FB_LINUX__ __FB_MAIN__ __FB_MIN_VERSION__ __FB_MT__ __FB_NETBSD__343syn keyword	freebasicPredefined		__FB_OPENBSD__ __FB_OPTIMIZE__ __FB_OPTION_BYVAL__ __FB_OPTION_DYNAMIC__344syn keyword	freebasicPredefined		__FB_OPTION_ESCAPE__ __FB_OPTION_EXPLICIT__ __FB_OPTION_GOSUB__345syn keyword	freebasicPredefined		__FB_OPTION_PRIVATE__ __FB_OUT_DLL__ __FB_OUT_EXE__ __FB_OUT_LIB__ __FB_OUT_OBJ__346syn keyword	freebasicPredefined		__FB_PCOS__ __FB_PPC__ __FB_QUERY_SYMBOL__ __FB_QUOTE__ __FB_SIGNATURE__ __FB_SSE__347syn keyword	freebasicPredefined		__FB_UNIQUEID__ __FB_UNIQUEID_POP__ __FB_UNIQUEID_PUSH__ __FB_UNIX__ __FB_UNQUOTE__348syn keyword	freebasicPredefined		__FB_VECTORIZE__ __FB_VER_MAJOR__ __FB_VER_MINOR__ __FB_VER_PATCH__ __FB_VERSION__349syn keyword	freebasicPredefined		__FB_WIN32__ __FB_X86__ __FB_XBOX__350syn keyword	freebasicPredefined		__FILE__ __FILE_NQ__ __FUNCTION__ __FUNCTION_NQ__351syn keyword	freebasicPredefined		__LINE__ __PATH__ __TIME__352"353"	Preprocessor directives354"355syn match	freebasicInclude		"#\s*\%(inclib\|include\%(\s\+once\)\=\|libpath\)\>"356 357syn match	freebasicPreProcessor		"#\s*assert\>"358syn match	freebasicPreProcessor		"#\s*cmdline\>"359syn match	freebasicPreProcessor		"#\s*\%(define\|undef\)\>"360syn match	freebasicPreProcessor		"#\s*\%(if\|ifdef\|ifndef\|else\|elseif\|endif\)\>"361syn match	freebasicPreProcessor		"#\s*\%(macro\|endmacro\)\>"362syn match	freebasicPreProcessor		"#\s*error\>"363syn match	freebasicPreProcessor		"#\s*lang\>"364syn match	freebasicPreProcessor		"#\s*line\>"365syn match	freebasicPreProcessor		"#\s*pragma\%(\s\+reserve\)\=\>"366syn match	freebasicPreProcessor		"#\s*\%(print\|dynamic\|static\)\>"367syn keyword	freebasicPreProcessor		DEFINED368 369syn keyword	freebasicString			LEN370syn keyword	freebasicString			ASC371" string.bi372syn keyword	freebasicString			FORMAT373syn keyword	freebasicString			VAL374syn keyword	freebasicString			CVD CVI CVL CVS375syn keyword	freebasicString			INSTR376syn keyword	freebasicString			LSET RSET377 378if s:lang == "qb"379  syn match	freebasicString			"\<string\$\ze\s*("380  syn match	freebasicString			"\<__wstring\ze\s*("381  syn match	freebasicString			"\<space\$"382  syn keyword	freebasicString			__WSPACE383  syn match	freebasicString			"\<chr\$"384  syn keyword	freebasicString			__WCHR385  syn keyword	freebasicString			__WBIN __WHEX __WOCT __WSTR386  syn match	freebasicString			"\<\%(bin\|hex\|oct\|str\)\$"387  syn keyword	freebasicString			__VALLNG __VALINT __VALUINT __VALULNG388  syn match	freebasicString			"\<\%(mkd\|mki\|mkl\|mks\)\$"389  syn keyword	freebasicString			__MKLONGINT __MKSHORT390  syn keyword	freebasicString			__CVLONGINT __CVSHORT391  syn match	freebasicString			"\<\%(left\|mid\|right\|lcase\|ucase\|ltrim\|rtrim\)\$"392  syn keyword	freebasicString			__TRIM393  syn keyword	freebasicString			__INSTRREV394else395  syn match	freebasicString			"\<string\$\=\ze\s*("396  syn match	freebasicString			"\<wstring\ze\s*("397  syn match	freebasicString			"\<space\>\$\="398  syn keyword	freebasicString			WSPACE399  syn match	freebasicString			"\<chr\>\$\="400  syn keyword	freebasicString			WCHR401  syn keyword	freebasicString			WBIN WHEX WOCT WSTR402  syn match	freebasicString			"\<\%(bin\|hex\|oct\|str\)\>\$\="403  syn keyword	freebasicString			VALLNG VALINT VALUINT VALULNG404  syn match	freebasicString			"\<\%(mkd\|mki\|mkl\|mks\)\>\$\="405  syn match	freebasicString			"\<\%(mklongint\|mkshort\)\>\$\="406  syn keyword	freebasicString			CVLONGINT CVSHORT407  syn match	freebasicString			"\<\%(left\|mid\|right\|lcase\|ucase\|ltrim\|rtrim\)\>\$\="408  syn match	freebasicString			"\<trim\>\$\="409  syn keyword	freebasicString			INSTRREV410endif411 412syn keyword	freebasicTypeCasting		CDBL CINT CLNG CSNG413if s:lang == "qb"414  syn keyword	freebasicTypeCasting		__CAST __CBOOL __CBYTE __CLNGINT __CPTR __CSHORT __CSIGN __CYBTE __CUINT __CULNG415  syn keyword	freebasicTypeCasting		__CULNGINT __CUNSG __CUSHORT416else417  syn keyword	freebasicTypeCasting		CAST CBOOL CBYTE CLNGINT CPTR CSHORT CSIGN CUBYTE CUINT CULNG CULNGINT CUNSG CUSHORT418endif419 420syn match	freebasicUserInput		"\<line\s\+input\>"421syn keyword	freebasicUserInput		INKEY INPUT422if s:lang == "qb"423  syn keyword	freebasicUserInput		__GETJOYSTICK __GETKEY __GETMOUSE __MULTIKEY __SETMOUSE STICK STRIG424else425  syn keyword	freebasicUserInput		GETJOYSTICK GETKEY GETMOUSE MULTIKEY SETMOUSE426endif427"428"	Operators429"430" TODO: make these context sensitive to remove the overlap of common operators431"     : alpha operators should probably always be highlighted432"     -- DJK 20/11/19433if s:lang == "qb"434  syn match	freebasicArithmeticOperator	"\<\%(MOD\|__SHL\|__SHR\)\>"435else436  syn match	freebasicArithmeticOperator	"\<\%(MOD\|SHL\|SHR\)\>"437endif438syn match	freebasicBitwiseOperator	"\<\%(AND\|EQV\|IMP\|NOT\|OR\|XOR\)\>" " freebaseLogical?439if s:lang == "qb"440  syn match	freebasicAssignmentOperator	"\<\%(MOD\|AND\|EQV\|IMP\|OR\|XOR\|__SHL\|__SHR\)=\@=" " exclude trailing '='441else442  syn match	freebasicAssignmentOperator	"\<\%(MOD\|AND\|EQV\|IMP\|OR\|XOR\|SHL\|SHR\)=\@="443endif444syn match	freebasicShortcircuitOperator	"\<\%(ANDALSO\|ORELSE\)\>"445if s:lang == "fb"446  syn match	freebasicMemoryOperator		'\<\%(new\|delete\)\>'447endif448syn keyword	freebasicPointerOperator	STRPTR VARPTR449if s:lang == "qb"450  syn keyword	freebasicPointerOperator	__PROCPTR451else452  syn keyword	freebasicPointerOperator	PROCPTR453endif454syn match	freebasicTypeOperator		'\<is\>'455syn match	freebasicTypeOperator		'\.' nextgroup=freebasicIdentifier skipwhite456if s:lang == "fb"457  syn match	freebasicTypeOperator		'->' nextgroup=freebasicIdentifier skipwhite458endif459 460if exists("freebasic_operators")461  syn match	freebasicAssignmentOperator	"=>\=\|[-+&/\\*^]="462  if s:lang == "qb"463    syn match	freebasicAssignmentOperator	"\<\%(MOD\|AND\|EQV\|IMP\|OR\|XOR\|__SHL\|__SHR\)=" " include trailing '='464  else465    syn match	freebasicAssignmentOperator	"\<\%(MOD\|AND\|EQV\|IMP\|OR\|XOR\|SHL\|SHR\)="466  endif467  syn match	freebasicArithmeticOperator	"[-+&/\\*^]"468  " syn match	freebasicIndexingOperator	"[[\]()]" " FIXME469  syn match	freebasicRelationalOperator	"=\|<>\|<=\|<\|>=\|>"470  syn match	freebasicPreprocessorOperator	'\%(^\s*\)\@<!\%(##\|#\)\|[$!]"\@='471  syn match	freebasicPointerOperator	'[@*]'472  syn match	freebasicTypeOperator		'\.' nextgroup=freebasicIdentifier skipwhite473  if s:lang == "fb"474    syn match	freebasicTypeOperator		'->' nextgroup=freebasicIdentifier skipwhite475  endif476endif477 478syn cluster	freebasicOperator		contains=freebasic.*Operator479"480"	Catch errors caused by wrong parenthesis481"482" syn region	freebasicParen		transparent start='(' end=')' contains=ALLBUT,@freebasicParenGroup483" syn match	freebasicParenError	")"484" syn match	freebasicInParen	contained "[{}]"485" syn cluster	freebasicParenGroup	contains=freebasicParenError,freebasicSpecial,freebasicTodo,freebasicUserCont,freebasicUserLabel,freebasicBitField486"487"	Integer number488"489syn match	freebasicHexError	"&h\w*\>"490syn match	freebasicOctalError	"&o\w*\>"491syn match	freebasicBinaryError	"&b\w*\>"492syn match	freebasicHex		"&h\x\+\%([%L&U]\|UL\|LL\|ULL\)\=\>"493syn match	freebasicOctal		"&o\o\+\%([%L&U]\|UL\|LL\|ULL\)\=\>"494syn match	freebasicBinary		"&b[10]\+\%([%L&U]\|UL\|LL\|ULL\)\=\>"495syn match	freebasicInteger	"\<\d\+\%([%L&U]\|UL\|LL\|ULL\)\=\>"496"497"	Floating point498"	See: https://www.freebasic.net/forum/viewtopic.php?t=20323499"500"	Floating point number, with dot, optional exponent, optional suffix501"502syn match	freebasicFloat		"\<\d\+\.\d*\%([de][-+]\=\d*\)\=[f!#]\="503"504"	Floating point number, starting with a dot, optional exponent, optional suffix505"506syn match	freebasicFloat		"\.\d\+\%([de][-+]\=\d*\)\=[f!#]\="507"508"	Floating point number, without dot, with optional exponent, optional suffix509"510syn match	freebasicFloat		"\<\d\+\%([de][-+]\=\d*\)[f!#]\="511"512"	Floating point number, without dot, without exponent, with suffix513"514syn match	freebasicFloat		"\<\d\+[f!#]"515"516"	Create the clusters517"518syn cluster	freebasicNumber		contains=freebasicHex,freebasicOctal,freebasicBinary,freebasicInteger,freebasicFloat519syn cluster	freebasicNumberError	contains=freebasicHexError,freebasicOctalError,freebasicBinaryError520"521"	Booleans522"523if s:lang != "qb"524  syn keyword	freebasicBoolean	TRUE FALSE525endif526"527"528"	String and escape sequences529"530syn match	freebasicSpecial	contained "\\."531syn match	freebasicSpecial	contained "\\\d\{1,3}"532syn match	freebasicSpecial	contained "\\&h\x\{1,2}"533syn match	freebasicSpecial	contained "\\&o\o\{1,3}"534syn match	freebasicSpecial	contained "\\&b[01]\{1,8}"535syn match	freebasicSpecial	contained "\\u\x\{1,4}"536syn region	freebasicString		start='"'     end='"' " TODO: Toggle contains on Option Escape in fblite and qb? -- DJK 20/11/19537syn region	freebasicString		start='!\zs"' end='"' contains=freebasicSpecial538syn region	freebasicString		start='$\zs"' end='"'539"540"	Line labels541"542if s:lang =~# '\<\%(qb\|fblite\)\>'543  syn match	freebasicLineLabel	"^\s*\zs\h\%(\w\|\.\)*\ze\s*:"544else545  syn match	freebasicLineLabel	"^\s*\zs\h\w*\ze\s*:"546endif547syn match	freebasicLineNumber	"^\s*\zs\d\+"548"549"	Line continuations550"551" syn match	freebasicLineContinuation	"\<_\>"	nextgroup=freebasicComment,freebasicPostLineContinuation skipwhite552syn keyword	freebasicLineContinuation	_	nextgroup=freebasicComment,freebasicPostLineContinuation skipwhite553syn match	freebasicPostLineContinuation	".*"	contained554"555"556" Type suffixes557if exists("freebasic_type_suffixes") && s:lang =~# '\<\%(qb\|fblite\)\>'558  syn match freebasicTypeSuffix "\h\%(\w\|.\)*\zs[$%&!#]"559endif560"561"	Comments562"563syn keyword	freebasicTodo			TODO FIXME XXX NOTE      contained564syn region	freebasicComment		start="\<rem\>" end="$"  contains=freebasicTodo,@Spell,freebasicMetacommand565syn region	freebasicComment		start="'"	end="$"  contains=freebasicTodo,@Spell,freebasicMetacommand566syn region	freebasicDoubleComment		start="''"	end="$"  contains=freebasicTodo,@Spell567 568if !exists("freebasic_no_comment_fold")569  syn region	freebasicMultilineComment	start="/'"	end="'/" contains=freebasicTodo,@Spell,freeBasicMultilineComment fold keepend extend570  syn region	freebasicMultilineComment2	start="^\s*'.*\n\%(\s*'\)\@=" end="^\s*'.*\n\%(\s*'\)\@!" contains=freebasicComment,freebasicDoubleComment keepend fold571else572  syn region	freebasicMultilineComment	start="/'"	end="'/" contains=freebasicTodo,@Spell,freeBasicMultilineComment573endif574 575syn case match576 577syn sync linebreaks=1578 579"580"	The default methods for highlighting.  Can be overridden later581"582hi def link freebasicArrays		StorageClass583hi def link freebasicAsm		Special584hi def link freebasicBitManipulation	Operator585hi def link freebasicBoolean		Boolean586if s:lang == "fb"587  hi def link freebasicCompilerSwitches	freebasicUnsupportedError588else589  hi def link freebasicCompilerSwitches	PreCondit590endif591hi def link freebasicConsole		Special592hi def link freebasicData		Special593hi def link freebasicDataTypes		Type594hi def link freebasicDateTime		Type595hi def link freebasicDebug		Special596hi def link freebasicErrorHandling	Special597hi def link freebasicFilenumber		Special598hi def link freebasicFiles		Special599hi def link freebasicFunctions		Function600hi def link freebasicGraphics		Function601hi def link freebasicHardware		Special602hi def link freebasicLoops		Repeat603hi def link freebasicMath		Function604if s:lang == "fb"605  hi def link freebasicMetacommand	freebasicUnsupportedError606else607  hi def link freebasicMetacommand	SpecialComment608endif609hi def link freebasicMemory		Function610hi def link freebasicMisc		Special611hi def link freebasicModularizing	Special612hi def link freebasicMultithreading	Special613hi def link freebasicShell		Special614hi def link freebasicEnviron		Special615hi def link freebasicPointer		Special616hi def link freebasicPredefined		PreProc617hi def link freebasicPreProcessor	PreProc618hi def link freebasicProgramFlow	Statement619hi def link freebasicString		String620hi def link freebasicTypeCasting	Type621hi def link freebasicUserInput		Statement622hi def link freebasicComment		Comment623hi def link freebasicDoubleComment	Comment624hi def link freebasicMultilineComment	Comment625hi def link freebasicConditional	Conditional626hi def link freebasicError		Error627hi def link freebasicIdentifier		Identifier628hi def link freebasicInclude		Include629hi def link freebasicGenericFunction	Function630hi def link freebasicLineContinuation	Special631hi def link freebasicLineLabel		LineNr632if s:lang == "fb"633  hi def link freebasicLineNumber	freebasicUnsupportedError634else635  hi def link freebasicLineNumber	LineNr636endif637hi def link freebasicMathOperator	Operator638 639hi def link freebasicHex		Number640hi def link freebasicOctal		Number641hi def link freebasicBinary		Number642hi def link freebasicInteger		Number643hi def link freebasicFloat		Float644 645hi def link freebasicHexError		Error646hi def link freebasicOctalError		Error647hi def link freebasicBinaryError	Error648 649hi def link freebasicAssignmentOperator		Operator650hi def link freebasicArithmeticOperator		Operator651hi def link freebasicIndexingOperator		Operator652hi def link freebasicRelationalOperator		Operator653hi def link freebasicBitwiseOperator		Operator654hi def link freebasicShortcircuitOperator	Operator655hi def link freebasicPreprocessorOperator	Operator656hi def link freebasicPointerOperator		Operator657if exists("freebasic_operators")658  hi def link freebasicTypeOperator		Operator659endif660hi def link freebasicMemoryOperator		Operator661 662hi def link freebasicSpaceError			Error663 664hi def link freebasicSpecial		Special665hi def link freebasicTodo		Todo666 667hi def link freebasicUnsupported	freebasicUnsupportedError668hi def link freebasicUnsupportedError	Error669 670unlet s:lang671 672let b:current_syntax = "freebasic"673 674" vim: ts=8 tw=132 fdm=marker675 
codekingpro/portable-devtools · Team Ai