syn keyword ibasicBuiltInFunction str$ string$ time$ ucase$ varptr$
syn keyword ibasicTodo contained TODO
syn cluster ibasicFunctionCluster contains=ibasicBuiltInFunction,ibasicGenericFunction
syn keyword Conditional if else then elseif endif select case endselect
syn keyword Repeat for do while next enddo endwhile wend
syn keyword ibasicTypeSpecifier single double defdbl defsng
syn keyword ibasicTypeSpecifier int integer uint uinteger int64 uint64 defint deflng
syn keyword ibasicTypeSpecifier byte char string istring defstr
syn keyword ibasicDefine dim def declare
"
"catch errors caused by wrong parenthesis
"
syn cluster ibasicParenGroup contains=ibasicParenError,ibasicIncluded,ibasicSpecial,ibasicTodo,ibasicUserCont,ibasicUserLabel,ibasicBitField
syn region ibasicParen transparent start='(' end=')' contains=ALLBUT,@bParenGroup
syn match ibasicParenError ")"
syn match ibasicInParen contained "[{}]"
"
"integer number, or floating point number without a dot and with "f".
"
syn region ibasicHex start="&h" end="\W"
syn region ibasicHexError start="&h\x*[g-zG-Z]" end="\W"
syn match ibasicInteger "\<\d\+\(u\=l\=\|lu\|f\)\>"
"
"floating point number, with dot, optional exponent
"
syn match ibasicFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
"
"floating point number, starting with a dot, optional exponent
"
syn match ibasicFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"
"floating point number, without dot, with exponent
"
syn match ibasicFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
"
"hex number
"
syn match ibasicIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
syn match ibasicFunction "\<[a-zA-Z_][a-zA-Z0-9_]*\>\s*("me=e-1,he=e-1
syn case match
syn match ibasicOctalError "\<0\o*[89]"
"
" String and Character contstants
"
syn region ibasicString start='"' end='"' contains=ibasicSpecial,ibasicTodo
syn region ibasicString start="'" end="'" contains=ibasicSpecial,ibasicTodo
"
" Comments
"
syn match ibasicSpecial contained "\\."
syn region ibasicComment start="^rem" end="$" contains=ibasicSpecial,ibasicTodo
syn region ibasicComment start=":\s*rem" end="$" contains=ibasicSpecial,ibasicTodo
syn region ibasicComment start="\s*'" end="$" contains=ibasicSpecial,ibasicTodo
syn region ibasicComment start="^'" end="$" contains=ibasicSpecial,ibasicTodo
"
" Now do the comments and labels
"
syn match ibasicLabel "^\d"
syn region ibasicLineNumber start="^\d" end="\s"
"
" Pre-compiler options : FreeBasic
"
syn region ibasicPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=ibasicString,ibasicCharacter,ibasicNumber,ibasicCommentError,ibasicSpaceError
syn match ibasicInclude "^\s*#\s*include\s*"
"
" Create the clusters
"
syn cluster ibasicNumber contains=ibasicHex,ibasicInteger,ibasicFloat
syn cluster ibasicError contains=ibasicHexError
"
" Used with OPEN statement
"
syn match ibasicFilenumber "#\d\+"
"
"syn sync ccomment ibasicComment
"
syn match ibasicMathOperator "[\+\-\=\|\*\/\>\<\%\()[\]]" contains=ibasicParen
"
" The default methods for highlighting. Can be overridden later