neovim/runtime/syntax/hollywood.vim

182 lines
43 KiB
VimL
Raw Normal View History

" Vim syntax file
" Language: Hollywood 8.0
" Maintainer: Tom Crecelius <holly@net-eclipse.net>
" First Author: Tom Crecelius <holly@net-eclipse.net>
" Last Change: 2018 May 18
" 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 = 8
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 skipwhite skipempty
" Then ... Else
syn region hwThenElse transparent matchgroup=hwCond start="\<Then\>" end="$" end="\<Else\>" contains=ALLBUT,hwTodo,hwSpecial,hwIn,hwStep,hwLineStatement,hwIfEndIf,hwElseEndif,hwIfThen,hwThenElse 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
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\>\)"
syn keyword hwConstant Nil
syn keyword hwConstant True False
" predefined preprocessing commands
syn match hwPreProcessor "@\<\%(BGPIC\|BRUSH\|ANIM\|SPRITE\|SAMPLE\|MUSIC\|FILE\|FONT\|VIDEO\|VERSION\|APPTITLE\|APPAUTHOR\|APPCOPYRIGHT\|APPDESCRIPTION\|APPVERSION\|APPICON\|BACKFILL\|SCREEN\|DISPLAY\|INCLUDE\|OPTIONS\|REQUIRE\|MENU\|APPIDENTIFIER\|WARNING\|ERROR\|IF\|ELSEIF\|ELSE\|ENDIF\)\>"ms=s+1
" predefined constants
syn match hwConstant "#\<\%(ERR_PORTNOTAVAIL\|SEEK_END\|ERR_CREATESHORTCUT\|PURPLE\|ERR_ALLOCCHANNEL\|PRGTYPE_SCRIPT\|ERR_NORETVAL\|ERR_DDRECVIDEO\|ERR_FINDPATH\|LANGUAGE_RUNDI\|ERR_STRINGCST\|COUNTRY_COLOMBIA\|LANGUAGE_KOREAN\|ERR_USERABORT\|ERR_WENDWOWHILE\|FONT\|FILEATTR_WRITE_OTH\|ERR_MODIFYABGPIC\|COUNTRY_DRCONGO\|LANGUAGE_KIRGHIZ\|LANGUAGE_ROMANSH\|FILEATTR_EXECUTE_GRP\|ERR_READVIDEOPIXELS\|SCROLLTOP\|ERR_ANIMDISK\|COUNTRY_IVORYCOAST\|LANGUAGE_GUJARATI\|SHORT\|COUNTRY_SOUTHAFRICA\|VIDEO\|ERR_BLKWOENDBLK\|ERR_WRONGHEX\|SPRITE_VS_BRUSH\|LANGUAGE_HIRIMOTU\|ZOOMSOUTHEAST\|COUNTRY_SLOVAKIA\|COUNTRY_GIBRALTAR\|ERR_INVALIDDATE\|RTS_ON\|PIXELZOOM1\|ATTRFRAMEDELAY\|AQUA\|ATTRFONTSCALABLE\|FILEATTR_NORMAL\|COUNTRY_ALBANIA\|COUNTRY_JAMAICA\|FONTWEIGHT_MEDIUM\|ERR_MALFORMPAT1\|COUNTRY_FRENCHGUIANA\|ERR_MAXPARAMS\|ERR_FORWONEXT\|COUNTRY_CONGO\|COUNTRY_GAMBIA\|UPNDOWN\|COUNTRY_ANDORRA\|BRUSH\|ERR_SELECTALPHACHANNEL\|MODLCOMMAND\|CLIENT\|COUNTRY_TRINIDADANDTOBAGO\|DIRECTORY\|LANGUAGE_ESPERANTO\|ATTRRAWHEIGHT\|COUNTRY_DENMARK\|FILETYPE_SOUND\|CLIPBOARD_TEXT\|LANGUAGE_FULAH\|ATTRPOSITION\|PLUGINCAPS_CONVERT\|ERR_APPLETVERSION\|COUNTRY_VANUATU\|COUNTDIRECTORIES\|ATTRNOHIDE\|VSTRIPES64\|AMIGAICON_SETPOSITION\|PUSHBOTTOM\|ERR_BACKFILL\|COUNTRY_MOROCCO\|ERR_FILEFORMAT\|COUNTRY_CHILE\|ATTRHOSTSCALEY\|ERR_AHI\|HW_VERSION\|ERR_ALRDYDECLRD\|ATTRRAWWIDTH\|ERR_PIXELFORMAT\|IMGFMT_PLUGIN\|LANGUAGE_HEBREW\|ERR_SETMENU\|ERR_NOLAYERS\|CRUSHTOP\|ERR_MAXLINES\|ATTRHASMASK\|LEFT\|ERR_SELECTANIM\|WALLPAPERLEFT\|TEXTOBJECT\|ERR_AFILEPROP\|LANGUAGE_CZECH\|LANGUAGE_XHOSA\|ERR_PIPE\|LANGUAGE_MANX\|ERR_EXECUTE\|ERR_ENDDOUBLEBUFFER\|ATTRGROUP\|ERR_NAMETOOLONG\|ATTRBORDERRIGHT\|COUNTRY_BOSNIAANDHERZEGOVINA\|ATTRMARGINRIGHT\|RTS_OFF\|LANGUAGE_MARSHALLESE\|LANGUAGE_AZERBAIJANI\|LANGUAGE_TAHITIAN\|JOINMITER\|ATTRNOCLOSE\|REQICON_WARNING\|ERR_NOTPROTRACKER\|LANGUAGE_LAO\|ERR_EMPTYPATH\|ERR_NOCALLBACK\|COUNTRY_UGANDA\|ERR_READFUNC\|IMGFMT_UNKNOWN\|ADF_ANIM\|ERR_LAYERSWITCH\|ERR_RECVCLOSED\|ERR_CTRLSTRUCT\|ERR_TABLEOVERFLOW\|SCROLLBOTTOM\|VSTRIPES\|ERR_VAREXPECTED\|ERR_NOTIGER\|BEEPSYSTEM\|ERR_LOWFREQ\|COUNTFILES\|COUNTRY_MONACO\|BLUE\|ERR_VFONT\|STRUDEL\|REQ_GALLERY\|ERR_NOCOORDCST\|MENU\|HSTRIPES64\|COUNTRY_COCOSISLANDS\|LANGUAGE_SOUTHNDEBELE\|COUNTRY_FALKLANDISLANDS\|COUNTRY_UAE\|LANGUAGE_KANNADA\|ERR_VIDRECMULTI\|FILETYPE_VIDEO\|LANGUAGE_ESTONIAN\|COUNTRY_CAYMANISLANDS\|ERR_BADINTEGER\|MONO16\|COUNTRY_CAMEROON\|COUNTRY_GUAM\|ERR_DISPLAYDESKTOP\|ERR_SETENV\|ERR_INTERNAL\|MASKVISIBLE\|ERR_OPENFONT\|LANGUAGE_WELSH\|ATTRRAWXPOS\|LANGUAGE_THAI\|ATTRHOSTMONITORS\|LANGUAGE_GALICIAN\|COUNTRY_GUATEMALA\|ATTRYPOS\|COUNTRY_UZBEKISTAN\|ERR_ELSEIFAFTERELSE\|MODRCONTROL\|BAUD_4800\|JOYDOWNRIGHT\|COUNTRY_LUXEMBOURG\|COUNTRY_MOZAMBIQUE\|ERR_PAKFORMAT\|LANGUAGE_TAJIK\|LANGUAGE_PANJABI\|ERR_MISSINGFIELD\|PLUGINCAPS_LIBRARY\|ERR_FUNCARGS\|LANGUAGE_MALAY\|COUNTRY_PORTUGAL\|COUNTRY_JAPAN\|ERR_ICONPARMS\|COUNTRY_NEWCALEDONIA\|REMOVELAYER\|MOVEWINDOW\|ATTRFONTASCENDER\|PLUGINCAPS_DIRADAPTER\|ERR_VARLENGTH\|ATTRSIZEABLE\|ERR_SENDUNKNOWN\|MENUITEM_RADIO\|COUNTRY_BELIZE\|ERR_LABELDOUBLE\|QUADRECT\|VBLINDS8\|ERR_UNKNOWNCMD\|SCROLLEAST\|ONBUTTONCLICKALL\|RECTNORTHEAST\|FONTWEIGHT_EXTRABOLD\|COUNTRY_SAINTKITTSANDNEVIS\|ERR_CLOSEDDISPLAY\|PLUGINCAPS_SAVEANIM\|ERR_WINDOW\|LANGUAGE_ZHUANG\|CAPROUND\|ERR_OUTOFRANGE\|REQ_CAMERA\|ERR_WARPOS\|COUNTRY_ELSALVADOR\|ERR_GROUPNAMEUSED\|COUNTRY_GUYANA\|ERR_ALREADYASYNC\|COUNTRY_PALESTINE\|DISPMODE_FAKEFULLSCREEN\|ERR_SYNTAXLEVELS\|ERR_BADPLATFORM\|ERR_VERSION\|ATTRVISIBLE\|HSTRETCHCENTER\|COUNTRY_REUNION\|COUNTRY_INDIA\|STRETCHLEFT\|ERR_ZERODIVISION\|LANGUAGE_NORTHERNSAMI\|SIMPLEBUTTON\|ERR_FINDMENU\|ERR_EMPTYOBJ\|LANGUAGE_BIHARI\|LANGUAGE_LIMBURGAN\|LANGUAGE_BOSNIAN\|ERR_SYSTOOOLD\|ERR_WRITEJPEG\|STOP_1\|COPYFILE_OVERWRITE\|ERR_REVDWORD\|PLUGINCAPS_ANIM\|ERR_ASSERTFAILED\|ERR_BRACEOPEN\|ERR_NEEDMORPHOS2\|BLACK\|LANGUAGE_SWEDISH\|ERR_DBLENCODING\|COPYFILE_STATUS\|ERR_WRONGOPCST\|ERR_BADIP\|ERR_UNKNOWNSEQ\|LANGUAGE_LUXEMBOURGISH\|ERR_WITHWOENDWITH\|ERR_LABINIF\|LANGUAGE_TATAR\|ERR_VIDEOLAYERDRV\|ERR_LEGACYPTMOD\|ERR_SAVEPNG\|NOTRANSPARENCY\|ATTRMASK
" Hollywood Functions
syn keyword hwFunction LowerStr UpperStr Val StrStr UnrightStr UnleftStr Chr MidStr RightStr LeftStr FindStr AddStr HexStr Asc StrLen ReplaceStr BinStr SplitStr PadNum StrToArray TrimStr ToString ToNumber UnmidStr CountStr InsertStr RepeatStr MD5Str CRC32Str FormatStr PatternFindStr PatternReplaceStr Eval PatternFindStrDirect PatternFindStrShort ArrayToStr Base64Str ToUserData ByteOffset CharOffset CharWidth ValidateStr ConvertStr ReverseStr ByteLen IsAlNum IsAlpha IsCntrl IsDigit IsGraph IsLower IsPrint IsPunct IsSpace IsUpper IsXDigit CompareStr ByteAsc ByteChr StartsWith EndsWith StripStr EmptyStr ByteVal ByteStrStr Abs Sin Cos Tan ASin ACos ATan ATan2 Ceil Floor Mod FrExp LdExp Sqrt Min Max Log Ld Ln Exp Deg Pow Rad Rnd RndF Add Sub Div Mul Round Int Frac Shr Shl Rt Wrap Limit BitSet BitTest BitClear BitXor BitComplement Sgn Sar Ror Rol Cast Hypot EndianSwap RndStrong Red Green Blue RGB ARGB MovePointer HidePointer SetPointer ShowPointer GetAttribute GetPen VWait SetFPSLimit GetFPSLimit IsPicture GetRealColor SaveSnapshot MixRGB CreateClipRegion SetClipRegion FreeClipRegion CreatePointer FreePointer AsyncDrawFrame CancelAsyncDraw FinishAsyncDraw DumpVideoTime GetRandomColor SetDrawTagsDefault BeginRefresh EndRefresh Intersection Box Plot Ellipse Line Circle Polygon SetFillStyle ReadPixel Cls Arc SetFormStyle SetLineWidth GetFillStyle GetFormStyle GetLineWidth MoveBrush MoveAnim MoveTextObject MoveLayer MoveSprite OpenFile Eof ReadChr ReadLine ReadString Seek WriteChr WriteLine WriteString Exists FileSize PathPart FilePart MakeDirectory GetVolumeInfo DeleteFile Execute Run ChangeDirectory GetVolumeName CloseFile ReadDirectory FullPath CopyFile Rename IsDirectory CRC32 WriteShort WriteInt WriteFloat ReadShort ReadInt ReadFloat FilePos MatchPattern FlushFile SetIOMode GetFileAttributes SetFileAttributes GetTempFileName FileLength CompressFile DecompressFile OpenDirectory CloseDirectory NextDirectoryEntry WriteFunction ReadFunction DefineVirtualFile ReadTable WriteTable GetCurrentDirectory ApplyPatch DefineVirtualFileFromString UndefineVirtualStringFile FileToString StringToFile GetEnv SetEnv UnsetEnv MD5 FileLines FileAttributes GetAsset ReadByte WriteByte ReadBytes WriteBytes DirectoryItems MoveFile UseCarriageReturn HaveVolume GetDirectoryEntry RewindDirectory CountDirectoryEntries MonitorDirectory WaitLeftMouse WaitRightMouse WaitKeyDown IsKeyDown WhileRightMouseDown WhileMouseDown WhileKeyDown IsLeftMouse IsRightMouse BreakWhileMouseOn SetEventTimeout GetEventCode LeftMouseQuit EscapeQuit CtrlCQuit EnableEvent DisableEvent RemoveButton RemoveKeyDown ModifyButton ModifyKeyDown WhileMouseOn CreateButton CreateKeyDown FreeEventCache ClearEvents CheckEvent WaitEvent MouseX MouseY MakeButton DeleteButton DisableButton EnableButton InstallEventHandler SetInterval SetTimeout ClearInterval ClearTimeout ChangeInterval DumpButtons WaitMidMouse IsMidMouse ResetKeyStates JoyDir JoyFire CountJoysticks BreakEventHandler CheckEvents CreatePort SendMessage ShowKeyboard HideKeyboard Wait OpenCatalog CloseCatalog GetCatalogString GetDate GetTime GetWeekday GetDateNum GetTimer PauseTimer ResumeTimer StartTimer StopTimer SystemRequest GetMemoryInfo End GetErrorName Sort DebugStr DebugVal DebugPrint ExitOnError GetLastError DebugOutput GetType IIf InsertItem RemoveItem ListItems StringRequest Unpack SetMetaTable GetMetaTable RawEqual RawGet RawSet GCInfo CollectGarbage Error WaitTimer FileRequest PathRequest IPairs Pairs NextItem GetVersion GetCommandLine GetProgramInfo ResetTimer GetConstant SetClipboard GetClipboard PeekClipboard ClearClipboard CompareDates OpenURL CopyTable FontRequest ListRequest ColorRequest GetSystemLanguage GetSystemCountry DebugPrompt GetFileArgument Assert ForEach ForEachI Concat GetObjectType GetObjectData SetObjectData ClearObjectData CopyObjectData HaveObjectData GetObjects RaiseOnError HaveObject GetPlugins IsNil HaveItem DisablePlugin EnablePlugin LoadPlugin HavePlugin GetSystemInfo LegacyControl DisableLineHook EnableLineHook IncreasePointer DecreasePointer GetApplicationInfo DebugPrintNR TableItems IsTa
" user-defined constants
syn match hwUserConstant "#\<\u\+\>"
" 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