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 = (() => {
101101 // Parse % commands for bCNC and CNCjs
102102 // - %wait Wait until the planner queue is empty
103103 if ( letter === '%' ) {
104- result . cmds = ( result . cmds || [ ] ) . concat ( ` ${ letter } ${ argument } ` ) ;
104+ result . cmds = ( result . cmds || [ ] ) . concat ( line . trim ( ) ) ;
105105 continue ;
106106 }
107107
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ describe('gcode-parser', () => {
8181 expect ( data . cmds ) . to . deep . equal ( [ '%wait' ] ) ;
8282 }
8383
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+
8492 { // %zsafe=10
8593 const data = parseLine ( '%zsafe=10' ) ;
8694 expect ( data ) . to . be . an ( 'object' ) ;
You can’t perform that action at this time.
0 commit comments