@@ -646,7 +646,7 @@ private bool ProduceStatement()
646646 CloseImplicitFrames ( baseIndex : 0 ) ;
647647 CloseExplicitFrames ( targetPrefixLength : 0 ) ;
648648
649- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
649+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
650650 EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndDocument , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
651651 _state = DocumentState . Ended ;
652652 return true ;
@@ -717,7 +717,7 @@ private bool ProduceArray(ref ContainerFrame frame)
717717 {
718718 Consume ( TokenKind . CloseBracket , DetermineLexerStateAfterContainerClose ( ) ) ;
719719 _containers . RemoveAt ( _containers . Count - 1 ) ;
720- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
720+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
721721 return true ;
722722 }
723723
@@ -743,7 +743,7 @@ private bool ProduceArray(ref ContainerFrame frame)
743743 {
744744 Consume ( TokenKind . CloseBracket , DetermineLexerStateAfterContainerClose ( ) ) ;
745745 _containers . RemoveAt ( _containers . Count - 1 ) ;
746- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
746+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
747747 return true ;
748748 }
749749
@@ -756,7 +756,7 @@ private bool ProduceArray(ref ContainerFrame frame)
756756 {
757757 Consume ( TokenKind . CloseBracket , DetermineLexerStateAfterContainerClose ( ) ) ;
758758 _containers . RemoveAt ( _containers . Count - 1 ) ;
759- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
759+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
760760 return true ;
761761 }
762762
@@ -790,13 +790,13 @@ private bool ProduceInlineTable(ref ContainerFrame frame)
790790 if ( _implicitFrames . Count > frame . InlineImplicitBase )
791791 {
792792 _implicitFrames . RemoveAt ( _implicitFrames . Count - 1 ) ;
793- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
793+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
794794 return true ;
795795 }
796796
797797 Consume ( TokenKind . CloseBrace , DetermineLexerStateAfterContainerClose ( ) ) ;
798798 _containers . RemoveAt ( _containers . Count - 1 ) ;
799- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
799+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
800800 return true ;
801801 }
802802
@@ -922,7 +922,7 @@ private void CloseImplicitFrames(int baseIndex)
922922 for ( var i = _implicitFrames . Count - 1 ; i >= baseIndex ; i -- )
923923 {
924924 _implicitFrames . RemoveAt ( i ) ;
925- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
925+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
926926 }
927927 }
928928
@@ -935,10 +935,10 @@ private void CloseExplicitFrames(int targetPrefixLength)
935935 {
936936 case ExplicitFrameKind . Table :
937937 case ExplicitFrameKind . TableArrayElement :
938- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
938+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
939939 break ;
940940 case ExplicitFrameKind . Array :
941- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
941+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndArray , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
942942 break ;
943943 }
944944
@@ -1249,7 +1249,7 @@ private void EnsureImplicitPrefix(int baseIndex, List<KeySegment> pathSegments,
12491249 for ( var i = currentCount - 1 ; i >= common ; i -- )
12501250 {
12511251 _implicitFrames . RemoveAt ( baseIndex + i ) ;
1252- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
1252+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
12531253 }
12541254
12551255 for ( var i = common ; i < prefixLength ; i ++ )
@@ -1448,20 +1448,20 @@ private void TerminateStream()
14481448 if ( frame . Kind == ContainerKind . InlineTable && _implicitFrames . Count > frame . InlineImplicitBase )
14491449 {
14501450 _implicitFrames . RemoveAt ( _implicitFrames . Count - 1 ) ;
1451- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
1451+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
14521452 continue ;
14531453 }
14541454
14551455 _containers . RemoveAt ( _containers . Count - 1 ) ;
14561456 EnqueueEvent ( frame . Kind == ContainerKind . Array
1457- ? new TomlParseEvent ( TomlParseEventKind . EndArray , span : null , propertyName : null , stringValue : null , data : 0 )
1458- : new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
1457+ ? new TomlParseEvent ( TomlParseEventKind . EndArray , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 )
1458+ : new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
14591459 }
14601460
14611461 CloseImplicitFrames ( baseIndex : 0 ) ;
14621462 CloseExplicitFrames ( targetPrefixLength : 0 ) ;
14631463
1464- EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
1464+ EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndTable , span : CurrentSpan ( ) , propertyName : null , stringValue : null , data : 0 ) ) ;
14651465 EnqueueEvent ( new TomlParseEvent ( TomlParseEventKind . EndDocument , span : null , propertyName : null , stringValue : null , data : 0 ) ) ;
14661466 _state = DocumentState . Ended ;
14671467 }
0 commit comments