Skip to content

Commit

Permalink
G-Code: Use standard-conforming alias for checksum (#3205)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Dec 5, 2021
1 parent adcc878 commit ee7ab56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions components/prism-gcode.js
Expand Up @@ -7,9 +7,10 @@ Prism.languages.gcode = {
'keyword': /\b[GM]\d+(?:\.\d+)?\b/,
'property': /\b[A-Z]/,
'checksum': {
pattern: /\*\d+/,
alias: 'punctuation'
pattern: /(\*)\d+/,
lookbehind: true,
alias: 'number'
},
// T0:0:0
'punctuation': /:/
'punctuation': /[:*]/
};
2 changes: 1 addition & 1 deletion components/prism-gcode.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/languages/gcode/checksum_feature.test
Expand Up @@ -4,7 +4,8 @@ G28*22

[
["keyword", "G28"],
["checksum", "*22"]
["punctuation", "*"],
["checksum", "22"]
]

----------------------------------------------------
Expand Down

0 comments on commit ee7ab56

Please sign in to comment.