Skip to content

Commit ee7ab56

Browse files
authoredDec 5, 2021
G-Code: Use standard-conforming alias for checksum (#3205)
1 parent adcc878 commit ee7ab56

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
 

‎components/prism-gcode.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Prism.languages.gcode = {
77
'keyword': /\b[GM]\d+(?:\.\d+)?\b/,
88
'property': /\b[A-Z]/,
99
'checksum': {
10-
pattern: /\*\d+/,
11-
alias: 'punctuation'
10+
pattern: /(\*)\d+/,
11+
lookbehind: true,
12+
alias: 'number'
1213
},
1314
// T0:0:0
14-
'punctuation': /:/
15+
'punctuation': /[:*]/
1516
};

‎components/prism-gcode.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/gcode/checksum_feature.test

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ G28*22
44

55
[
66
["keyword", "G28"],
7-
["checksum", "*22"]
7+
["punctuation", "*"],
8+
["checksum", "22"]
89
]
910

1011
----------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.