Skip to content

Commit

Permalink
Update krl and add rapid syntax files (#12750)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnoP-01 committed Aug 9, 2023
1 parent 6ec7808 commit 92f076e
Show file tree
Hide file tree
Showing 2 changed files with 699 additions and 9 deletions.
21 changes: 12 additions & 9 deletions runtime/syntax/krl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
" Language: Kuka Robot Language
" Maintainer: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
" 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
"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)>/
Expand Down

0 comments on commit 92f076e

Please sign in to comment.