@@ -560,6 +560,8 @@ private FieldMapping ParseSignalMapping()
560
560
if ( ! m_endOfFile && m_currentChar != '\n ' )
561
561
ParseRelativeTime ( fieldMapping ) ;
562
562
563
+ SkipToNewline ( ) ;
564
+
563
565
if ( ! m_endOfFile && m_currentChar == '@' )
564
566
ParseSampleRate ( fieldMapping ) ;
565
567
@@ -583,6 +585,8 @@ private FieldMapping ParseMappingMapping()
583
585
if ( ! m_endOfFile && m_currentChar != '\n ' )
584
586
ParseRelativeTime ( fieldMapping ) ;
585
587
588
+ SkipToNewline ( ) ;
589
+
586
590
if ( ! m_endOfFile && m_currentChar == '@' )
587
591
ParseSampleRate ( fieldMapping ) ;
588
592
@@ -611,6 +615,8 @@ private ArrayMapping ParseArraySignalMapping()
611
615
else if ( m_currentChar != '\n ' )
612
616
ParseWindowExpression ( arrayMapping ) ;
613
617
618
+ SkipToNewline ( ) ;
619
+
614
620
if ( ! m_endOfFile && m_currentChar == '@' )
615
621
ParseSampleRate ( arrayMapping ) ;
616
622
@@ -639,6 +645,8 @@ private ArrayMapping ParseArrayMappingMapping()
639
645
else if ( m_currentChar != '\n ' )
640
646
ParseWindowExpression ( arrayMapping ) ;
641
647
648
+ SkipToNewline ( ) ;
649
+
642
650
if ( ! m_endOfFile && m_currentChar == '@' )
643
651
ParseSampleRate ( arrayMapping ) ;
644
652
@@ -661,7 +669,6 @@ private void ParseWindowExpression(ArrayMapping arrayMapping)
661
669
ParseTimeSpan ( arrayMapping ) ;
662
670
arrayMapping . RelativeTime = arrayMapping . WindowSize ;
663
671
arrayMapping . RelativeUnit = arrayMapping . WindowUnit ;
664
- SkipToNewline ( ) ;
665
672
}
666
673
else if ( identifier . Equals ( "from" , StringComparison . OrdinalIgnoreCase ) )
667
674
{
@@ -721,8 +728,6 @@ private void ParseRelativeTime(FieldMapping fieldMapping)
721
728
722
729
if ( identifier != "ago" )
723
730
RaiseCompileError ( $ "Unexpected identifier: { identifier } . Expected 'ago' keyword.") ;
724
-
725
- SkipToNewline ( ) ;
726
731
}
727
732
else if ( timeUnit != TimeSpan . Zero )
728
733
{
@@ -759,18 +764,12 @@ private void ParseTimeSpan(ArrayMapping arrayMapping)
759
764
arrayMapping . TimeWindowExpression += " " + identifier ;
760
765
timeUnit = ToTimeUnit ( identifier ) ;
761
766
762
- if ( identifier . Equals ( "point" , StringComparison . OrdinalIgnoreCase ) || identifier . Equals ( "points" , StringComparison . OrdinalIgnoreCase ) )
763
- {
764
- // The "points" keyword is followed
765
- // by an optional sample rate
766
- SkipToNewline ( ) ;
767
- }
768
- else if ( timeUnit != TimeSpan . Zero )
767
+ if ( timeUnit != TimeSpan . Zero )
769
768
{
770
769
// If the identifier was a time unit, set WindowUnit
771
770
arrayMapping . WindowUnit = timeUnit ;
772
771
}
773
- else
772
+ else if ( ! identifier . Equals ( "point" , StringComparison . OrdinalIgnoreCase ) && ! identifier . Equals ( "points" , StringComparison . OrdinalIgnoreCase ) )
774
773
{
775
774
// If the identifier was not the ago keyword, raise an error
776
775
RaiseCompileError ( $ "Unexpected identifier: { identifier } . Expected 'points' keyword or time unit.") ;
0 commit comments