11using System . Diagnostics . CodeAnalysis ;
22using System . Text . RegularExpressions ;
33using HydraScript . Domain . FrontEnd . Lexer . TokenTypes ;
4- using ZLinq ;
54
65namespace HydraScript . Domain . FrontEnd . Lexer ;
76
@@ -24,30 +23,19 @@ public record EndToken() : Token(new EndOfProgramType(), null!, null!)
2423{
2524 public override string ToString ( ) => Type . Tag ;
2625}
27-
26+
2827[ ExcludeFromCodeCoverage ]
2928public record Segment ( Coordinates Start , Coordinates End )
3029{
3130 public override string ToString ( ) => $ "{ Start } -{ End } ";
3231
33- public static Segment operator + ( Segment left , Segment right ) =>
32+ public static Segment operator + ( Segment left , Segment right ) =>
3433 new ( left . Start , right . End ) ;
3534
3635 public static implicit operator string ( Segment segment ) =>
3736 segment . ToString ( ) ;
38-
39- public static implicit operator Segment ( string segment )
40- {
41- var coords = segment . Split ( "-" ) . AsValueEnumerable ( )
42- . Select ( x => x [ 1 ..^ 1 ] . Replace ( " " , string . Empty ) )
43- . Select ( x => x . Split ( ',' ) . AsValueEnumerable ( ) . Select ( int . Parse ) . ToArray ( ) )
44- . ToArray ( ) ;
45- return new Segment (
46- new Coordinates ( coords [ 0 ] [ 0 ] , coords [ 0 ] [ 1 ] ) ,
47- new Coordinates ( coords [ 1 ] [ 0 ] , coords [ 1 ] [ 1 ] ) ) ;
48- }
4937}
50-
38+
5139[ ExcludeFromCodeCoverage ]
5240public record Coordinates ( int Line , int Column )
5341{
0 commit comments