@@ -120,6 +120,7 @@ where
120
120
// onto the line so we can start working on the next one
121
121
self . last_gcode_type = Some ( word) ;
122
122
if let Some ( completed) = temp_gcode. take ( ) {
123
+ print ! ( "Panic push {:?}" , completed) ;
123
124
if let Err ( e) = line. push_gcode ( completed) {
124
125
self . on_gcode_push_error ( e. 0 ) ;
125
126
}
@@ -130,6 +131,8 @@ where
130
131
word. span ,
131
132
B :: Arguments :: default ( ) ,
132
133
) ) ;
134
+
135
+ println ! ( "temp: {}{}" , mnemonic, word. value) ;
133
136
return ;
134
137
}
135
138
@@ -429,9 +432,8 @@ mod tests {
429
432
430
433
#[ test]
431
434
fn implicit_command_after_newline ( ) {
432
- let src = "G90 \n G01 X1.0 Y2.0\n X3.0 Y4.0" ;
435
+ let src = "G01 X1.0 Y2.0\n X3.0 Y4.0" ;
433
436
let expected = vec ! [
434
- GCode :: new( Mnemonic :: General , 90.0 , Span :: PLACEHOLDER ) ,
435
437
GCode :: new( Mnemonic :: General , 1.0 , Span :: PLACEHOLDER )
436
438
. with_argument( Word :: new( 'X' , 1.0 , Span :: PLACEHOLDER ) )
437
439
. with_argument( Word :: new( 'Y' , 2.0 , Span :: PLACEHOLDER ) ) ,
@@ -444,4 +446,23 @@ mod tests {
444
446
assert_eq ! ( got, expected) ;
445
447
}
446
448
449
+ #[ test]
450
+ #[ ignore]
451
+ // This test focuses on the G90 and M7 on the same line.
452
+ fn two_commands_in_a_row ( ) {
453
+ let src = "G90 M7\n G01 X1.0 Y2.0\n X3.0 Y4.0" ;
454
+ let expected = vec ! [
455
+ GCode :: new( Mnemonic :: General , 90.0 , Span :: PLACEHOLDER ) ,
456
+ GCode :: new( Mnemonic :: Miscellaneous , 7.0 , Span :: PLACEHOLDER ) ,
457
+ GCode :: new( Mnemonic :: General , 1.0 , Span :: PLACEHOLDER )
458
+ . with_argument( Word :: new( 'X' , 1.0 , Span :: PLACEHOLDER ) )
459
+ . with_argument( Word :: new( 'Y' , 2.0 , Span :: PLACEHOLDER ) ) ,
460
+ GCode :: new( Mnemonic :: General , 1.0 , Span :: PLACEHOLDER )
461
+ . with_argument( Word :: new( 'X' , 3.0 , Span :: PLACEHOLDER ) )
462
+ . with_argument( Word :: new( 'Y' , 4.0 , Span :: PLACEHOLDER ) ) ,
463
+ ] ;
464
+
465
+ let got: Vec < _ > = crate :: parse ( src) . collect ( ) ;
466
+ assert_eq ! ( got, expected) ;
467
+ }
447
468
}
0 commit comments