File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ const parseLine = (() => {
101
101
// Parse % commands for bCNC and CNCjs
102
102
// - %wait Wait until the planner queue is empty
103
103
if ( letter === '%' ) {
104
- result . cmds = ( result . cmds || [ ] ) . concat ( ` ${ letter } ${ argument } ` ) ;
104
+ result . cmds = ( result . cmds || [ ] ) . concat ( line . trim ( ) ) ;
105
105
continue ;
106
106
}
107
107
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ describe('gcode-parser', () => {
81
81
expect ( data . cmds ) . to . deep . equal ( [ '%wait' ] ) ;
82
82
}
83
83
84
+ { // %msg Restart spindle
85
+ const data = parseLine ( '%msg Restart spindle' ) ;
86
+ expect ( data ) . to . be . an ( 'object' ) ;
87
+ expect ( data . line ) . to . be . an ( 'string' ) ;
88
+ expect ( data . words ) . to . be . empty ;
89
+ expect ( data . cmds ) . to . deep . equal ( [ '%msg Restart spindle' ] ) ;
90
+ }
91
+
84
92
{ // %zsafe=10
85
93
const data = parseLine ( '%zsafe=10' ) ;
86
94
expect ( data ) . to . be . an ( 'object' ) ;
You can’t perform that action at this time.
0 commit comments