gcode.min.js 1.1 KB

1234567891011121314151617
  1. /*! `gcode` grammar compiled for Highlight.js 11.7.0 */
  2. var hljsGrammar=(()=>{"use strict";return e=>{
  3. const a=e.inherit(e.C_NUMBER_MODE,{
  4. begin:"([-+]?((\\.\\d+)|(\\d+)(\\.\\d*)?))|"+e.C_NUMBER_RE
  5. }),n=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT(/\(/,/\)/),a,e.inherit(e.APOS_STRING_MODE,{
  6. illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"name",
  7. begin:"([G])([0-9]+\\.?[0-9]?)"},{className:"name",
  8. begin:"([M])([0-9]+\\.?[0-9]?)"},{className:"attr",begin:"(VC|VS|#)",
  9. end:"(\\d+)"},{className:"attr",begin:"(VZOFX|VZOFY|VZOFZ)"},{
  10. className:"built_in",
  11. begin:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",contains:[a],
  12. end:"\\]"},{className:"symbol",variants:[{begin:"N",end:"\\d+",illegal:"\\W"}]}]
  13. ;return{name:"G-code (ISO 6983)",aliases:["nc"],case_insensitive:!0,keywords:{
  14. $pattern:"[A-Z_][A-Z0-9_.]*",
  15. keyword:"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR"
  16. },contains:[{className:"meta",begin:"%"},{className:"meta",begin:"([O])([0-9]+)"
  17. }].concat(n)}}})();export default hljsGrammar;