2014-04-16 03:06:20 +00:00
|
|
|
" Vim syntax file
|
|
|
|
" Language: RS274/NGC
|
|
|
|
" Original Creator: Gary Fixler <gfixler.emc@gmail.com>
|
|
|
|
" Modifications: Greg Jurman <jurman.greg@gmail.com>
|
2023-08-04 02:42:04 +00:00
|
|
|
" Jakub B <jakubb.06@proton.me>
|
|
|
|
" Last Change: 2023 Aug 03
|
2014-04-16 03:06:20 +00:00
|
|
|
|
|
|
|
if exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn case ignore
|
|
|
|
|
|
|
|
syntax match ngcConstant /\(\-\=[.0-9]*\)/
|
|
|
|
syntax keyword ngcConditional if else endif
|
2018-11-08 16:07:33 +00:00
|
|
|
syntax keyword ngcRepeat do do1 do2 do3 while endwhile break continue end end1 end2 end3 goto
|
2014-04-16 03:06:20 +00:00
|
|
|
syntax keyword ngcFunction sub endsub call return
|
|
|
|
syntax keyword ngcOperator EQ NE GT GE LT LE ABS ACOS ASIN ATAN COS EXP FIX FUP LN ROUND SIN SQRT TAN MOD AND OR
|
|
|
|
syntax match ngcOperatorPunc "[%\-+*/\[\]]"
|
|
|
|
syntax match ngcFileBlock /^%$/
|
|
|
|
syntax match ngcProgramID /\(O[0-9][0-9]*\|:[0-9][0-9]*\)/
|
2023-08-04 02:42:04 +00:00
|
|
|
|
2014-04-16 03:06:20 +00:00
|
|
|
syntax match ngcIdentifier /#<*[A-Z_0-9]*>*/
|
2023-08-04 02:42:04 +00:00
|
|
|
syntax match ngcIdentifierDefine /#<*[A-Z_0-9]*>* *\ze=/
|
|
|
|
|
2014-04-16 03:06:20 +00:00
|
|
|
syntax match ngcLineNumbers /\(n[0-9][0-9]*\)/
|
|
|
|
syntax keyword ngcTodo TODO FIXME XXX contained
|
2018-11-07 14:48:30 +00:00
|
|
|
syntax match ngcComment /([^)]*)/ contains=ngcTodo
|
2014-04-16 03:06:20 +00:00
|
|
|
syntax match ngcMessage /(\s*MSG\s*,.*)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcLogOpen /(\s*LOGOPEN\s*,.*)/
|
|
|
|
syntax match ngcLogClose /(\s*LOGCLOSE\s*)/
|
|
|
|
syntax match ngcLog /(\s*LOG\s*,.*)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcPrint /(\s*PRINT\s*,.*)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcDebug /(\s*DEBUG\s*,.*)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcGCodes /\s*\(g[0-9][0-9]*\)/
|
|
|
|
syntax match ngcGCodesAlt /\s*\(g[0-9][0-9]*\.[0-9]\)/
|
|
|
|
syntax match ngcMCodes /\s*\(m[0-9][0-9]*\)/
|
|
|
|
syntax match ngcAxes /\s*\([abc][-#]*[0-9.][.]*[0-9]*\)/ contains=ngcIdentifier
|
2023-08-04 02:42:04 +00:00
|
|
|
syntax match ngcXAxisScaled /\([xui] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcYAxisScaled /\([yvj] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcZAxisScaled /\([zwk] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcFeedScaled /\(f *[1-9][0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcXAxis /\s*\([xui] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcYAxis /\s*\([yvj] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcZAxis /\s*\([zwk] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcFeed /\s*\([f] *[#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
|
|
|
|
syntax match ngcSpecials /\s*\(,[c][#-]*[0-9.][.]*[0-9]*\|[relpqs][-#]*[0-9.][.*[0-9]*\)\s*/ contains=ngcIdentifier
|
|
|
|
syntax match ngcTool /[hdt]#*[0-9][0-9]*/ contains=ngcIdentifier
|
2014-04-16 03:06:20 +00:00
|
|
|
syntax match ngcBlockSkip /^\/.*/
|
|
|
|
|
2018-11-07 14:48:30 +00:00
|
|
|
hi link ngcXAxisScaled Error
|
|
|
|
hi link ngcYAxisScaled Error
|
|
|
|
hi link ngcZAxisScaled Error
|
|
|
|
hi link ngcFeedScaled Error
|
2023-08-04 02:42:04 +00:00
|
|
|
hi link ngcFileBlock ngcComment
|
|
|
|
hi link ngcProgramID Function
|
|
|
|
hi link ngcXAxis String
|
|
|
|
hi link ngcYAxis String
|
|
|
|
hi link ngcZAxis String
|
|
|
|
hi link ngcAxes Special
|
|
|
|
hi link ngcSpecials Special
|
|
|
|
hi link ngcBlockSkip GruvboxWhiteBold
|
|
|
|
hi link ngcConstant Constant
|
|
|
|
hi link ngcConditional Conditional
|
|
|
|
hi link ngcRepeat Repeat
|
|
|
|
hi link ngcFunction Function
|
|
|
|
hi link ngcOperator Operator
|
|
|
|
hi link ngcOperatorPunc Operator
|
|
|
|
hi link ngcIdentifier PreProc
|
|
|
|
hi link ngcIdentifierDefine Identifier
|
|
|
|
hi link ngcLabel Label
|
|
|
|
hi link ngcLineNumbers LineNr
|
|
|
|
hi link ngcTodo Todo
|
|
|
|
hi link ngcComment Comment
|
|
|
|
hi link ngcMessage SpecialComment
|
|
|
|
hi link ngcLogOpen SpecialComment
|
|
|
|
hi link ngcLogClose SpecialComment
|
|
|
|
hi link ngcLog SpecialComment
|
|
|
|
hi link ngcPrint SpecialComment
|
|
|
|
hi link ngcDebug Debug
|
|
|
|
hi link ngcGCodes Keyword
|
|
|
|
hi link ngcGCodesAlt Keyword
|
|
|
|
hi link ngcMCodes Keyword
|
|
|
|
hi link ngcAxes SpecialChar
|
|
|
|
hi link ngcFeed Special
|
|
|
|
hi link ngcTool Special
|
2014-04-16 03:06:20 +00:00
|
|
|
|
|
|
|
let b:current_syntax = "ngc"
|