diff --git a/runtime/syntax/krl.vim b/runtime/syntax/krl.vim index a50790841e..6808a48fc4 100644 --- a/runtime/syntax/krl.vim +++ b/runtime/syntax/krl.vim @@ -2,7 +2,7 @@ " Language: Kuka Robot Language " Maintainer: Patrick Meiser-Knosowski " Version: 3.0.0 -" Last Change: 18. Apr 2022 +" Last Change: 22. Jun 2023 " Credits: Thanks for contributions to this to Michael Jagusch " Thanks for beta testing to Thomas Baginski " @@ -109,11 +109,11 @@ highlight default link krlGeomOperator Operator " Type, StorageClass and Typedef {{{ " Simple data types -syn keyword krlType bool char real int containedin=krlAnyType +syn keyword krlType bool char real int " External program and function -syn keyword krlType ext extfct extfctp extp containedin=krlAnyType +syn keyword krlType ext extfct extfctp extp " Communication -syn keyword krlType signal channel containedin=krlAnyType +syn keyword krlType signal channel highlight default link krlType Type " StorageClass syn keyword krlStorageClass decl global const struc enum @@ -200,19 +200,20 @@ syn keyword krlEnum adap_acc model_type control_parameter eko_mode " " Predefined structures and enums found in /steu/mada/$custom.dat syn keyword krlStructure pro_io_t ser ext_mod_t coop_krc ws_config bin_type coop_update_t ldc_reaction -syn keyword krlEnum axis_of_coordinates spline_para_variant target_status cp_vel_type cp_statmon +syn keyword krlEnum axis_of_coordinates motion_mode spline_para_variant spreadstartpolicy target_status cp_vel_type cp_statmon " " Predefined structures and enums found in /steu/mada/$machine.dat syn keyword krlStructure emstop_path boxstatesafein boxstatesafeout syn keyword krlEnum digincode " " Predefined structures and enums found in /steu/mada/$option.dat -syn keyword krlStructure msg_t +syn keyword krlStructure installed_motion_modes msg_t +syn keyword krlEnum step_enum " syn keyword krlEnum " " Predefined structures and enums found in /r1/system/$config.dat " BasisTech -syn keyword krlStructure dig_out_type ctrl_in_t ctrl_out_t fct_out_t fct_in_t odat basis_sugg_t out_sugg_t md_state machine_def_t machine_tool_t machine_frame_t trigger_para constvel_para condstop_para adat tm_sugg_t tqm_tqdat_t sps_prog_type +syn keyword krlStructure dig_out_type ctrl_in_t ctrl_out_t fct_out_t fct_in_t odat hdat basis_sugg_t out_sugg_t md_state machine_def_t machine_tool_t machine_frame_t trigger_para constvel_para condstop_para adat tm_sugg_t tqm_tqdat_t sps_prog_type syn keyword krlEnum bas_command out_modetype ipo_m_t apo_mode_t funct_type p00_command timer_actiontype " " GripperTech @@ -271,7 +272,9 @@ highlight default link krlStatement Statement syn keyword krlConditional if then else endif switch case default endswitch skip endskip highlight default link krlConditional Conditional " Repeat -syn keyword krlRepeat for to step endfor while endwhile repeat until loop endloop exit +syn keyword krlRepeat for to endfor while endwhile repeat until loop endloop exit +" STEP is used as variable in VKRC, this pattern should match STEP -, 5(constant number) or VAR +syn match krlRepeat /\v\cstep\s+%(-|\w)/me=e-1 highlight default link krlRepeat Repeat " Label syn keyword krlLabel goto @@ -390,7 +393,7 @@ if get(g:, 'krlShowError', 1) " some more or less common typos " " vars or funcs >24 chars are not possible in krl. a234567890123456789012345 - syn match krlError0 /\w\{25,}/ containedin=krlFunction,krlNames,krlLabel,krlAnyType,krlEnumVal,krlSysvars + syn match krlError0 /\w\{25,}/ containedin=krlFunction,krlNames,krlLabel,krlEnumVal,krlSysvars " " should be interrupt (on|off) \w+ syn match krlError1 /\vinterrupt[ \t(]+[_$a-zA-Z0-9]+[_$a-zA-Z0-9.\[\]()+\-*/]*[ \t)]+o%(n|ff)>/ diff --git a/runtime/syntax/rapid.vim b/runtime/syntax/rapid.vim new file mode 100644 index 0000000000..ed0da095c0 --- /dev/null +++ b/runtime/syntax/rapid.vim @@ -0,0 +1,687 @@ +" ABB Rapid Command syntax file for Vim +" Language: ABB Rapid Command +" Maintainer: Patrick Meiser-Knosowski +" Version: 2.3.0 +" Last Change: 21. Jul 2023 +" Credits: Thanks for beta testing to Thomas Baginski +" +" Suggestions of improvement are very welcome. Please email me! +" +" +" +" Note to self: +" for testing perfomance +" open a 1000 lines file. +" :syntime on +" G +" hold down CTRL-U until reaching top +" :syntime report +" +" +" TODO: - highlight rapid constants and maybe constants from common +" technology packages +" - optimize rapidErrorStringTooLong +" - error highlight for missing 2nd point in MoveCirc et al + +" Init {{{ +" Remove any old syntax stuff that was loaded (5.x) or quit when a syntax file +" was already loaded (6.x). +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +let s:keepcpo= &cpo +set cpo&vim + +" if colorscheme is tortus rapidNoHighLink defaults to 1 +if (get(g:,'colors_name'," ")=="tortus" || get(g:,'colors_name'," ")=="tortusless") + \&& !exists("g:rapidGroupName") + let g:rapidGroupName=1 +endif +" rapidGroupName defaults to 0 if it's not initialized yet or 0 +if !get(g:,"rapidGroupName",0) + let g:rapidGroupName=0 +endif + +" Rapid does ignore case +syn case ignore +" spell checking +syn spell notoplevel +" }}} init + +" common highlighting {{{ + +" Error {{{ +if get(g:,'rapidShowError',1) + " + " This error must be defined befor rapidCharCode and rapidEscapedBackSlash + " a string containing a single \ which is not a char code + syn match rapidErrorSingleBackslash /\\/ contained + highlight default link rapidErrorSingleBackslash Error + " +endif +" }}} Error + +" Constant values {{{ +" Boolean +syn keyword rapidBoolean TRUE FALSE Edge High Low +highlight default link rapidBoolean Boolean +" Float (num) +" syn match rapidFloat /\v%(\W|_)@1<=[+-]?\d+\.?\d*%(\s*[eE][+-]?\d+)?/ +syn match rapidFloat /\v\c%(<\d+\.|\.?<\d)\d*%(E[+-]?\d+)?>/ contains=rapidOperator +highlight default link rapidFloat Float +" integer in decimal, hexadecimal, octal and binary +syn match rapidDec /\<[0-9]\+\>/ +highlight default link rapidDec Number +syn match rapidHex /\<0x[0-9a-fA-F]\+\>/ +highlight default link rapidHex Number +syn match rapidOct /\<0o[0-7]\+\>/ +highlight default link rapidOct Number +syn match rapidBin /\<0b[01]\+\>/ +highlight default link rapidBin Number +" String. Note: Don't rename group rapidString. Indent depend on this +syn region rapidString matchgroup=rapidString start=/"/ skip=/""/ end=/"/ oneline contains=rapidStringDoubleQuote,rapidEscapedBackSlash,rapidCharCode,rapidErrorSingleBackslash,rapidErrorStringTooLong,@Spell +highlight default link rapidString String +" two adjacent "" in string for one double quote +syn match rapidStringDoubleQuote /""/ contained +highlight default link rapidStringDoubleQuote SpecialChar +" character code in string +syn match rapidCharCode /\\\x\x/ contained +highlight default link rapidCharCode SpecialChar +" escaped \ in string +syn match rapidEscapedBackSlash /\\\\/ contained +highlight default link rapidEscapedBackSlash SpecialChar +" }}} Constant values + +" }}} common highlighting + +if bufname("%") =~ '\c\.cfg$' +" {{{ highlighting for *.cfg + + " special chars {{{ + " syn match rapidOperator /:\|[+-]\|\*\|\/\|\\/ + syn match rapidOperator /[-+*/:\\]/ + syn match rapidOperator /^#/ + highlight default link rapidOperator Operator + " }}} special chars + + " sections {{{ + syn match rapidException /^\w\+/ + syn match rapidException /CFG_\d\+/ + highlight default link rapidException Exception + " }}} sections + + " Error {{{ + if get(g:,'rapidShowError',1) + " + " This error must be defined after rapidString + " Any Name longer than 32 chars + syn match rapidErrorNameTooLong /-Name "[^"]\{33,}"/ + highlight default link rapidErrorNameTooLong Error + " + endif + " }}} Error + + " }}} highlighting for *.cfg +else + " highlighting for *.mod, *.sys and *.prg {{{ + + " sync for regions from a line comment or the start of a function + syn sync match rapidSync grouphere NONE /\v\c^\s*%(!|%(task\s+|local\s+)?%(module|proc|func|trap|record)>)/ + + " Comment {{{ + " TODO Comment + syn match rapidTodoComment contained /\\|\\|\/ + highlight default link rapidTodoComment Todo + " Debug comment + syn match rapidDebugComment contained /\/ + highlight default link rapidDebugComment Debug + " Line comment + syn match rapidComment /!.*$/ contains=rapidTodoComment,rapidDebugComment,@Spell + highlight default link rapidComment Comment + " }}} Comment + + " Header {{{ + syn match rapidHeader /^%%%/ + highlight default link rapidHeader PreProc + " }}} Header + + " Operator {{{ + " Boolean operator + syn keyword rapidOperator and or xor not div mod + " Arithmetic and compare operator + syn match rapidOperator /[-+*/<>:=]/ + " conditional argument + syn match rapidOperator /?/ + highlight default link rapidOperator Operator + " }}} Operator + + " Type, StorageClass and Typedef {{{ + " anytype (preceded by 'alias|pers|var|const|func' + " TODO: still missing are userdefined types which are part of a parameter: + " PROC message( mystring msMessagePart1{}, + " \ myvar msMsg4{}) + " TODO testing. Problem: does not highlight any type if it's part of an argument list + " syn match rapidAnyType /\v^\s*(global\s+|task\s+|local\s+)?(alias|pers|var|const|func)\s+\w+>/ contains=rapidStorageClass,rapidType,rapidTypeDef + " highlight default link rapidAnyType Type + syn keyword rapidType accdata aiotrigg bool btnres busstate buttondata byte + syn keyword rapidType cfgdomain clock cnvcmd confdata confsupdata corrdescr datapos deflectiondata dionum dir dnum + syn keyword rapidType egmframetype egmident egm_minmax egmstate egmstopmode errdomain errnum ErrorInfo errstr errtype event_type exec_level extjoint handler_type + syn keyword rapidType icondata identno inposdata intnum inttypes iodev iounit_state jointtarget + syn keyword rapidType listitem loaddata loadidnum loadsession mecunit motionprocessmode motsetdata + " syn keyword rapidType num + syn keyword rapidType opcalc opnum orient paridnum paridvalidnum pathrecid pnpdata pos pose proc_times progdisp o_jointtarget o_robtarget + syn keyword rapidType rawbytes restartdata rmqheader rmqmessage rmqslot robjoint robtarget + syn keyword rapidType searchdata sensor sensorstate sensorvardata shapedata signalai signalao signaldi signaldo signalgi signalgo signalorigin singdata socketdev socketstatus speeddata stopmovestartmove_mem stoppoint stoppointdata string stringdig sup_timeouts supervtype switch symnum syncident + syn keyword rapidType taskid tasks tasksatstart testsignal tooldata tpnum trapdata triggdata triggflag triggios triggiosdnum triggmode triggstrgo tsp_status tunegtype tunetype + syn keyword rapidType uishownum veldata visiondata wobjdata wzstationary wztemporary zonedata + " SoftMove data types + syn keyword rapidType css_offset_dir css_soft_dir cssframe + " arc data types + syn keyword rapidType advSeamData arcdata flystartdata seamdata arctrackdata opttrackdata weavedata welddata + " conveyor tracking data types + syn keyword rapidType indcnvdata + " Integrated Vision data types + syn keyword rapidType cameradev cameratarget + " arc Weldguide and MultiPass data types + syn keyword rapidType adaptdata trackdata multidata + " dispense data types + syn keyword rapidType beaddata equipdata + " Spot data types + syn keyword rapidType gundata gunnum spotdata forcedata simdata smeqdata smeqtype + " Tool change data types + syn keyword rapidType standno ToolInfo toolno + " Continuous Application Platform data types + syn keyword rapidType capaptrreferencedata capdata capevent caplatrackdata capmvsttim capspeeddata capspeeddata capstopmode captestno captrackdata capweavedata flypointdata processtimes restartblkdata supervtimeouts weavestartdata + " Bulls Eye data types + syn keyword rapidType be_device be_scan be_tooldesign + " Force Control data types + syn keyword rapidType fcboxvol fccondstatus fccylindervol fcdamping fcforcevector fcframe fclindir fcprocessdata fcplane fcrotdir fcspeedvector fcspherevol fcspdchgtunetype fcxyznum + " Discrete application platform data types + syn keyword rapidType dadescapp dadescprc daintdata + " VW Konzernstandard VWKS_1.07.02 + syn keyword rapidType merker + syn keyword rapidType frgnum frgwert robnum + syn keyword rapidType fmnum applid calibdatavorr stepdata + syn keyword rapidType tsmethode tsdaten teilspeicherdaten + syn keyword rapidType greiferdaten greiferposition bauteildaten bauteilkontrolle g_datenident g_sensor g_signal g_teilident g_ventil + syn keyword rapidType strgnum typnum + syn keyword rapidType hubnum kopfnum + syn keyword rapidType applservicetype + syn keyword rapidType applfraesdaten kwdionum + syn keyword rapidType butechnum + syn keyword rapidType toolnum dbnum + " das folgende sind datentypen aber das kann man doch nicht machen... + " syn keyword rapidType position wert + syn keyword rapidType camdata camlimitdata cammode camprotocoldata camstatus camsequence campositionstatus + syn keyword rapidType saposnum sabereichnum autofocusnum focusposnum lascaledata laleistungnum larobnum laprognum uebwnum dgbanum dgjobnum gasspuelnum davalve gasuebwnum + syn keyword rapidType lsfigurnum lsstarttype + syn keyword rapidType lwprognum lwdiodnum lsstarttype + syn keyword rapidType lztype diskrethubnum lztipnum + syn keyword rapidType gblmethod + syn keyword rapidType buatypenum buatechnum buadirnum + highlight default link rapidType Type + " Storage class + syn keyword rapidStorageClass LOCAL TASK VAR PERS CONST ALIAS NOVIEW NOSTEPIN VIEWONLY READONLY SYSMODULE INOUT + highlight default link rapidStorageClass StorageClass + " Not a typedef but I like to have those highlighted different then types, + " structures or strorage classes + syn keyword rapidTypeDef MODULE ENDMODULE PROC ERROR UNDO BACKWARD ENDPROC RECORD ENDRECORD TRAP ENDTRAP FUNC ENDFUNC + highlight default link rapidTypeDef TypeDef + " }}} Type, StorageClass and Typedef + + " Statements, keywords et al {{{ + " syn keyword rapidStatement + " highlight default link rapidStatement Statement + " Conditional + syn keyword rapidConditional if then elseif else endif test case default endtest + highlight default link rapidConditional Conditional + " Repeat + syn keyword rapidRepeat do + syn match rapidRepeat /\c\v^\s*%(|)%([^!]+)@=/ + syn keyword rapidRepeat from to step endfor endwhile + highlight default link rapidRepeat Repeat + " Label + syn keyword rapidLabel goto + syn match rapidLabel /\c\v^\s*[[:upper:][:lower:]]\k*\:\ze%([^=]|$)/ contains=rapidConditional,rapidOperator + highlight default link rapidLabel Label + " Keyword + syn keyword rapidKeyword AccSet ActEventBuffer ActUnit Add AliasCamera AliasIO AliasIOReset BitClear BitSet BookErrNo BrakeCheck + syn keyword rapidKeyword CallByVar CancelLoad CheckProgRef CirPathMode Clear ClearIOBuff ClearPath ClearRawBytes ClkReset ClkStart ClkStop Close CloseDir ConfJ ConfL CONNECT CopyFile CopyRawBytes CornerPathWarning CorrClear CorrCon CorrDiscon CorrWrite + syn keyword rapidKeyword CSSAct CSSDeact CSSForceOffsetAct CSSForceOffsetDeact CSSOffsetTune CyclicBrakeCheck + syn keyword rapidKeyword DeactEventBuffer DeactUnit Decr DitherAct DitherDeact DropSensor + syn keyword rapidKeyword EGMActJoint EGMActMove EGMActPose EGMGetId EGMReset EGMSetupAI EGMSetupAO EGMSetupGI EGMSetupLTAPP EGMSetupUC EOffsOff EOffsOn EOffsSet EraseModule ErrLog ErrWrite + syn keyword rapidKeyword FitCircle FricIdInit FricIdEvaluate FricIdSetFricLevels + syn keyword rapidKeyword GetDataVal GetGroupSignalInfo GetJointData GetSysData GetTorqueMargin GetTrapData GripLoad HollowWristReset + syn keyword rapidKeyword IDelete IDisable IEnable IError Incr IndReset InvertDO IOBusStart IOBusState IoCtrlAxis_RefSync IoCtrlAxis_RefSyncOff IoCtrlAxis_RefSyncOn IODisable IOEnable IPers IRMQMessage ISignalAI ISignalAO ISignalDI ISignalDO ISignalGI ISignalGO ISleep ITimer IVarValue IWatch + syn keyword rapidKeyword Load LoadId MakeDir ManLoadIdProc MatrixSolve MatrixSolveQR MatrixSVD MechUnitLoad MotionProcessModeSet MotionSup MToolRotCalib MToolTCPCalib Open OpenDir + syn keyword rapidKeyword PackDNHeader PackRawBytes PathAccLim PathLengthReset PathLengthStart PathLengthStop PathRecStart PathRecStop PathResol PDispOff PDispOn PDispSet ProcerrRecovery PrxActivAndStoreRecord PrxActivRecord PrxDbgStoreRecord PrxDeactRecord PrxResetPos PrxResetRecords PrxSetPosOffset PrxSetRecordSampleTime PrxSetSyncalarm PrxStartRecord PrxStopRecord PrxStoreRecord PrxUseFileRecord PulseDO + syn keyword rapidKeyword ReadAnyBin ReadBlock ReadCfgData ReadErrData ReadRawBytes ReadVarArr RemoveAllCyclicBool RemoveCyclicBool RemoveDir RemoveFile RenameFile Reset ResetAxisDistance ResetAxisMoveTime ResetPPMoved ResetRetryCount ResetTorqueMargin RestoPath Rewind RMQEmptyQueue RMQFindSlot RMQGetMessage RMQGetMsgData RMQGetMsgHeader RMQReadWait RMQSendMessage RMQSendWait + syn keyword rapidKeyword SafetyControllerSyncRequest Save SaveCfgData SCWrite SenDevice Set SetAllDataVal SetAO SetDataSearch SetDataVal SetDO SetGO SetLeadThrough SetSysData SetupCyclicBool SiConnect SiClose SiGetCyclic SingArea SiSetCyclic SkipWarn SocketAccept SocketBind SocketClose SocketConnect SocketCreate SocketListen SocketReceive SocketReceiveFrom SocketSend SocketSendTo SoftAct SoftDeact SoftElbow SpeedLimAxis SpeedLimCheckPoint SpeedRefresh SpyStart SpyStop StartLoad STCalib STClose STIndGun STIndGunReset SToolRotCalib SToolTCPCalib STOpen StorePath STTune STTuneReset SupSyncSensorOff SupSyncSensorOn SyncMoveOff SyncMoveOn SyncMoveResume SyncMoveSuspend SyncMoveUndo SyncToSensor SystemStopAction + syn keyword rapidKeyword TestSignDefine TestSignReset TextTabInstall TPErase TPReadDnum TPReadFK TPReadNum TPShow TPWrite TriggCheckIO TriggDataCopy TriggDataReset TriggEquip TriggInt TriggIO TriggRampAO TriggSpeed TriggStopProc TryInt TuneReset TuneServo + syn keyword rapidKeyword UIMsgBox UIMsgWrite UIMsgWriteAbort UIShow UnLoad UnpackRawBytes VelSet WaitAI WaitAO WaitDI WaitDO WaitGI WaitGO WaitLoad WaitRob WaitSensor WaitSyncTask WaitTestAndSet WaitTime WaitUntil WarmStart WITH WorldAccLim Write WriteAnyBin WriteBin WriteBlock WriteCfgData WriteRawBytes WriteStrBin WriteVar WriteVarArr WZBoxDef WZCylDef WZDisable WZDOSet WZEnable WZFree WZHomeJointDef WZLimJointDef WZLimSup WZSphDef + " arc instructions + syn keyword rapidKeyword ArcRefresh RecoveryMenu RecoveryMenuWR RecoveryPosSet RecoveryPosReset SetWRProcName + " conveyor tracking instructions + syn keyword rapidKeyword UseACCProfile WaitWObj DropWObj RecordProfile WaitAndRecProf StoreProfile LoadProfile ActivateProfile DeactProfile CnvGenInstr CnvSync CnvGenInstr IndCnvInit IndCnvEnable IndCnvDisable IndCnvReset IndCnvAddObject + syn keyword rapidKeyword UseReachableTargets GetMaxUsageTime ResetMaxUsageTime CnvPredictReach + " Integrated Vision instructions + syn keyword rapidKeyword CamFlush CamGetParameter CamGetResult CamLoadJob CamReqImage CamSetExposure CamSetParameter CamSetProgramMode CamSetRunMode CamStartLoadJob CamWaitLoadJob + " arc Weldguide and MultiPass instructions + syn keyword rapidKeyword MPSavePath MPLoadPath MPReadInPath MPOffsEaxOnPath + " Paint instructions + syn keyword rapidKeyword ConsoleWrite IpsSetParam PntProdUserLog SetBrush SetBrushFac + " Spot instructions + syn keyword rapidKeyword SetForce Calibrate ReCalcTCP IndGunMove IndGunMoveReset OpenHighLift CloseHighLift SwSetIntSpotData SwSetIntForceData SwSetIntGunData SwSetIntSimData SwGetCalibData SwGetFixTipData + " Tool change instructions + syn keyword rapidKeyword TcCloseCover TcDropOffTool TcLockTool TcOpenCover TcPickupTool TcUnlockTool + " dispense instructions + syn keyword rapidKeyword SetTmSignal SyncWWObj + " Continuous Application Platform instructions + syn keyword rapidKeyword CapAPTrSetup CapAPTrSetupAI CapAPTrSetupAO CapAPTrSetupPERS CapCondSetDO CapEquiDist CapNoProcess CapRefresh CAPSetStopMode CapWeaveSync ICap InitSuperv IPathPos RemoveSuperv SetupSuperv + " Bulls Eye instructions + syn keyword rapidKeyword BECheckTcp BEDebugState BERefPointer BESetupToolJ BETcpExtend BEUpdateTcp + " Force Control instructions + syn keyword rapidKeyword FCAct FCCalib FCCondForce FCCondOrient FCCondPos FCCondReoriSpeed FCCondTCPSpeed FCCondTorque FCCondWaitWhile FCDeact FCPress1LStart FCPressC FCPressEnd FCPressL FCRefCircle FCRefForce FCRefLine FCRefMoveFrame FCRefRot FCRefSpiral FCRefSprForceCart FCRefStart FCRefStop FCRefTorque FCResetDampingTune FCResetLPFilterTune FCSpdChgAct FCSpdChgDeact FCSpdChgTunSet FCSpdChgTunReset FCSetDampingTune FCSetLPFilterTune FCSupvForce FCSupvOrient FCSupvPos FCSupvReoriSpeed FCSupvTCPSpeed FCSupvTorque + " Discrete application platform instructions + syn keyword rapidKeyword DaActProc DaDeactAllProc DaDeactProc DaDefExtSig DaDefProcData DaDefProcSig DaDefUserData DaGetCurrData DaSetCurrData DaSetupAppBehav DaStartManAction DaGetAppDescr DaGetAppIndex DaGetNumOfProcs DaGetNumOfRob DaGetPrcDescr + " Production Manager instructions + syn keyword rapidKeyword ExecEngine PMgrGetNextPart PMgrSetNextPart PMgrRunMenu + " Homepos-Running instructions + syn keyword rapidKeyword HR_Exit HR_ExitCycle HR_SavePos HR_SetMoveToStartPos HR_SetTypeDIndex HR_SetTypeIndex + highlight default link rapidKeyword Keyword + " Exception + syn keyword rapidException Exit ErrRaise ExitCycle Raise RaiseToUser Retry Return TryNext + syn match rapidException /\s\+Stop\s*[\\;]/me=e-1 + highlight default link rapidException Exception + " }}} Statements, keywords et al + + " Special keyword for move command {{{ + " uncategorized yet + syn keyword rapidMovement MovePnP + syn keyword rapidMovement EGMMoveC EGMMoveL EGMRunJoint EGMRunPose EGMStop + syn keyword rapidMovement IndAMove IndCMove IndDMove IndRMove + " common instructions + syn keyword rapidMovement MoveAbsJ MoveC MoveExtJ MoveJ MoveL + syn keyword rapidMovement MoveCAO MoveCDO MoveCGO MoveCSync MoveJAO MoveJDO MoveJGO MoveJSync MoveLAO MoveLDO MoveLGO MoveLSync + syn keyword rapidMovement SearchC SearchExtJ SearchL + syn keyword rapidMovement TriggC TriggJ TriggL TriggJIOs TriggLIOs + " Arc instructions + syn keyword rapidMovement ArcC ArcC1 ArcC2 ArcCEnd ArcC1End ArcC2End ArcCStart ArcC1Start ArcC2Start + syn keyword rapidMovement ArcL ArcL1 ArcL2 ArcLEnd ArcL1End ArcL2End ArcLStart ArcL1Start ArcL2Start ArcMoveExtJ + " Arc Weldguide and MultiPass instructions + syn keyword rapidMovement ArcRepL ArcAdaptLStart ArcAdaptL ArcAdaptC ArcAdaptLEnd ArcAdaptCEnd ArcCalcLStart ArcCalcL ArcCalcC ArcCalcLEnd ArcCalcCEnd ArcAdaptRepL + syn keyword rapidMovement Break + " Continuous Application Platform instructions + syn keyword rapidMovement CapC CapL CapLATrSetup CSSDeactMoveL ContactL + " Dispense instructions + syn keyword rapidMovement DispL DispC + " Nut instructions" + syn keyword rapidMovement NutL NutJ + syn keyword rapidMovement PathRecMoveBwd PathRecMoveFwd + " Paint instructions" + syn keyword rapidMovement PaintL PaintLSig PaintLDO PaintC + syn keyword rapidMovement StartMove StartMoveRetry StepBwdPath StopMove StopMoveReset + " Spot instructions + syn keyword rapidMovement SpotL SpotJ SpotML SpotMJ CalibL CalibJ MeasureWearL + " Homepos-Running instructions + syn keyword rapidMovement SMoveJ SMoveJDO SMoveJGO SMoveJSync SMoveL SMoveLDO SMoveLGO SMoveLSync SSearchL STriggJ STriggL + syn keyword rapidMovement HR_ContMove HR_MoveBack HR_MoveRoutine HR_MoveTo HR_MoveToHome SCSSDeactMoveL + " Discrete application platform instructions + syn keyword rapidMovement DaProcML DaProcMJ + " VW Konzernstandard VWKS_1.07.02 + syn keyword rapidMovement MoveABS MoveABS_FB MoveABS_FRG MoveABS_ROB + syn keyword rapidMovement MoveCIRC MoveCIRC_FB MoveCIRC_FRG MoveCIRC_ROB + syn keyword rapidMovement MoveLIN MoveLIN_FB MoveLIN_FRG MoveLIN_ROB + syn keyword rapidMovement MovePTP MovePTP_FB MovePTP_FRG MovePTP_ROB + syn keyword rapidMovement SearchCIRC SearchCIRC_M + syn keyword rapidMovement SearchLIN SearchLIN_M + syn keyword rapidMovement MoveABS_AO MoveABS_DO MoveABS_GO + syn keyword rapidMovement MoveCIRC_AO MoveCIRC_DO MoveCIRC_GO + syn keyword rapidMovement MoveLIN_AO MoveLIN_DO MoveLIN_GO + syn keyword rapidMovement KW_LoesenLIN + syn keyword rapidMovement SPZ_FraesenLIN SPZ_FraesenPTP SPZ_MessenLIN SPZ_MessenPTP SPZ_LIN SPZ_PTP + syn keyword rapidMovement BZ_LIN BZ_PTP + syn keyword rapidMovement KL_LIN KL_CIRC + syn keyword rapidMovement BP_LIN BP_PTP + syn keyword rapidMovement BU_CIRC BU_LIN + syn keyword rapidMovement CZ_LIN CZ_LIN_V CZ_PTP CZ_PTP_V + syn keyword rapidMovement FD_LIN FD_PTP + syn keyword rapidMovement KG_LIN KG_PTP + syn keyword rapidMovement DA_LIN + syn keyword rapidMovement LK_CIRC LK_LIN + syn keyword rapidMovement LL_CIRC LL_LIN + syn keyword rapidMovement LS_CIRC LS_LIN LS_LIN_F LS_PTP_F + syn keyword rapidMovement LW_CIRC LW_LIN + syn keyword rapidMovement LZ_LIN LZ_PTP LZ_ReinigenLIN LZ_ReinigenPTP + syn keyword rapidMovement MS_CIRC MS_LIN MS_ReinigenLIN MS_SearchLIN MS_PTP_CS MS_LIN_CS GBL_LIN GBL_PTP GBL_RefPointLIN + syn keyword rapidMovement NK_LIN + syn keyword rapidMovement NZ_LIN NZ_LIN_V NZ_PTP NZ_PTP_V + syn keyword rapidMovement PR_LIN PR_PTP + syn keyword rapidMovement RF_CIRC RF_LIN + syn keyword rapidMovement STP_FraesenLIN STP_FraesenPTP STP_LIN STP_PTP + syn keyword rapidMovement SM_LIN SM_PTP + syn keyword rapidMovement BUA_CIRC BUA_LIN BUA_MessenLIN BUA_MessenPTP + syn keyword rapidMovement KE_LIN + if g:rapidGroupName + highlight default link rapidMovement Movement + else + highlight default link rapidMovement Special + endif + " }}} special keyword for move command + + " Any name {{{ + syn match rapidNames /\v[[:upper:][:lower:]](\k|\.)*/ + " }}} Any name + + " Attempt to avoid false highlight of num in case of parameter name: + " TPWrite "goPosNo="\num:=GOutput(goPosNo); + " Must follow after rapidNames in this file + syn match rapidType /\c\v\s*\ze[^ :]/ + + " Structure value {{{ + " rapid structrure values. added to be able to conceal them + syn region rapidConcealableString matchgroup=rapidConcealableString start=/"/ skip=/""/ end=/"/ oneline keepend extend contained contains=rapidStringDoubleQuote,rapidEscapedBackSlash,rapidCharCode,rapidErrorSingleBackslash,rapidErrorStringTooLong,@Spell conceal + highlight default link rapidConcealableString String + syn region rapidStructVal matchgroup=rapidStructDelimiter start=/\[/ end=/\]/ contains=rapidStructVal,rapidBoolean,rapidDec,rapidHex,rapidOct,rapidBin,rapidFloat,rapidConcealableString,rapidDelimiter,rapidConstant,rapidErrNo,rapidIntNo,rapidOperator keepend extend conceal cchar=* + highlight default link rapidStructDelimiter Delimiter + " check edge cases like this one: + " LOCAL CONST listitem lstAuswService{18}:=[["","Service Position"],["","Bremsentest"],["","Referenzfahrt"],["","Manuelles Abfahren"],["","Justagestellung"],["","Transportposition"], + " ["","Spitze-Spitze Greifer 1, [RT]"],["","Spitze-Spitze Greifer 2, [FT]"],["","Spitze-Spitze Pruefspitze"],["","Werkobjekt Ablage"],["","Werkobjekt Modul 1"], + " ["","Werkobjekt Modul 2"],["","TCP von Greifer 1 vermessen, [RT]"],["","TCP von Greifer 2 vermessen, [FT]"],["","TCP von Basisdorn vermessen"], + " ["","Greifer abdocken"],["","Greifer andocken"],["","Kollision Check (Ohne Greifer)"]]; + " }}} Structure value + + " Delimiter {{{ + syn match rapidDelimiter /[\\(){},;|]/ + highlight default link rapidDelimiter Delimiter + " }}} Delimiter + + " BuildInFunction {{{ + " dispense functions + syn keyword rapidBuildInFunction contained GetSignal GetSignalDnum + " Integrated Vision Platform functions + syn keyword rapidBuildInFunction contained CamGetExposure CamGetLoadedJob CamGetName CamNumberOfResults + " Continuous Application Platform functions + syn keyword rapidBuildInFunction contained CapGetFailSigs + syn keyword rapidBuildInFunction contained Abs AbsDnum ACos ACosDnum AInput AOutput ArgName ASin ASinDnum ATan ATanDnum ATan2 ATan2Dnum + syn keyword rapidBuildInFunction contained BitAnd BitAndDnum BitCheck BitCheckDnum BitLSh BitLShDnum BitNeg BitNegDnum BitOr BitOrDnum BitRSh BitRShDnum BitXOr BitXOrDnum ByteToStr + syn keyword rapidBuildInFunction contained CalcJointT CalcRobT CalcRotAxFrameZ CalcRotAxisFrame CDate CJointT ClkRead CorrRead Cos CosDnum CPos CRobT CrossProd CSpeedOverride CTime CTool CWObj + syn keyword rapidBuildInFunction contained DecToHex DefAccFrame DefDFrame DefFrame Dim DInput Distance DnumToNum DnumToStr DotProd DOutput + syn keyword rapidBuildInFunction contained EGMGetState EulerZYX EventType ExecHandler ExecLevel Exp + syn keyword rapidBuildInFunction contained FileSize FileTime FileTimeDnum FSSize + syn keyword rapidBuildInFunction contained GetAxisDistance GetAxisMoveTime GetMaxNumberOfCyclicBool GetMecUnitName GetModalPayLoadMode GetMotorTorque GetNextCyclicBool GetNextMechUnit GetNextSym GetNumberOfCyclicBool GetServiceInfo GetSignalOrigin GetSysInfo GetTaskName GetTime GetTSPStatus GetUASUserName GInput GInputDnum GOutput GOutputDnum + syn keyword rapidBuildInFunction contained HexToDec + syn keyword rapidBuildInFunction contained IndInpos IndSpeed IOUnitState IsBrakeCheckActive IsCyclicBool IsFile IsLeadThrough IsMechUnitActive IsPers IsStopMoveAct IsStopStateEvent IsSyncMoveOn IsSysId IsVar + syn keyword rapidBuildInFunction contained Max MaxExtLinearSpeed MaxExtReorientSpeed MaxRobReorientSpeed MaxRobSpeed Min MirPos ModExist ModTime ModTimeDnum MotionPlannerNo + syn keyword rapidBuildInFunction contained NonMotionMode NOrient NumToDnum NumToStr + syn keyword rapidBuildInFunction contained Offs OpMode OrientZYX ORobT + syn keyword rapidBuildInFunction contained ParIdPosValid ParIdRobValid PathLengthGet PathLevel PathRecValidBwd PathRecValidFwd PFRestart PoseInv PoseMult PoseVect Pow PowDnum PPMovedInManMode Present ProgMemFree PrxGetMaxRecordpos + syn keyword rapidBuildInFunction contained RawBytesLen ReadBin ReadDir ReadMotor ReadNum ReadStr ReadStrBin ReadVar RelTool RemainingRetries RMQGetSlotName RobName RobOS Round RoundDnum RunMode + syn keyword rapidBuildInFunction contained SafetyControllerGetChecksum SafetyControllerGetOpModePinCode SafetyControllerGetSWVersion SafetyControllerGetUserChecksum Sin SinDnum SocketGetStatus SocketPeek Sqrt SqrtDnum STCalcForce STCalcTorque STIsCalib STIsClosed STIsIndGun STIsOpen StrDigCalc StrDigCmp StrFind StrLen StrMap StrMatch StrMemb StrOrder StrPart StrToByte StrToVal + syn keyword rapidBuildInFunction contained Tan TanDnum TaskRunMec TaskRunRob TasksInSync TaskIsActive TaskIsExecuting TestAndSet TestDI TestSignRead TextGet TextTabFreeToUse TextTabGet TriggDataValid Trunc TruncDnum Type + syn keyword rapidBuildInFunction contained UIAlphaEntry UIClientExist UIDnumEntry UIDnumTune UIListView UIMessageBox UINumEntry UINumTune + syn keyword rapidBuildInFunction contained ValidIO ValToStr Vectmagn + " Bulls Eye functions + syn keyword rapidBuildInFunction contained OffsToolXYZ OffsToolPolar + " Force Control functions + syn keyword rapidBuildInFunction contained FCGetForce FCGetProcessData FCIsForceMode FCLoadID + " Discrete application platform functions + syn keyword rapidBuildInFunction contained DaGetFstTimeEvt DaCheckMMSOpt DaGetMP DaGetRobotName DaGetTaskName + " Production Manager functions + syn keyword rapidBuildInFunction contained PMgrAtSafe PMgrAtService PMgrAtState PMgrAtStation PMgrNextStation PMgrTaskNumber PMgrTaskName + " Spot functions + syn keyword rapidBuildInFunction contained SwGetCurrTargetName SwGetCurrSpotName + " Homepos-Running functions + syn keyword rapidBuildInFunction contained HR_RobotInHome HR_GetTypeDIndex HR_GetTypeIndex + " Paint functions + syn keyword rapidBuildInFunction contained IndexLookup IpsCommand IpsGetParam PaintCommand PntQueueExtraGet PntQueueExtraSet PntQueuePeek + if g:rapidGroupName + highlight default link rapidBuildInFunction BuildInFunction + else + highlight default link rapidBuildInFunction Function + endif + " }}} + + " Function {{{ + syn match rapidFunction contains=rapidBuildInFunction /\v\c%(<%(PROC|MODULE)\s+)@1032 chars are not possible in rapid. a234567890123456789012345 + syn match rapidErrorIdentifierNameTooLong /\k\{33,}/ containedin=rapidFunction,rapidNames,rapidLabel + highlight default link rapidErrorIdentifierNameTooLong Error + " + " a == b + 1 + syn match rapidErrorShouldBeColonEqual /\c\v%(^\s*%(%(TASK\s+|LOCAL\s+)?%(VAR|PERS|CONST)\s+\k+\s+)?\k+%(\k|[.{},*/+-])*\s*)@<=\=/ + highlight default link rapidErrorShouldBeColonEqual Error + " + " WaitUntil a==b + syn match rapidErrorShouldBeEqual /\c\v%(^\s*%(Return|WaitUntil|while)>[^!\\]+[^!<>])@<=%(\=|:)\=/ + syn match rapidErrorShouldBeEqual /\c\v%(^\s*%(if|elseif)>[^!\\]+[^!<>])@<=%(\=|:)\=\ze[^!\\]+/ + highlight default link rapidErrorShouldBeEqual Error + " + " WaitUntil a=>b + syn match rapidErrorShoudBeLessOrGreaterEqual /\c\v%(^\s*%(Return|WaitUntil|if|elseif|while)>[^!]+[^!<>])@<=\=[><]/ + highlight default link rapidErrorShoudBeLessOrGreaterEqual Error + " + " WaitUntil a>\s*\