neovim/runtime/syntax/hollywood.vim

187 lines
49 KiB
VimL
Raw Normal View History

" Vim syntax file
" Language: Hollywood 10.0
" Maintainer: Ola S<>der <rolfkopman@gmail.com>
" First Author: Tom Crecelius <holly@net-eclipse.net>
" Last Change: 2024 Jun 20
" Highlighting Issues:
" Depending on your colour schema, Strings or Comments might be highlighted in
" a way, you don't like. If so, try one of the following settings after
" opening a hollywood script:
"
" :hi link hwString MoreMsg
" :hi link hwString NonText
" :hi link hwString String
"
" and for comments:
"
" :hi link hwComment MoreMsg
" :hi link hwComment NonText
" :hi link hwComment Comment
"
" Remember the setting you like and change the corresponding definition at
" the bottom of this file.
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
if !exists("hw_version")
let hw_version = 10
let hw_subversion = 0
elseif !exists("hw_subversion")
let hw_subversion = 0
endif
syn case match
" syncing method
syn sync minlines=100
" catch errors caused by wrong parenthesis and wrong curly brackets or
" keywords placed outside their respective blocks
syn region hwParen transparent start='(' end=')' contains=ALLBUT,hwParenError,hwTodo,hwSpecial,hwIfEndIf,hwElseIf,hwElse,hwBlock,hwLoopBlock,hwIn,hwStatement,hwStep,hwFallThrough,hwLineStatement
syn region hwTableBlock transparent matchgroup=hwTable start="{" end="}" contains=ALLBUT,hwBraceError,hwTodo,hwSpecial,hwIfEndIf,hwElseIf,hwElse,hwBlock,hwLoopBlock,hwIn,hwStatement,hwStep,hwFallThrough,hwLineStatement
syn match hwParenError ")"
syn match hwBraceError "}"
syn match hwError "\<\%(If\|End\|Else\|ElseIf\|Then\|Until\|In\|EndIf\|EndSwitch\|FallThrough\|Case\|Default\|Wend\|Until\|Forever\)\>"
" Function ... End
syn region hwFunctionBlock transparent matchgroup=hwFunction start="\<Function\>" end="\<EndFunction\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwIn,hwStep,hwFallThrough,hwLineStatement
" If .. Then
syn region hwIfThen transparent matchgroup=hwCond start="\<If\>" end="\<Then\>\{-}"me=e-4 oneline skipwhite skipempty
" Then ... Else
syn region hwThenElse transparent matchgroup=hwCond start="\<Then\>" end="$" end="\<Else\>" contains=hwFunction,hwUserFunction,hwElseIf,hwStatement,hwConstant containedin=hwIfThen oneline skipwhite skipempty
" If .. EndIf
syn region hwIfEndIf transparent matchgroup=hwCond start="\<If\>\(\(.\{-}Then.\{-}\)\@!\)" end="\<EndIf\>" contains=ALLBUT,hwTodo,hwSpecial,hwIn,hwStep,hwLineStatement skipwhite skipempty
" Else ... EndIf
syn region hwElseEndIf contained transparent matchgroup=hwCond start="\<Else\>" end="\<EndIf\>"me=e-5 contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElseEndIf,hwIn,hwStep,hwFallThrough,hwLineStatement
" Then
"syn keyword hwLineStatement Then contained
" Forever
syn keyword hwLineStatement Forever contained
" Do
syn keyword hwLineStatement Do contained
" ElseIf
syn keyword hwElseIf ElseIf contained
" Switch ... EndSwitch
syn region hwSwitchEnd transparent matchgroup=hwCond start="\<Switch\>" end="\<EndSwitch\>" contains=hwCase,hwDefCase skipwhite skipempty
" Case ... :
syn region hwCase transparent matchgroup=hwCond start="\<Case\>" end="\<EndSwitch\>"me=e-9 end="\<Default\>:"me=e-8 end="\<Case\>"me=e-4 contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElseEndIf,hwLineStatement,hwIn,hwStep skipwhite skipempty
" Default:
syn region hwDefCase transparent matchgroup=hwCond start="\<Default\>" end="\<EndSwitch\>"me=e-9 contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElseEndIf,hwIn,hwStep,hwCase,hwDefCase,hwFallThrough,hwLineStatement skipwhite skipempty
syn keyword hwFallThrough contained FallThrough
" Block ... EndBlock
syn region hwBlock transparent matchgroup=hwStatement start="\<Block\>" end="\<EndBlock\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwIn,hwStep,hwLineStatement
" Repeat ... Until/Forever
syn region hwLoopBlock transparent matchgroup=hwRepeat start="\<Repeat\>" end="\<Forever\>" end="\<Until\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwIn,hwStep,hwLineStatement
" While ... Wend/Do
syn region hwLoopBlock transparent matchgroup=hwRepeat start="\<While\>" end="\<Do\>" end="\<Wend\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwIn,hwStep,hwLineStatement skipwhite skipempty
" For .. To
syn region hwForTo transparent matchgroup=hwRepeat start="\<For\>" end="\<To\>"me=e-2 skipwhite skipempty nextgroup=hwToNext
" To .. Next
syn region hwToNext transparent matchgroup=hwRepeat start="\<To\>" end="\<Next\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwIn,hwLineStatement skipwhite skipempty
" For .. In
syn region hwForIn transparent matchgroup=hwRepeat start="\<For\>\(\(.\{-}To.\{-}\)\@!\)" end="\<In\>"me=e-2, skipwhite skipempty nextgroup=hwInNext
" In .. Next
syn region hwInNext transparent matchgroup=hwRepeat start="\<In\>" end="\<Next\>" contains=ALLBUT,hwTodo,hwSpecial,hwElseIf,hwElse,hwLineStatement skipwhite skipempty
syn keyword hwStep contained Step
syn keyword hwIn contained In
" other keywords
syn keyword hwStatement Return Break Continue
syn keyword hwStatement Goto Gosub Dim DimStr Const Local Global
syn match hwLabel "::\I\i*::"
syn match hwOperator "\%(&\|\*\|+\|-\|\.\||\|//\|/\|:\|<\|=\|>\|<>\|<=\|=>\|\^\|\~\|\\\|\<And\>\|\<Not\>\|\<Or\>\|\<Xor\>\)"
syn keyword hwConstant Nil
syn keyword hwConstant True False
" predefined preprocessing commands
syn match hwPreProcessor "@\<\%(ANIM\|APPAUTHOR\|APPCOPYRIGHT\|APPDESCRIPTION\|APPICON\|APPIDENTIFIER\|APPTITLE\|APPVERSION\|BACKFILL\|BGPIC\|BRUSH\|CATALOG\|DIRECTORY\|DISPLAY\|ELSE\|ELSEIF\|ENDIF\|ERROR\|FILE\|FONT\|ICON\|IF\|INCLUDE\|LINKER\|MENU\|MUSIC\|OPTIONS\|PALETTE\|REQUIRE\|SAMPLE\|SCREEN\|SPRITE\|VERSION\|VIDEO\|WARNING\)\>"ms=s+1
" predefined constants
syn match hwConstant "#\<\%(ACTIVEWINDOW\|ADF_ANIM\|ADF_FX\|ADF_MOVEOBJECT\|ALL\|ALPHABETICAL\|ALPHACHANNEL\|ALPHANUMERICAL\|AMIGAICON_DEVICE\|AMIGAICON_DISK\|AMIGAICON_DRAWER\|AMIGAICON_GARBAGE\|AMIGAICON_HIDE\|AMIGAICON_KICKSTART\|AMIGAICON_NONE\|AMIGAICON_PROJECT\|AMIGAICON_SETPOSITION\|AMIGAICON_SETTITLE\|AMIGAICON_SHOW\|AMIGAICON_TOOL\|ANIM\|ANIMSTREAM\|ANIMTYPE_RASTER\|ANIMTYPE_VECTOR\|ANMFMT_GIF\|ANMFMT_IFF\|ANMFMT_MJPEG\|ANTIALIAS\|AQUA\|ARC\|ASYNCDRAW\|ASYNCOBJ\|ATTRACTIVE\|ATTRADAPTER\|ATTRALPHAINTENSITY\|ATTRBGPIC\|ATTRBITRATE\|ATTRBORDERBOTTOM\|ATTRBORDERLEFT\|ATTRBORDERLESS\|ATTRBORDERPEN\|ATTRBORDERRIGHT\|ATTRBORDERTOP\|ATTRBULLETPEN\|ATTRCANSEEK\|ATTRCLIPREGION\|ATTRCOUNT\|ATTRCURFRAME\|ATTRCURSORX\|ATTRCURSORY\|ATTRCURSUBSONG\|ATTRCYCLE\|ATTRDENSITY\|ATTRDEPTH\|ATTRDISPLAY\|ATTRDITHERMODE\|ATTRDOUBLEBUFFER\|ATTRDRIVER\|ATTRDURATION\|ATTRELAPSE\|ATTRENCODING\|ATTRFIXED\|ATTRFONTAA\|ATTRFONTASCENDER\|ATTRFONTCHARMAP\|ATTRFONTDEPTH\|ATTRFONTDESCENDER\|ATTRFONTENGINE\|ATTRFONTNAME\|ATTRFONTPALETTE\|ATTRFONTSCALABLE\|ATTRFONTSIZE\|ATTRFONTTRANSPARENTPEN\|ATTRFONTTYPE\|ATTRFORMAT\|ATTRFRAMEDELAY\|ATTRFUNCTION\|ATTRGROUP\|ATTRHARDWARE\|ATTRHASALPHA\|ATTRHASMASK\|ATTRHEIGHT\|ATTRHOSTDEPTH\|ATTRHOSTHEIGHT\|ATTRHOSTMONITORS\|ATTRHOSTSCALE\|ATTRHOSTSCALEX\|ATTRHOSTSCALEY\|ATTRHOSTTASKBAR\|ATTRHOSTTITLEBARHEIGHT\|ATTRHOSTWIDTH\|ATTRID\|ATTRIMMERSIVEMODE\|ATTRINTERPOLATE\|ATTRKEYBOARD\|ATTRLAYERID\|ATTRLAYERS\|ATTRLAYERSON\|ATTRLOADER\|ATTRMARGINLEFT\|ATTRMARGINRIGHT\|ATTRMASKMODE\|ATTRMAXHEIGHT\|ATTRMAXIMIZED\|ATTRMAXWIDTH\|ATTRMENU\|ATTRMODE\|ATTRMONITOR\|ATTRNOCLOSE\|ATTRNOHIDE\|ATTRNOMODESWITCH\|ATTRNUMENTRIES\|ATTRNUMFRAMES\|ATTRNUMSUBSONGS\|ATTRONSCREEN\|ATTRORIENTATION\|ATTROUTPUTDEVICE\|ATTRPALETTE\|ATTRPALETTEMODE\|ATTRPAUSED\|ATTRPEN\|ATTRPITCH\|ATTRPLAYING\|ATTRPOINTER\|ATTRPOSITION\|ATTRPUBSCREEN\|ATTRRAWHEIGHT\|ATTRRAWWIDTH\|ATTRRAWXPOS\|ATTRRAWYPOS\|ATTRSCALEHEIGHT\|ATTRSCALEMODE\|ATTRSCALESWITCH\|ATTRSCALEWIDTH\|ATTRSHADOWPEN\|ATTRSIZE\|ATTRSIZEABLE\|ATTRSPRITES\|ATTRSTANDARD\|ATTRSTATE\|ATTRSYSTEMBARS\|ATTRTEXT\|ATTRTITLE\|ATTRTRANSPARENTCOLOR\|ATTRTRANSPARENTPEN\|ATTRTYPE\|ATTRUSERDATA\|ATTRVISIBLE\|ATTRWIDTH\|ATTRXDPI\|ATTRXPOS\|ATTRXSERVER\|ATTRYDPI\|ATTRYPOS\|ATTRZPOS\|BARS\|BAUD_115200\|BAUD_1200\|BAUD_19200\|BAUD_2400\|BAUD_300\|BAUD_38400\|BAUD_460800\|BAUD_4800\|BAUD_57600\|BAUD_600\|BAUD_9600\|BEEPERROR\|BEEPINFORMATION\|BEEPQUESTION\|BEEPSYSTEM\|BEEPWARNING\|BGPIC\|BGPICPART\|BIGENDIAN\|BIGSINE\|BITMAP_DEFAULT\|BLACK\|BLEND\|BLUE\|BOLD\|BOOLEAN\|BORDER\|BOTTOM\|BOTTOMOUT\|BOUNCE\|BOX\|BRUSH\|BRUSH_VS_BOX\|BRUSHPART\|BULLET_ARROW\|BULLET_BOX\|BULLET_CHECKMARK\|BULLET_CIRCLE\|BULLET_CROSS\|BULLET_DASH\|BULLET_DIAMOND\|BULLET_LALPHA\|BULLET_LALPHADOUBLE\|BULLET_LALPHASINGLE\|BULLET_LROMAN\|BULLET_LROMANDOUBLE\|BULLET_LROMANSINGLE\|BULLET_NONE\|BULLET_NUMERIC\|BULLET_NUMERICDOUBLE\|BULLET_NUMERICSINGLE\|BULLET_UALPHA\|BULLET_UALPHADOUBLE\|BULLET_UALPHASINGLE\|BULLET_UROMAN\|BULLET_UROMANDOUBLE\|BULLET_UROMANSINGLE\|BYTE\|CAPBUTT\|CAPROUND\|CAPSQUARE\|CARDBOTTOM\|CARDTOP\|CENTER\|CHARMAP_ADOBECUSTOM\|CHARMAP_ADOBEEXPERT\|CHARMAP_ADOBELATIN1\|CHARMAP_ADOBESTANDARD\|CHARMAP_APPLEROMAN\|CHARMAP_BIG5\|CHARMAP_DEFAULT\|CHARMAP_JOHAB\|CHARMAP_MSSYMBOL\|CHARMAP_OLDLATIN2\|CHARMAP_SJIS\|CHARMAP_UNICODE\|CHARMAP_WANSUNG\|CHIPMEMORY\|CIRCLE\|CLIENT\|CLIPBOARD_EMPTY\|CLIPBOARD_IMAGE\|CLIPBOARD_SOUND\|CLIPBOARD_TEXT\|CLIPBOARD_UNKNOWN\|CLIPREGION\|CLOCKWIPE\|CLOSEWINDOW\|CONICAL\|COPYFILE_FAILED\|COPYFILE_OVERWRITE\|COPYFILE_STATUS\|COPYFILE_UNPROTECT\|COUNTBOTH\|COUNTDIRECTORIES\|COUNTFILES\|COUNTRY_AFGHANISTAN\|COUNTRY_ALANDISLANDS\|COUNTRY_ALBANIA\|COUNTRY_ALGERIA\|COUNTRY_AMERICANSAMOA\|COUNTRY_ANDORRA\|COUNTRY_ANGOLA\|COUNTRY_ANGUILLA\|COUNTRY_ANTARCTICA\|COUNTRY_ANTIGUAANDBARBUDA\|COUNTRY_ARGENTINA\|COUNTRY_ARMENIA\|COUNTRY_ARUBA\|COUNTRY_AUSTRALIA\|COUNTRY_AUSTRIA\|COUNTRY_AZERBAIJAN\|COUNTRY_BAHAMAS\|COUNTRY_BAHRAIN\|COUNTRY_BANGLADESH\|COUNTRY_BARBADOS\|COUNTRY_BELARUS\|COUNTRY_BELGIUM\|COUNTRY_BELIZE\|COUNTRY_BENIN\|COUNTRY_BERMUDA\|COUNTRY_BESISLANDS\|COUNTRY_BHUTAN\|COUNTRY_BOLIVIA\|COUNTRY_BOSNI
" Hollywood Functions
syn keyword hwFunction Abs ACos ActivateDisplay Add AddArcToPath AddBoxToPath AddCircleToPath AddEllipseToPath AddFontPath AddIconImage AddMove AddStr AddTab AddTextToPath AllocConsoleColor AllocMem AllocMemFromPointer AllocMemFromVirtualFile AppendPath ApplyPatch Arc ArcDistortBrush ARGB ArrayToStr Asc ASin Assert AsyncDrawFrame ATan ATan2 BarrelDistortBrush Base64Str Beep BeepConsole BeginAnimStream BeginDoubleBuffer BeginRefresh BGPicToBrush BinStr BitClear BitComplement BitSet BitTest BitXor Blue BlurBrush Box BreakEventHandler BreakWhileMouseOn BrushToBGPic BrushToGray BrushToMonochrome BrushToPenArray BrushToRGBArray ByteAsc ByteChr ByteLen ByteOffset ByteStrStr ByteVal CallJavaMethod CancelAsyncDraw CancelAsyncOperation CanonizePath Cast Ceil ChangeApplicationIcon ChangeBrushTransparency ChangeDirectory ChangeDisplayMode ChangeDisplaySize ChangeInterval CharcoalBrush CharOffset CharWidth CheckEvent CheckEvents Chr Circle ClearClipboard ClearConsole ClearConsoleStyle ClearEvents ClearInterval ClearMove ClearObjectData ClearPath ClearScreen ClearSerialQueue ClearTimeout CloseAmigaGuide CloseAnim CloseAudio CloseCatalog CloseConnection CloseConsole CloseDirectory CloseDisplay CloseFile CloseFont CloseMusic ClosePath CloseResourceMonitor CloseSerialPort CloseServer CloseUDPObject CloseVideo Cls CollectGarbage Collision ColorRequest CompareDates CompareStr CompressFile Concat ConfigureJoystick ConsolePrint ConsolePrintChr ConsolePrintNR ConsolePrompt ContinueAsyncOperation ContrastBrush ContrastPalette ConvertStr ConvertToBrush CopyAnim CopyBGPic CopyBrush CopyConsoleWindow CopyFile CopyLayer CopyMem CopyObjectData CopyPalette CopyPath CopyPens CopySample CopySprite CopyTable CopyTextObject Cos CountDirectoryEntries CountJoysticks CountStr CRC32 CRC32Str CreateAnim CreateBGPic CreateBorderBrush CreateBrush CreateButton CreateClipRegion CreateConsoleWindow CreateCoroutine CreateDisplay CreateFont CreateGradientBGPic CreateGradientBrush CreateIcon CreateKeyDown CreateLayer CreateList CreateMenu CreateMusic CreatePalette CreatePointer CreatePort CreateRainbowBGPic CreateRexxPort CreateSample CreateServer CreateShadowBrush CreateShortcut CreateSprite CreateTextObject CreateTexturedBGPic CreateTexturedBrush CreateUDPObject CropBrush CtrlCQuit CurveTo CyclePalette DateToTimestamp DateToUTC DebugOutput DebugPrint DebugPrintNR DebugPrompt DebugStr DebugVal DecomposeConsoleChr DecompressFile DecreasePointer DefineVirtualFile DefineVirtualFileFromString Deg DeleteAlphaChannel DeleteButton DeleteConsoleChr DeleteConsoleLine DeleteFile DeleteMask DeletePrefs DeselectMenuItem DeserializeTable DirectoryItems DisableAdvancedConsole DisableButton DisableEvent DisableEventHandler DisableLayers DisableLineHook DisableMenuItem DisablePlugin DisablePrecalculation DisableVWait DisplayAnimFrame DisplayBGPic DisplayBGPicPart DisplayBGPicPartFX DisplayBrush DisplayBrushFX DisplayBrushPart DisplaySprite DisplayTextObject DisplayTextObjectFX DisplayTransitionFX DisplayVideoFrame Div DoMove DownloadFile DrawConsoleBorder DrawConsoleBox DrawConsoleHLine DrawConsoleVLine DrawPath DumpButtons DumpLayers DumpMem DumpVideo DumpVideoTime EdgeBrush Ellipse EmbossBrush EmptyStr EnableAdvancedConsole EnableButton EnableEvent EnableEventHandler EnableLayers EnableLineHook EnableMenuItem EnablePlugin EnablePrecalculation EnableVWait End EndDoubleBuffer EndianSwap EndRefresh EndSelect EndsWith Eof EraseConsole Error EscapeQuit Eval Execute Exists ExitOnError Exp ExtendBrush ExtractPalette FileAttributes FileLength FileLines FilePart FilePos FileRequest FileSize FileToString FillMem FillMusicBuffer FindStr FinishAnimStream FinishAsyncDraw FlashConsole Flip FlipBrush FlipSprite FloodFill Floor FlushFile FlushMusicBuffer FlushSerialPort FontRequest ForcePathUse ForceSound ForceVideoDriver ForceVideoMode ForEach ForEachI FormatConsoleLine FormatDate FormatNumber FormatStr Frac FreeAnim FreeBGPic FreeBrush FreeClipRegion FreeConsoleColor FreeConsoleWindow FreeDisplay FreeEventCache FreeGlyphCache FreeIcon FreeLayers FreeMem FreeMenu FreeModule FreePalette FreeP
" user-defined constants
syn match hwUserConstant "#\<\(\u\|_\|-\|\d\)\+\>\$\?"
" user-defined functions
syn match hwUserFunction "\<p_\w\{-1,}\>("me=e-1
" Comments
syn keyword hwTodo contained TODO FIXME XXX
syn match hwComment ";.*$" contains=hwTodo,@Spell
syn region hwComment matchgroup=hwComment start="/\*" end="\*/" contains=hwTodo,@Spell
" Strings
syn match hwSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
syn region hwString start=+'+hs=s+1 end=+'+he=e-1 skip=+\\\\\|\\'+ contains=hwSpecial,@Spell
syn region hwString start=+"+hs=s+1 end=+"+he=e-1 skip=+\\\\\|\\"+ contains=hwSpecial,@Spell
" integer number
syn match hwNumber "\<\d\+\>"
" floating point number, with dot, optional exponent
syn match hwNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\=\>"
" floating point number, starting with a dot, optional exponent
syn match hwNumber "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
" floating point number, without dot, with exponent
syn match hwNumber "\<\d\+[eE][-+]\=\d\+\>"
" hex numbers
syn match hwNumber "\<0[xX]\x\+\>"
syn match hwNumber "\<0[xX][[:xdigit:].]\+\%([pP][-+]\=\d\+\)\=\>"
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link hwPreProcessor PreProc
hi def link hwStatement Statement
hi def link hwFallThrough Statement
hi def link hwRepeat Repeat
hi def link hwFor Repeat
hi def link hwString PmenuSel
hi def link hwNumber Number
hi def link hwOperator Operator
hi def link hwStep Operator
hi def link hwIn Operator
hi def link hwUserConstant Constant
hi def link hwConstant Constant
hi def link hwLineStatement Conditional
hi def link hwCond Conditional
hi def link hwElseIf Conditional
hi def link hwFunction Function
hi def link hwUserFunction Function
hi def link hwComment MoreMsg
hi def link hwTodo Todo
hi def link hwTable Structure
hi def link hwError Error
hi def link hwParenError Error
hi def link hwBraceError Error
hi def link hwSpecial SpecialChar
hi def link hwLabel Label
let b:current_syntax = "hollywood"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: et ts=8 sw=2