File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ static RE_INTERPOLATION: Lazy<Regex> =
5757static RE_MOVE_OR_FLASH : Lazy < Regex > = lazy_regex ! ( r"X?(-?[0-9]+)?Y?(-?[0-9]+)?D(0)?[2-3]*" ) ;
5858static RE_IMAGE_NAME : Lazy < Regex > = lazy_regex ! ( r"%IN(.*)\*%" ) ;
5959static RE_STEP_REPEAT : Lazy < Regex > =
60- lazy_regex ! ( r"%SRX([0-9]+)Y([0-9]+)I(\d+\.?\d*)J(\d+\.?\d*)\*%" ) ;
60+ lazy_regex ! ( r"%SRX([0-9]+)Y([0-9]+)I(-? \d+\.?\d*)J(-? \d+\.?\d*)\*%" ) ;
6161static RE_MACRO_UNSIGNED_INTEGER : Lazy < Regex > =
6262 lazy_regex ! ( r"^(?:(?P<value>[0-9]+)|(?P<variable>\$[0-9]+)|(?P<expression>.*))$" ) ;
6363static RE_MACRO_BOOLEAN : Lazy < Regex > =
Original file line number Diff line number Diff line change @@ -780,7 +780,7 @@ fn test_load_scaling_zero() {
780780 ) ) ;
781781}
782782
783- /// Test Step and Repeat command (%SR*%)
783+ /// Test Step and Repeat command (%SR*%), including negative I/J offsets.
784784#[ test]
785785fn step_and_repeat ( ) {
786786 // given
@@ -800,7 +800,11 @@ fn step_and_repeat() {
800800 X-1000Y-30000D01*
801801 %SR*%
802802
803- M02*
803+ %SRX12Y6I-3.33J-8.120*%
804+ X0Y0D01*
805+ %SR*%
806+
807+ M02*
804808 " ,
805809 ) ;
806810
@@ -825,6 +829,17 @@ fn step_and_repeat() {
825829 Ok ( Command :: ExtendedCode ( ExtendedCode :: StepAndRepeat (
826830 StepAndRepeat :: Close
827831 ) ) ) ,
832+ Ok ( Command :: ExtendedCode ( ExtendedCode :: StepAndRepeat (
833+ StepAndRepeat :: Open {
834+ repeat_x: 12 ,
835+ repeat_y: 6 ,
836+ distance_x: -3.33 ,
837+ distance_y: -8.12 ,
838+ }
839+ ) ) ) ,
840+ Ok ( Command :: ExtendedCode ( ExtendedCode :: StepAndRepeat (
841+ StepAndRepeat :: Close
842+ ) ) ) ,
828843 ]
829844 )
830845}
You can’t perform that action at this time.
0 commit comments