diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,6 +1,6 @@
 import Distribution.Simple
 import System.Cmd
-main = defaultMainWithHooks $ defaultUserHooks { runTests = run, preClean = clean }
+main = defaultMainWithHooks $ simpleUserHooks { runTests = run, preClean = clean }
     where run _ _ _ _ = do
             system "dist/build/yaml2yeast-test/yaml2yeast-test tests"
             return ()
diff --git a/Text/Yaml/Reference.bnf b/Text/Yaml/Reference.bnf
--- a/Text/Yaml/Reference.bnf
+++ b/Text/Yaml/Reference.bnf
@@ -1,4 +1,4 @@
--- ** Spec productions!
+-- ** Spec productions
 --
 -- These are copied directly from the spec, with the sprinkling of
 -- additional token and decision point directives.
@@ -6,14 +6,14 @@
 -- 5.1 Character Set
 
 c_printable {- 1 -} = '\x9' / '\xA' / '\xD' / ('\x20', '\x7E')
-                      / '\x85' / ('\xA0', '\xD7FF') / ('\xE000', '\xFFFD')
-                      / ('\x10000', '\x10FFFF')
+                    / '\x85' / ('\xA0', '\xD7FF') / ('\xE000', '\xFFFD')
+                    / ('\x10000', '\x10FFFF')
 
-c_json {- 2 -} = '\x9' / '\xA' / '\xD' / ('\x20', '\x10ffff')
+nb_json {- 2 -} = '\x9' / ('\x20', '\x10FFFF')
 
 -- 5.2 Character Encodings
 
-c_byte_order_mark {- 3 -} = '\xFEFF' & detect_utf_encoding
+c_byte_order_mark {- 3 -} = bom '\xFEFF'
 
 -- 5.3 Indicator Characters
 
@@ -49,156 +49,140 @@
                      / c_literal / c_folded / c_single_quote / c_double_quote
                      / c_directive / c_reserved
 
-c_flow_indicator {- 23 -} = c_collect_entry / c_sequence_start / c_sequence_end / c_mapping_start  / c_mapping_end
+c_flow_indicator {- 23 -} = c_collect_entry / c_sequence_start / c_sequence_end / c_mapping_start / c_mapping_end
 
 -- 5.4 Line Break Characters
 
-b_line_feed           {- 24 -} = '\xA'
-b_carriage_return     {- 25 -} = '\xD'
-
-b_char {- 26 -} = b_line_feed / b_carriage_return
-
-nb_char {- 27 -} = c_printable - b_char
+b_line_feed       {- 24 -} = '\xA'
+b_carriage_return {- 25 -} = '\xD'
+b_char            {- 26 -} = b_line_feed / b_carriage_return
 
-nb_json {- 28 -} = c_json - b_char
+nb_char {- 27 -} = c_printable - b_char - c_byte_order_mark
 
-b_break {- 29 -} = ( b_carriage_return & b_line_feed
+b_break {- 28 -} = ( b_carriage_return & b_line_feed
                    / b_carriage_return
                    / b_line_feed )
                  & nextLine
 
-b_as_line_feed {- 30 -} = token LineFeed b_break
+b_as_line_feed {- 29 -} = token LineFeed b_break
 
-b_non_content {- 31 -} = token Continue b_break
+b_non_content {- 30 -} = token Break b_break
 
 -- 5.5 White Space Characters
 
-s_space {- 32 -} = '\x20'
-s_tab   {- 33 -} = '\x9'
-s_white {- 34 -} = s_space / s_tab
+s_space {- 31 -} = '\x20'
+s_tab   {- 32 -} = '\x9'
+s_white {- 33 -} = s_space / s_tab
 
-ns_char {- 35 -} = nb_char - s_white
+ns_char {- 34 -} = nb_char - s_white
 
 -- 5.6 Miscellaneous Characters
 
-ns_dec_digit {- 36 -} = ('\x30', '\x39')
+ns_dec_digit {- 35 -} = ('\x30', '\x39')
 
-ns_hex_digit {- 37 -} = ns_dec_digit
+ns_hex_digit {- 36 -} = ns_dec_digit
                       / ('\x41', '\x46') / ('\x61', '\x66')
 
-ns_ascii_letter {- 38 -} = ('\x41', '\x5A') / ('\x61', '\x7A')
+ns_ascii_letter {- 37 -} = ('\x41', '\x5A') / ('\x61', '\x7A')
 
-ns_word_char {- 39 -} = ns_dec_digit / ns_ascii_letter / '-'
+ns_word_char {- 38 -} = ns_dec_digit / ns_ascii_letter / '-'
 
-ns_uri_char {- 40 -} = "escape"
-                     ^ ( ns_word_char
-                       / '%' ! "escape" & ns_hex_digit & ns_hex_digit
+ns_uri_char {- 39 -} = "escape"
+                     ^ ( '%' ! "escape" & ns_hex_digit & ns_hex_digit / ns_word_char / '#'
                        / ';' / '/' / '?' / ':' / '@' / '&'  / '=' / '+' / '$' / ','
                        / '_' / '.' / '!' / '~' / '*' / '\'' / '(' / ')' / '[' / ']' )
 
-ns_tag_char {- 41 -} = ns_uri_char - c_tag - c_flow_indicator
+ns_tag_char {- 40 -} = ns_uri_char - c_tag - c_flow_indicator
 
 -- 5.7 Escaped Characters
 
-c_escape {- 42 -} = indicator '\\'
+c_escape {- 41 -} = indicator '\\'
 
-ns_esc_null                {- 43 -} = meta '0'
-ns_esc_bell                {- 44 -} = meta 'a'
-ns_esc_backspace           {- 45 -} = meta 'b'
-ns_esc_horizontal_tab      {- 46 -} = meta ( 't' / '\x9' )
-ns_esc_line_feed           {- 47 -} = meta 'n'
-ns_esc_vertical_tab        {- 48 -} = meta 'v'
-ns_esc_form_feed           {- 49 -} = meta 'f'
-ns_esc_carriage_return     {- 50 -} = meta 'r'
-ns_esc_escape              {- 51 -} = meta 'e'
-ns_esc_space               {- 52 -} = meta '\x20'
-ns_esc_double_quote        {- 53 -} = meta '"'
-ns_esc_slash               {- 54 -} = meta '/'
-ns_esc_backslash           {- 55 -} = meta '\\'
-ns_esc_next_line           {- 56 -} = meta 'N'
-ns_esc_non_breaking_space  {- 57 -} = meta '_'
-ns_esc_line_separator      {- 58 -} = meta 'L'
-ns_esc_paragraph_separator {- 59 -} = meta 'P'
-ns_esc_8_bit               {- 60 -} = indicator 'x' ! "escaped" & meta ( ns_hex_digit % 2 )
-ns_esc_16_bit              {- 61 -} = indicator 'u' ! "escaped" & meta ( ns_hex_digit % 4 )
-ns_esc_32_bit              {- 62 -} = indicator 'U' ! "escaped" & meta ( ns_hex_digit % 8 )
+ns_esc_null                {- 42 -} = meta '0'
+ns_esc_bell                {- 43 -} = meta 'a'
+ns_esc_backspace           {- 44 -} = meta 'b'
+ns_esc_horizontal_tab      {- 45 -} = meta ( 't' / '\x9' )
+ns_esc_line_feed           {- 46 -} = meta 'n'
+ns_esc_vertical_tab        {- 47 -} = meta 'v'
+ns_esc_form_feed           {- 48 -} = meta 'f'
+ns_esc_carriage_return     {- 49 -} = meta 'r'
+ns_esc_escape              {- 50 -} = meta 'e'
+ns_esc_space               {- 51 -} = meta '\x20'
+ns_esc_double_quote        {- 52 -} = meta '"'
+ns_esc_slash               {- 53 -} = meta '/'
+ns_esc_backslash           {- 54 -} = meta '\\'
+ns_esc_next_line           {- 55 -} = meta 'N'
+ns_esc_non_breaking_space  {- 56 -} = meta '_'
+ns_esc_line_separator      {- 57 -} = meta 'L'
+ns_esc_paragraph_separator {- 58 -} = meta 'P'
+ns_esc_8_bit               {- 59 -} = indicator 'x' ! "escaped" & meta ( ns_hex_digit % 2 )
+ns_esc_16_bit              {- 60 -} = indicator 'u' ! "escaped" & meta ( ns_hex_digit % 4 )
+ns_esc_32_bit              {- 61 -} = indicator 'U' ! "escaped" & meta ( ns_hex_digit % 8 )
 
-c_ns_esc_char {- 63 -} = nest BeginEscape
-              & c_escape ! "escape"
-              & "escaped"
-              ^ ( ns_esc_null
-                / ns_esc_bell
-                / ns_esc_backspace
-                / ns_esc_horizontal_tab
-                / ns_esc_line_feed
-                / ns_esc_vertical_tab
-                / ns_esc_form_feed
-                / ns_esc_carriage_return
-                / ns_esc_escape
-                / ns_esc_space
-                / ns_esc_double_quote
-                / ns_esc_slash
-                / ns_esc_backslash
-                / ns_esc_next_line
-                / ns_esc_non_breaking_space
-                / ns_esc_line_separator
-                / ns_esc_paragraph_separator
-                / ns_esc_8_bit
-                / ns_esc_16_bit
-                / ns_esc_32_bit )
-              & nest EndEscape
+c_ns_esc_char {- 62 -} = wrapTokens BeginEscape EndEscape
+                       $ c_escape ! "escape"
+                       & "escaped"
+                       ^ ( ns_esc_null / ns_esc_bell / ns_esc_backspace
+                         / ns_esc_horizontal_tab / ns_esc_line_feed
+                         / ns_esc_vertical_tab / ns_esc_form_feed
+                         / ns_esc_carriage_return / ns_esc_escape / ns_esc_space
+                         / ns_esc_double_quote / ns_esc_slash / ns_esc_backslash
+                         / ns_esc_next_line / ns_esc_non_breaking_space
+                         / ns_esc_line_separator / ns_esc_paragraph_separator
+                         / ns_esc_8_bit / ns_esc_16_bit / ns_esc_32_bit )
 
 -- 6.1 Indentation Spaces
 
-s_indent    n {- 64 -} = token Indent ( s_space % n )
+s_indent    n {- 63 -} = token Indent ( s_space % n )
 
-s_indent_lt n {- 65 -} = token Indent ( s_space <% n )
-s_indent_le n {- 66 -} = token Indent ( s_space <% (n .+ 1) )
+s_indent_lt n {- 64 -} = token Indent ( s_space <% n )
+s_indent_le n {- 65 -} = token Indent ( s_space <% (n .+ 1) )
 
 -- 6.2 Separation Spaces
 
-s_separate_in_line {- 67 -} = token White ( s_white +) / sol
+s_separate_in_line {- 66 -} = token White ( s_white +) / sol
 
 -- 6.3 Line Prefixes
 
-s_line_prefix n c {- 68 -} = case c of
+s_line_prefix n c {- 67 -} = case c of
                                   BlockOut -> s_block_line_prefix n
                                   BlockIn  -> s_block_line_prefix n
                                   FlowOut  -> s_flow_line_prefix n
                                   FlowIn   -> s_flow_line_prefix n
 
-s_block_line_prefix n {- 69 -} = s_indent n
-s_flow_line_prefix  n {- 70 -} = s_indent n & ( s_separate_in_line ?)
+s_block_line_prefix n {- 68 -} = s_indent n
+s_flow_line_prefix  n {- 69 -} = s_indent n & ( s_separate_in_line ?)
 
 -- 6.4 Empty Lines
 
-l_empty n c {- 71 -} = ( s_line_prefix n c / s_indent_lt n )
+l_empty n c {- 70 -} = ( s_line_prefix n c / s_indent_lt n )
                      & b_as_line_feed
 
 -- 6.5 Line Folding
 
-b_l_trimmed  n c {- 72 -} = b_non_content & ( l_empty n c +)
+b_l_trimmed  n c {- 71 -} = b_non_content & ( l_empty n c +)
 
-b_as_space {- 73 -} = token LineFold b_break
+b_as_space {- 72 -} = token LineFold b_break
 
-b_l_folded n c  {- 74 -} = b_l_trimmed n c / b_as_space
+b_l_folded n c  {- 73 -} = b_l_trimmed n c / b_as_space
 
-s_s_flow_folded n {- 75 -} = ( s_separate_in_line ?) & b_l_folded n FlowIn
-                           & s_line_prefix n FlowIn
+s_flow_folded n {- 74 -} = ( s_separate_in_line ?) & b_l_folded n FlowIn
+                         & s_flow_line_prefix n
 
 -- 6.6 Comments
 
-c_nb_comment_text {- 76 -} = nest BeginComment
-                           & c_comment & meta ( nb_char *)
-                           & nest EndComment
+c_nb_comment_text {- 75 -} = wrapTokens BeginComment EndComment
+                           $ c_comment & meta ( nb_char *)
 
+b_comment {- 76 -} = b_non_content / eof
+
 s_b_comment {- 77 -} = ( s_separate_in_line & ( c_nb_comment_text ?) ?)
-                     & b_non_content
+                     & b_comment
 
-l_comment {- 78 -} = s_separate_in_line & ( c_nb_comment_text ?) & b_non_content
+l_comment {- 78 -} = s_separate_in_line & ( c_nb_comment_text ?) & b_comment
 
 s_l_comments {- 79 -} = ( s_b_comment / sol )
-                      & ( l_comment *)
+                      & ( nonEmpty l_comment *)
 
 -- 6.7 Separation Lines
 
@@ -207,19 +191,19 @@
                                     BlockIn  -> s_separate_lines n
                                     FlowOut  -> s_separate_lines n
                                     FlowIn   -> s_separate_lines n
+                                    BlockKey -> s_separate_in_line
                                     FlowKey  -> s_separate_in_line
 s_separate_lines n {- 81 -} = s_l_comments & s_flow_line_prefix n
                             / s_separate_in_line
 
 -- 6.8 Directives
 
-l_directive {- 82 -} = nest BeginDirective
-                     & c_directive
-                     & "directive"
-                     ^ ( ns_yaml_directive
-                       / ns_tag_directive
-                       / ns_reserved_directive )
-                     & nest EndDirective
+l_directive {- 82 -} = ( wrapTokens BeginDirective EndDirective
+                       $ c_directive ! "doc"
+                       & "directive"
+                       ^ ( ns_yaml_directive
+                         / ns_tag_directive
+                         / ns_reserved_directive ) )
                      & s_l_comments
 
 ns_reserved_directive  {- 83 -} = ns_directive_name
@@ -237,7 +221,7 @@
 
 ns_tag_directive {- 88 -} = meta [ 'T', 'A', 'G' ] ! "directive"
                           & s_separate_in_line & c_tag_handle
-                           & s_separate_in_line & ns_tag_prefix
+                          & s_separate_in_line & ns_tag_prefix
 
 -- 6.8.2.1 Tag Handles
 
@@ -245,23 +229,19 @@
                       / c_secondary_tag_handle
                       / c_primary_tag_handle
 
-c_primary_tag_handle   {- 90 -} = nest BeginHandle
-                                & c_tag
-                                & nest EndHandle
+c_primary_tag_handle   {- 90 -} = wrapTokens BeginHandle EndHandle
+                                $ c_tag
 
-c_secondary_tag_handle {- 91 -} = nest BeginHandle
-                                & c_tag & c_tag
-                                & nest EndHandle
+c_secondary_tag_handle {- 91 -} = wrapTokens BeginHandle EndHandle
+                                $ c_tag & c_tag
 
-c_named_tag_handle     {- 92 -} = nest BeginHandle
-                                 & c_tag & meta ( ns_word_char +) & c_tag
-                                 & nest EndHandle
+c_named_tag_handle     {- 92 -} = wrapTokens BeginHandle EndHandle
+                                $ c_tag & meta ( ns_word_char +) & c_tag
 
 -- 6.8.2.2 Tag Prefixes
 
-ns_tag_prefix {- 93 -} = nest BeginTag
-                       & ( c_ns_local_tag_prefix / ns_global_tag_prefix )
-                       & nest EndTag
+ns_tag_prefix {- 93 -} = wrapTokens BeginTag EndTag
+                       $ ( c_ns_local_tag_prefix / ns_global_tag_prefix )
 
 c_ns_local_tag_prefix {- 94 -} = c_tag & meta ( ns_uri_char *)
 
@@ -269,102 +249,93 @@
 
 -- 6.9 Node Properties
 
-c_ns_properties n c {- 96 -} = nest BeginProperties
-                              & ( ( c_ns_tag_property
-                                  & ( s_separate n c & c_ns_anchor_property ?) )
-                                / ( c_ns_anchor_property
-                                  & ( s_separate n c & c_ns_tag_property ?) ) )
-                              & nest EndProperties
+c_ns_properties n c {- 96 -} = wrapTokens BeginProperties EndProperties
+                             $ ( c_ns_tag_property
+                               & ( s_separate n c & c_ns_anchor_property ?) )
+                             / ( c_ns_anchor_property
+                               & ( s_separate n c & c_ns_tag_property ?) )
 
 -- 6.9.1 Node Tags
 
-c_ns_tag_property {- 97 -} = nest BeginTag
-                            & ( c_verbatim_tag
-                              / c_ns_shorthand_tag
-                              / c_non_specific_tag )
-                            & nest EndTag
+c_ns_tag_property {- 97 -} = wrapTokens BeginTag EndTag
+                           $ c_verbatim_tag
+                           / c_ns_shorthand_tag
+                           / c_non_specific_tag
 
 c_verbatim_tag     {- 98 -} = c_tag & indicator '<' & meta ( ns_uri_char +) & indicator '>'
 
-c_ns_shorthand_tag {- 99 -} = c_named_tag_handle & meta ( ns_tag_char +)
-                             / c_secondary_tag_handle & meta ( ns_tag_char +)
-                             / c_primary_tag_handle & meta ( ns_tag_char +)
+c_ns_shorthand_tag {- 99 -} = c_tag_handle & meta ( ns_tag_char +)
 
 c_non_specific_tag {- 100 -} = c_tag
 
 -- 6.9.2 Node Anchors
 
-c_ns_anchor_property {- 101 -} = nest BeginAnchor
-                               & c_anchor & ns_anchor_name
-                               & nest EndAnchor
+c_ns_anchor_property {- 101 -} = wrapTokens BeginAnchor EndAnchor
+                               $ c_anchor & ns_anchor_name
 
 ns_anchor_char {- 102 -} = ns_char - c_flow_indicator
 ns_anchor_name {- 103 -} = meta ( ns_anchor_char +)
 
 -- 7.1 Alias Nodes
 
-c_ns_alias_node {- 104 -} = nest BeginAlias
-                          & c_alias ! "node" & ns_anchor_name
-                          & nest EndAlias
+c_ns_alias_node {- 104 -} = wrapTokens BeginAlias EndAlias
+                          $ c_alias ! "node" & ns_anchor_name
 
 -- 7.2 Empty Nodes
 
-e_scalar {- 105 -} = nest BeginScalar & nest EndScalar
+e_scalar {- 105 -} = wrapTokens BeginScalar EndScalar empty
 
-e_node {- 106 -} = nest BeginNode & e_scalar & nest EndNode
+e_node {- 106 -} = wrapTokens BeginNode EndNode e_scalar
 
 -- 7.3.1 Double Quoted Style
 
-nb_double_char {- 107 -} = "escape" ^ ( nb_json - c_escape - c_double_quote / c_ns_esc_char )
+nb_double_char {- 107 -} = "escape" ^ ( c_ns_esc_char / ( nb_json - c_escape - c_double_quote ) )
 ns_double_char {- 108 -} = nb_double_char - s_white
 
-c_double_quoted n c {- 109 -} = nest BeginScalar
-                              & c_double_quote ! "node" & text ( nb_double_text n c ) & c_double_quote
-                              & nest EndScalar
+c_double_quoted n c {- 109 -} = wrapTokens BeginScalar EndScalar
+                              $ c_double_quote ! "node" & text ( nb_double_text n c ) & c_double_quote
 nb_double_text n c  {- 110 -} = case c of
-                                     FlowOut -> nb_double_multi_line n
-                                     FlowIn  -> nb_double_multi_line n
-                                     FlowKey -> nb_double_one_line
+                                     FlowOut  -> nb_double_multi_line n
+                                     FlowIn   -> nb_double_multi_line n
+                                     BlockKey -> nb_double_one_line
+                                     FlowKey  -> nb_double_one_line
 nb_double_one_line  {- 111 -} = ( nb_double_char *)
 
-s_s_double_escaped n {- 112 -} = ( s_white *)
-                               & nest BeginEscape
-                               & c_escape ! "escape" & b_non_content
-                               & nest EndEscape
-                               & ( l_empty n FlowIn *)
-                               & s_line_prefix n FlowIn
-s_s_double_break n   {- 113 -} = "escape" ^ ( s_s_double_escaped n / s_s_flow_folded n )
+s_double_escaped n {- 112 -} = ( s_white *)
+                             & wrapTokens BeginEscape EndEscape ( c_escape ! "escape" & b_non_content )
+                             & ( l_empty n FlowIn *)
+                             & s_flow_line_prefix n
+s_double_break n   {- 113 -} = "escape" ^ ( s_double_escaped n / s_flow_folded n )
 
 nb_ns_double_in_line    {- 114 -} = ( ( s_white *) & ns_double_char *)
-s_ns_double_next_line n {- 115 -} = s_s_double_break n
-                                  & ns_double_char & nb_ns_double_in_line
+s_double_next_line n {- 115 -} = s_double_break n
+                               & ( ns_double_char & nb_ns_double_in_line
+                                 & ( s_double_next_line n / ( s_white *) ) ?)
 nb_double_multi_line n  {- 116 -} = nb_ns_double_in_line
-                                  & ( s_ns_double_next_line n *)
-                                  & ( s_white *)
+                                  & ( s_double_next_line n / ( s_white *) )
 
 -- 7.3.2 Single Quoted Style
 
-c_quoted_quote {- 117 -} = nest BeginEscape
-                         & c_single_quote ! "escape" & meta '\''
-                         & nest EndEscape
-nb_single_char {- 118 -} = "escape" ^ ( nb_json - c_single_quote / c_quoted_quote )
+c_quoted_quote {- 117 -} = wrapTokens BeginEscape EndEscape
+                         $ c_single_quote ! "escape" & meta '\''
+nb_single_char {- 118 -} = "escape" ^ ( c_quoted_quote / ( nb_json - c_single_quote ) )
 ns_single_char {- 119 -} = nb_single_char - s_white
 
-c_single_quoted  n c {- 120 -}= nest BeginScalar
-                              & c_single_quote & text ( nb_single_text n c ) & c_single_quote
-                              & nest EndScalar
+c_single_quoted  n c {- 120 -} = wrapTokens BeginScalar EndScalar
+                               $ c_single_quote ! "node" & text ( nb_single_text n c ) & c_single_quote
 nb_single_text n c {- 121 -} = case c of
-                                    FlowOut -> nb_single_multi_line n
-                                    FlowIn  -> nb_single_multi_line n
-                                    FlowKey -> nb_single_one_line
+                                    FlowOut  -> nb_single_multi_line n
+                                    FlowIn   -> nb_single_multi_line n
+                                    BlockKey -> nb_single_one_line
+                                    FlowKey  -> nb_single_one_line
 nb_single_one_line {- 122 -} = ( nb_single_char *)
 
 nb_ns_single_in_line    {- 123 -} = ( ( s_white *) & ns_single_char *)
-s_ns_single_next_line n {- 124 -} = s_s_flow_folded n
-                                  & ns_single_char & nb_ns_single_in_line
-nb_single_multi_line n  {- 125 -} = ( nb_ns_single_in_line *)
-                                  & ( s_ns_single_next_line n *)
-                                  & ( s_white *)
+s_single_next_line n {- 124 -} = s_flow_folded n
+                                 & ( ns_single_char & nb_ns_single_in_line
+                                    & ( s_single_next_line n / ( s_white *) ) ?)
+nb_single_multi_line n  {- 125 -} = nb_ns_single_in_line
+                                  & ( s_single_next_line n / ( s_white *) )
 
 -- 7.3.3 Plain Style
 
@@ -372,142 +343,135 @@
                             / ( ':' / '?' / '-' ) & ( ns_char >?)
 
 ns_plain_safe c   {- 127 -} = case c of
-                                   FlowOut -> ns_plain_safe_out
-                                   FlowIn  -> ns_plain_safe_in
-                                   FlowKey -> ns_plain_safe_in
+                                   FlowOut  -> ns_plain_safe_out
+                                   FlowIn   -> ns_plain_safe_in
+                                   BlockKey -> ns_plain_safe_out
+                                   FlowKey  -> ns_plain_safe_in
 ns_plain_safe_out {- 128 -} = ns_char - c_mapping_value - c_comment
 ns_plain_safe_in  {- 129 -} = ns_plain_safe_out - c_flow_indicator
 ns_plain_char c   {- 130 -} = ns_plain_safe c
                             / ( ns_char <?) & '#'
                             / ':' & ( ns_char >?)
-nb_plain_char c   {- 131 -} = s_white / ns_plain_char c
 
-ns_plain n c          {- 132 -} = nest BeginScalar
-                                & text (case c of
-                                              FlowOut -> ns_plain_multi_line n c
-                                              FlowIn  -> ns_plain_multi_line n c
-                                              FlowKey -> ns_plain_one_line c)
-                                & nest EndScalar
-nb_ns_plain_in_line c {- 133 -} = ( ( s_white *) & ns_plain_char c *)
-ns_plain_one_line c   {- 134 -} = ns_plain_first c ! "node" & nb_ns_plain_in_line c
+ns_plain n c          {- 131 -} = wrapTokens BeginScalar EndScalar
+                                $ text (case c of
+                                             FlowOut  -> ns_plain_multi_line n c
+                                             FlowIn   -> ns_plain_multi_line n c
+                                             BlockKey -> ns_plain_one_line c
+                                             FlowKey  -> ns_plain_one_line c)
+nb_ns_plain_in_line c {- 132 -} = ( ( s_white *) & ns_plain_char c *)
+ns_plain_one_line c   {- 133 -} = ns_plain_first c ! "node" & nb_ns_plain_in_line c
 
-s_ns_plain_next_line n c {- 135 -} = s_s_flow_folded n
+s_ns_plain_next_line n c {- 134 -} = s_flow_folded n
                                    & ns_plain_char c & nb_ns_plain_in_line c
-ns_plain_multi_line n c  {- 136 -} = ns_plain_one_line c & ( s_ns_plain_next_line n c *)
+ns_plain_multi_line n c  {- 135 -} = ns_plain_one_line c
+                                   & ( s_ns_plain_next_line n c *)
 
 -- 7.4 Flow Collection Styles
 
-in_flow c {- 137 -} = case c of
-                           FlowOut -> FlowIn
-                           FlowIn  -> FlowIn
-                           FlowKey -> FlowKey
+in_flow c {- 136 -} = case c of
+                           FlowOut  -> FlowIn
+                           FlowIn   -> FlowIn
+                           BlockKey -> FlowKey
+                           FlowKey  -> FlowKey
 
 -- 7.4.1 Flow Sequences
 
-c_flow_sequence n c {- 138 -} = nest BeginSequence
-                              & c_sequence_start ! "node" & ( s_separate n c ?)
+c_flow_sequence n c {- 137 -} = wrapTokens BeginSequence EndSequence
+                              $ c_sequence_start ! "node" & ( s_separate n c ?)
                               & ( ns_s_flow_seq_entries n (in_flow c) ?) & c_sequence_end
-                              & nest EndSequence
 
-ns_s_flow_seq_entries n c {- 139 -} = ns_flow_seq_entry n c & ( s_separate n c ?)
+ns_s_flow_seq_entries n c {- 138 -} = ns_flow_seq_entry n c & ( s_separate n c ?)
                                     & ( c_collect_entry & ( s_separate n c ?)
                                       & ( ns_s_flow_seq_entries n c ?) ?)
 
-ns_flow_seq_entry n c {- 140 -} = "pair" ^ ( ns_flow_pair n c / "node" ^ ns_flow_node n c )
+ns_flow_seq_entry n c {- 139 -} = "pair" ^ ( ns_flow_pair n c / "node" ^ ns_flow_node n c )
 
 -- 7.4.2 Flow Mappings
 
-c_flow_mapping n c        {- 141 -} = nest BeginMapping
-                                    & c_mapping_start ! "node" & ( s_separate n c ?)
+c_flow_mapping n c        {- 140 -} = wrapTokens BeginMapping EndMapping
+                                    $ c_mapping_start ! "node" & ( s_separate n c ?)
                                     & ( ns_s_flow_map_entries n (in_flow c) ?) & c_mapping_end
-                                    & nest EndMapping
-ns_s_flow_map_entries n c {- 142 -} = ns_flow_map_entry n c & ( s_separate n c ?)
+ns_s_flow_map_entries n c {- 141 -} = ns_flow_map_entry n c & ( s_separate n c ?)
                                     & ( c_collect_entry & ( s_separate n c ?)
                                       & ( ns_s_flow_map_entries n c ?) ?)
 
-ns_flow_map_entry n c {- 143 -}          = nest BeginPair
-                                         & "key" ^ ( c_mapping_key ! "key" & s_separate n c
-                                                   & ns_flow_map_explicit_entry n c
-                                         / ns_flow_map_implicit_entry n c )
-                                         & nest EndPair
-ns_flow_map_explicit_entry n c {- 144 -} = ns_flow_map_implicit_entry n c
-                                         / e_node
-                                         & e_node
+ns_flow_map_entry n c {- 142 -}          = wrapTokens BeginPair EndPair
+                                         $ "key" ^ ( ( c_mapping_key ! "key" & s_separate n c
+                                                     & ns_flow_map_explicit_entry n c )
+                                                   / ns_flow_map_implicit_entry n c )
+ns_flow_map_explicit_entry n c {- 143 -} = ns_flow_map_implicit_entry n c
+                                         / ( e_node
+                                           & e_node )
 
-ns_flow_map_implicit_entry n c {- 145 -}    = "pair"
+ns_flow_map_implicit_entry n c {- 144 -}    = "pair"
                                             ^ ( ns_flow_map_yaml_key_entry n c
                                               / c_ns_flow_map_empty_key_entry n c
                                               / c_ns_flow_map_json_key_entry n c )
-ns_flow_map_yaml_key_entry n c {- 146 -}    = ( "node" ^ ns_flow_yaml_node n c ) ! "pair"
-                                            & (   ( s_separate n c ?)
-                                                & c_ns_flow_map_separate_value n c
+ns_flow_map_yaml_key_entry n c {- 145 -}    = ( "node" ^ ns_flow_yaml_node n c ) ! "pair"
+                                            & ( ( ( s_separate n c ?)
+                                                & c_ns_flow_map_separate_value n c )
                                               / e_node )
-c_ns_flow_map_empty_key_entry n c {- 147 -} = e_node
+c_ns_flow_map_empty_key_entry n c {- 146 -} = e_node
                                             & c_ns_flow_map_separate_value n c
-c_ns_flow_map_separate_value n c {- 148 -}  = c_mapping_value ! "pair"
-                                            & ( s_separate n c & ns_flow_node n c
+
+c_ns_flow_map_separate_value n c {- 147 -}  = c_mapping_value & ( ns_char >!) ! "pair"
+                                            & ( ( s_separate n c & ns_flow_node n c )
                                               / e_node )
 
-c_ns_flow_map_json_key_entry n c {- 149 -} = ( "node" ^ c_flow_json_node n c ) ! "pair"
-                                           & (   ( s_separate n c ?)
-                                               & c_ns_flow_map_adjacent_value n c
+c_ns_flow_map_json_key_entry n c {- 148 -} = ( "node" ^ c_flow_json_node n c ) ! "pair"
+                                           & ( ( ( s_separate n c ?)
+                                               & c_ns_flow_map_adjacent_value n c )
                                              / e_node )
-c_ns_flow_map_adjacent_value n c {- 150 -} = c_mapping_value ! "pair" & (   ( s_separate n c ?)
-                                                                          & ns_flow_node n c
-                                                                        / e_node )
+c_ns_flow_map_adjacent_value n c {- 149 -} = c_mapping_value ! "pair"
+                                           & ( ( ( s_separate n c ?)
+                                               & ns_flow_node n c )
+                                               / e_node )
 
-ns_flow_pair n c {- 151 -} = nest BeginMapping
-                           & nest BeginPair
-                           & ( c_mapping_key ! "pair" & s_separate n c
-                             & ns_flow_map_explicit_entry n c
-                           / ns_flow_pair_entry n c )
-                           & nest EndPair
-                           & nest EndMapping
+ns_flow_pair n c {- 150 -} = wrapTokens BeginMapping EndMapping
+                           $ wrapTokens BeginPair EndPair
+                           $ ( ( c_mapping_key ! "pair" & s_separate n c
+                               & ns_flow_map_explicit_entry n c )
+                             / ns_flow_pair_entry n c )
 
-ns_flow_pair_entry n c            {- 152 -} = "entry"
-                                            ^ ( ns_flow_pair_yaml_key_entry n c
+ns_flow_pair_entry n c            {- 151 -} = ( ns_flow_pair_yaml_key_entry n c
                                               / c_ns_flow_map_empty_key_entry n c
                                               / c_ns_flow_pair_json_key_entry n c )
-ns_flow_pair_yaml_key_entry n c   {- 153 -} = ns_s_implicit_yaml_key
+ns_flow_pair_yaml_key_entry n c   {- 152 -} = ns_s_implicit_yaml_key FlowKey
                                             & c_ns_flow_map_separate_value n c
-c_ns_flow_pair_json_key_entry n c {- 154 -} = c_s_implicit_json_key
+c_ns_flow_pair_json_key_entry n c {- 153 -} = c_s_implicit_json_key FlowKey
                                             & c_ns_flow_map_adjacent_value n c
-ns_s_implicit_yaml_key            {- 155 -} = ( "node" ^ ( ns_flow_yaml_node na FlowKey )
-                                              & ( s_separate_in_line ?) )
+ns_s_implicit_yaml_key c          {- 154 -} = ( "node" ^ ( ns_flow_yaml_node na c ) & ( s_separate_in_line ?) )
                                             `limitedTo` 1024
-c_s_implicit_json_key             {- 156 -} = ( "node" ^ ( c_flow_json_node  na FlowKey )
-                                              & ( s_separate_in_line ?) )
+c_s_implicit_json_key c           {- 155 -} = ( "node" ^ ( c_flow_json_node  na c ) & ( s_separate_in_line ?) )
                                             `limitedTo` 1024
 
 -- 7.5 Flow Nodes
 
-ns_flow_yaml_content n c {- 157 -} = ns_plain n c
-c_flow_json_content n c  {- 158 -} = c_flow_sequence n c / c_flow_mapping n c
+ns_flow_yaml_content n c {- 156 -} = ns_plain n c
+c_flow_json_content n c  {- 157 -} = c_flow_sequence n c / c_flow_mapping n c
                                    / c_single_quoted n c / c_double_quoted n c
-ns_flow_content n c      {- 159 -} = ns_flow_yaml_content n c / c_flow_json_content n c
+ns_flow_content n c      {- 158 -} = ns_flow_yaml_content n c / c_flow_json_content n c
 
-ns_flow_yaml_node n c {- 160 -} = nest BeginNode
-                                & ( c_ns_alias_node
-                                  / ns_flow_yaml_content n c
-                                  / ( c_ns_properties n c
-                                    & ( s_separate n c & ns_flow_yaml_content n c
-                                      / e_scalar ) ) )
-                                & nest EndNode
-c_flow_json_node n c  {- 161 -} = nest BeginNode
-                                & ( c_ns_properties n c & s_separate n c ?)
+ns_flow_yaml_node n c {- 159 -} = wrapTokens BeginNode EndNode
+                                $ c_ns_alias_node
+                                / ns_flow_yaml_content n c
+                                / ( c_ns_properties n c
+                                  & ( ( s_separate n c & ns_flow_yaml_content n c )
+                                    / e_scalar ) )
+c_flow_json_node n c  {- 160 -} = wrapTokens BeginNode EndNode
+                                $ ( c_ns_properties n c & s_separate n c ?)
                                 & c_flow_json_content n c
-                                & nest EndNode
-ns_flow_node n c      {- 162 -} = nest BeginNode
-                                & ( c_ns_alias_node
-                                  / ns_flow_content n c
-                                  / ( c_ns_properties n c
-                                    & ( s_separate n c & ns_flow_content n c
-                                      / e_scalar ) ) )
-                                & nest EndNode
+ns_flow_node n c      {- 161 -} = wrapTokens BeginNode EndNode
+                                $ c_ns_alias_node
+                                / ns_flow_content n c
+                                / ( c_ns_properties n c
+                                  & ( ( s_separate n c & ns_flow_content n c )
+                                    / e_scalar ) )
 
 -- 8.1.1 Block Scalar Headers
 
-c_b_block_header n {- 163 -} = "header"
+c_b_block_header n {- 162 -} = "header"
                              ^ ( do m <- c_indentation_indicator n
                                     t <- c_chomping_indicator
                                     ( s_white / b_char ) ?! "header"
@@ -520,7 +484,7 @@
 
 -- 8.1.1.1 Block Indentation Indicator
 
-c_indentation_indicator n {- 164 -} = indicator ( ns_dec_digit - '0' ) & asInteger
+c_indentation_indicator n {- 163 -} = indicator ( ns_dec_digit - '0' ) & asInteger
                                     / detect_scalar_indentation n
 
 detect_scalar_indentation n = peek $ ( nb_char *)
@@ -532,182 +496,188 @@
 
 -- 8.1.1.2 Chomping Indicator
 
-c_chomping_indicator {- 165 -} = indicator '-' & result Strip
-                               / indicator '+' ! "header" & result Keep
+c_chomping_indicator {- 164 -} = indicator '-' & result Strip
+                               / indicator '+' & result Keep
                                / result Clip
 
-b_chomped_last t {- 166 -} = case t of
-                                  Strip -> nest EndScalar & b_non_content
-                                  Clip  -> b_as_line_feed & nest EndScalar
+end_block_scalar t = case t of
+                          Strip -> emptyToken EndScalar
+                          Clip  -> emptyToken EndScalar
+                          Keep  -> empty
+
+b_chomped_last t {- 165 -} = case t of
+                                  Strip -> emptyToken EndScalar & b_non_content
+                                  Clip  -> b_as_line_feed & emptyToken EndScalar
                                   Keep  -> b_as_line_feed
 
-l_chomped_empty n t {- 167 -} = case t of
+l_chomped_empty n t {- 166 -} = case t of
                                      Strip -> l_strip_empty n
                                      Clip  -> l_strip_empty n
                                      Keep  -> l_keep_empty n
-l_strip_empty n     {- 168 -} = ( s_indent_le n & b_non_content *)
+l_strip_empty n     {- 167 -} = ( s_indent_le n & b_non_content *)
                               & ( l_trail_comments n ?)
-l_keep_empty n      {- 169 -} = ( l_empty n BlockIn *)
-                              & nest EndScalar
+l_keep_empty n      {- 168 -} = ( l_empty n BlockIn *)
+                              & emptyToken EndScalar
                               & ( l_trail_comments n ?)
 
-l_trail_comments n {- 170 -} = s_indent_lt n & c_nb_comment_text & b_non_content
-                             & ( l_comment *)
+l_trail_comments n {- 169 -} = s_indent_lt n & c_nb_comment_text & b_comment
+                             & ( nonEmpty l_comment *)
 
 -- 8.1.2 Literal Style
 
-c_l__literal n {- 171 -} = do nest BeginScalar
-                              indicator '|'
-                              (m, t) <- c_b_block_header n
+c_l__literal n {- 170 -} = do emptyToken BeginScalar
+                              c_literal ! "node"
+                              (m, t) <- c_b_block_header n `prefixErrorWith` emptyToken EndScalar
                               text ( l_literal_content (n .+ m) t )
 
-l_nb_literal_text n   {- 172 -} = ( l_empty n BlockIn *)
+l_nb_literal_text n   {- 171 -} = ( l_empty n BlockIn *)
                                 & s_indent n & ( nb_char +)
-b_nb_literal_next n   {- 173 -} = b_as_line_feed
+b_nb_literal_next n   {- 172 -} = b_as_line_feed
                                 & l_nb_literal_text n
-l_literal_content n t {- 174 -} = ( l_nb_literal_text n & ( b_nb_literal_next n *)
-                                  & b_chomped_last t ?)
+l_literal_content n t {- 173 -} = ( ( l_nb_literal_text n & ( b_nb_literal_next n *) & b_chomped_last t )
+                                  / end_block_scalar t )
                                 & l_chomped_empty n t
 
 -- 8.1.3 Folded Style
 
-c_l__folded n {- 175 -} = do nest BeginScalar
-                             indicator '>'
-                             (m, t) <- c_b_block_header n
+c_l__folded n {- 174 -} = do emptyToken BeginScalar
+                             c_folded ! "node"
+                             (m, t) <- c_b_block_header n `prefixErrorWith` emptyToken EndScalar
                              text ( l_folded_content (n .+ m) t )
 
-s_nb_folded_text n  {- 176 -} = s_indent n & ns_char ! "fold" & ( nb_char *)
-l_nb_folded_lines n {- 177 -} = s_nb_folded_text n
+s_nb_folded_text n  {- 175 -} = s_indent n & ns_char ! "fold" & ( nb_char *)
+l_nb_folded_lines n {- 176 -} = s_nb_folded_text n
                               & ( b_l_folded n BlockIn & s_nb_folded_text n *)
 
-s_nb_spaced_text n  {- 178 -} = s_indent n & s_white ! "fold" & ( nb_char *)
-b_l_spaced        n {- 179 -} = b_as_line_feed
+s_nb_spaced_text n  {- 177 -} = s_indent n & s_white ! "fold" & ( nb_char *)
+b_l_spaced        n {- 178 -} = b_as_line_feed
                               & ( l_empty n BlockIn *)
-l_nb_spaced_lines n {- 180 -} = s_nb_spaced_text n
+l_nb_spaced_lines n {- 179 -} = s_nb_spaced_text n
                               & ( b_l_spaced n & s_nb_spaced_text n *)
 
-l_nb_same_lines n {- 181 -} = ( l_empty n BlockIn *)
+l_nb_same_lines n {- 180 -} = ( l_empty n BlockIn *)
                             & "fold" ^ ( l_nb_folded_lines n / l_nb_spaced_lines n )
 
-l_nb_diff_lines n {- 182 -} = l_nb_same_lines n
+l_nb_diff_lines n {- 181 -} = l_nb_same_lines n
                             & ( b_as_line_feed & l_nb_same_lines n *)
 
-l_folded_content n t {- 183 -} = ( l_nb_diff_lines n & b_chomped_last t ?)
+l_folded_content n t {- 182 -} = ( ( l_nb_diff_lines n & b_chomped_last t )
+                                 / end_block_scalar t )
                                & l_chomped_empty n t
 
 -- 8.2.1 Block Sequences
 
-detect_collection_indentation n = peek $ ( l_comment* ) & count_spaces (-n)
+detect_collection_indentation n = peek $ ( nonEmpty l_comment* ) & count_spaces (-n)
 detect_inline_indentation       = peek $ count_spaces 0
 
-l__block_sequence n   {- 184 -} = do m  <- detect_collection_indentation n
-                                     (   nest BeginSequence
-                                       & ( s_indent (n .+ m) & c_l_block_seq_entry (n .+ m) +)
-                                       & nest EndSequence )
-c_l_block_seq_entry n {- 185 -} = c_sequence_entry & ( ns_char >!) ! "node"
+l__block_sequence n   {- 183 -} = do m  <- detect_collection_indentation n
+                                     wrapTokens BeginSequence EndSequence $ ( s_indent (n .+ m) & c_l_block_seq_entry (n .+ m) +)
+c_l_block_seq_entry n {- 184 -} = c_sequence_entry & ( ns_char >!) ! "node"
                                 & s_l__block_indented n BlockIn
 
-s_l__block_indented n c {- 186 -} = do m <- detect_inline_indentation
-                                       (   s_indent m
-                                         & "node"
-                                         ^ ( ns_l_in_line_sequence (n .+ 1 .+ m)
-                                           / ns_l_in_line_mapping (n .+ 1 .+ m) ) )
-                                       / s_l__block_node n c
-                                       / e_node & s_l_comments
-ns_l_in_line_sequence n {- 187 -} = nest BeginNode
-                                  & nest BeginSequence
-                                  & c_l_block_seq_entry n
+s_l__block_indented n c {- 185 -} = do m <- detect_inline_indentation
+                                       "node" ^ ( ( s_indent m
+                                                  & ( ns_l_in_line_sequence (n .+ 1 .+ m)
+                                                    / ns_l_in_line_mapping (n .+ 1 .+ m) ) )
+                                                / s_l__block_node n c
+                                                / ( e_node & ( s_l_comments ?) & unparsed (n .+ 1) ) ) `recovery` unparsed (n .+ 1)
+ns_l_in_line_sequence n {- 186 -} = wrapTokens BeginNode EndNode
+                                  $ wrapTokens BeginSequence EndSequence
+                                  $ c_l_block_seq_entry n
                                   & ( s_indent n & c_l_block_seq_entry n *)
-                                  & nest EndSequence
-                                  & nest EndNode
 
 -- 8.2.2 Block Mappings
 
-l__block_mapping n = {- 188 -} do m <- detect_collection_indentation n
-                                  (   nest BeginMapping
-                                    & ( s_indent (n .+ m) & ns_l_block_map_entry (n .+ m) +)
-                                    & nest EndMapping )
+l__block_mapping n = {- 187 -} do m <- detect_collection_indentation n
+                                  wrapTokens BeginMapping EndMapping $ ( s_indent (n .+ m) & ns_l_block_map_entry (n .+ m) +)
 
-ns_l_block_map_entry n {- 189 -} = nest BeginPair
-                                 & ( c_l_block_map_explicit_entry n
-                                   / ns_l_block_map_implicit_entry n )
-                                 & nest EndPair
-c_l_block_map_explicit_entry n {- 190 -} = c_l_block_map_explicit_key n
+ns_l_block_map_entry n {- 188 -} = wrapTokens BeginPair EndPair
+                                 $ c_l_block_map_explicit_entry n
+                                 / ns_l_block_map_implicit_entry n
+c_l_block_map_explicit_entry n {- 189 -} = c_l_block_map_explicit_key n
                                          & ( l_block_map_explicit_value n
                                          / e_node )
-c_l_block_map_explicit_key n   {- 191 -} = c_mapping_key ! "node" & s_l__block_indented n BlockOut
-l_block_map_explicit_value n   {- 192 -} = s_indent n & c_mapping_value & s_l__block_indented n BlockOut
+c_l_block_map_explicit_key n   {- 190 -} = c_mapping_key ! "node" & s_l__block_indented n BlockOut
+l_block_map_explicit_value n   {- 191 -} = s_indent n & c_mapping_value & s_l__block_indented n BlockOut
 
-ns_l_block_map_implicit_entry n {- 193 -} = ( ns_s_block_map_implicit_key
+ns_l_block_map_implicit_entry n {- 192 -} = ( ns_s_block_map_implicit_key
                                             / e_node )
                                           & c_l_block_map_implicit_value n
-ns_s_block_map_implicit_key     {- 194 -} = c_s_implicit_json_key / ns_s_implicit_yaml_key
-c_l_block_map_implicit_value n  {- 195 -} = c_mapping_value ! "node" & ( s_l__block_node n BlockOut
-                                                                     / e_node & s_l_comments )
+ns_s_block_map_implicit_key     {- 193 -} = c_s_implicit_json_key BlockKey
+                                          / ns_s_implicit_yaml_key BlockKey
 
-ns_l_in_line_mapping n {- 196 -} = nest BeginNode
-                                 & nest BeginMapping
-                                 & ns_l_block_map_entry n
+c_l_block_map_implicit_value n  {- 194 -} = c_mapping_value ! "node"
+                                          & ( ( s_l__block_node n BlockOut
+                                              / ( e_node & ( s_l_comments ?) & unparsed (n .+ 1) ) ) `recovery` unparsed (n .+ 1) )
+
+ns_l_in_line_mapping n {- 195 -} = wrapTokens BeginNode EndNode
+                                 $ wrapTokens BeginMapping EndMapping
+                                 $ ns_l_block_map_entry n
                                  & ( s_indent n & ns_l_block_map_entry n *)
-                                 & nest EndMapping
-                                 & nest EndNode
 
 -- 8.2.3 Block Nodes
 
-s_l__block_node n c  {- 197 -} = s_l__block_in_block n c / s_l__flow_in_block n
-s_l__flow_in_block n {- 198 -} = s_separate (n .+ 1) FlowOut
+unparsed n = ( sol / unparsed_text & unparsed_break )
+           & ( nonEmpty ( unparsed_indent n & unparsed_text & unparsed_break ) *)
+unparsed_indent n = token Unparsed ( s_space % n )
+unparsed_text = token Unparsed ( upto ( eof / c_forbidden / b_break ) )
+unparsed_break = eof / peek c_forbidden / token Unparsed b_break / empty
+
+s_l__block_node n c  {- 196 -} = s_l__block_in_block n c / s_l__flow_in_block n
+s_l__flow_in_block n {- 197 -} = s_separate (n .+ 1) FlowOut
                                & ns_flow_node (n .+ 1) FlowOut & s_l_comments
 
-s_l__block_in_block n c {- 199 -} = nest BeginNode
-                                  & ( s_l__block_scalar n c / s_l__block_collection n c )
-                                  & nest EndNode
-s_l__block_scalar n c   {- 200 -} = s_separate (n .+ 1) c
+s_l__block_in_block n c {- 198 -} = wrapTokens BeginNode EndNode
+                                  $ ( s_l__block_scalar n c / s_l__block_collection n c )
+s_l__block_scalar n c   {- 199 -} = s_separate (n .+ 1) c
                                   & ( c_ns_properties (n .+ 1) c & s_separate (n .+ 1) c ?)
                                   & ( c_l__literal n / c_l__folded n )
 
-s_l__block_collection n c {- 201 -} = ( s_separate (n .+ 1) c & c_ns_properties (n .+ 1) c & ( s_l_comments >?) ?)
+s_l__block_collection n c {- 200 -} = ( s_separate (n .+ 1) c & c_ns_properties (n .+ 1) c & ( s_l_comments >?) ?)
                                     & s_l_comments
                                     & ( l__block_sequence (seq_spaces n c)
-                                    / l__block_mapping n )
-seq_spaces n c            {- 202 -} = case c of
+                                      / l__block_mapping n )
+seq_spaces n c            {- 201 -} = case c of
                                            BlockOut -> n .- 1
                                            BlockIn  -> n
 
--- Document:
+-- 9.1.1 Document Prefix
 
-c_document_start {- 203 -} = token DocumentStart [ '-', '-', '-' ]
-c_document_end   {- 204 -} = token DocumentEnd [ '.', '.', '.' ]
-c_forbidden      {- 205 -} = sol
-                           & ( c_document_start / c_document_end )
-                           & ( b_char / s_white / eof )
+l_document_prefix {- 202 -} = ( c_byte_order_mark ?) & ( nonEmpty l_comment *)
 
-l_document_prefix {- 206 -} = ( c_byte_order_mark ?) & ( l_comment *)
-l_document_suffix {- 207 -} = c_document_end & s_l_comments
+-- 9.1.2 Document Markers
 
-l_implicit_document {- 208 -} = nest BeginDocument
-                              & s_l__block_node (-1) BlockIn
-                                `forbidding` c_forbidden
-                              & nest EndDocument
-l_explicit_document {- 209 -} =  nest BeginDocument
-                              & ( l_directive ! "doc" *)
-                              & c_document_start ! "doc"
-                              & "node" ^ ( l_implicit_document
-                                         / e_node & s_l_comments )
-                              & nest EndDocument
+c_directives_end  {- 203 -} = token DirectivesEnd [ '-', '-', '-' ]
+c_document_end    {- 204 -} = token DocumentEnd [ '.', '.', '.' ]
+l_document_suffix {- 205 -} = c_document_end & s_l_comments
+c_forbidden       {- 206 -} = sol
+                            & ( c_directives_end / c_document_end )
+                            & ( b_char / s_white / eof )
 
-l_leading_document   {- 210 -} = l_document_prefix
-                               & "doc" ^ ( l_explicit_document
-                                         / "node" ^ ( l_implicit_document
-                                                    / empty ) )
-l_following_document {- 211 -} = l_document_prefix
-                               & "doc" ^ ( l_explicit_document
-                                         / empty )
+-- 9.1.3 Explicit Documents
 
--- Stream:
+l_bare_document {- 207 -} = "node" ^ s_l__block_node (-1) BlockIn
+                            `forbidding` c_forbidden
 
-l_documents   {- 212 -} = l_leading_document
-                        & ( l_following_document *)
-l_yaml_stream {- 213 -} = nest BeginStream
-                        & l_documents
-                        & ( l_document_suffix & l_documents *)
-                        & nest EndStream
+-- 9.1.4 Explicit Documents
+
+l_explicit_document {- 208 -} = c_directives_end ! "doc"
+                              & ( ( l_bare_document
+                                  / e_node & ( s_l_comments ?) & unparsed 0 ) `recovery` unparsed 0 )
+
+-- 9.1.5 Directives Documents
+
+l_directives_document {- 209 -} = ( l_directive +)
+                                & l_explicit_document
+
+-- 9.2 Streams:
+
+l_any_document   {- 210 -} = wrapTokens BeginDocument EndDocument
+                           $ "doc" ^ ( l_directives_document
+                                     / l_explicit_document
+                                     / l_bare_document ) `recovery` unparsed 0
+
+l_yaml_stream {- 211 -} = ( nonEmpty l_document_prefix *)
+                        & ( eof / ( c_document_end & ( b_char / s_white / eof ) >?) / l_any_document )
+                        & ( nonEmpty ( "more" ^ ( ( l_document_suffix ! "more" +) & ( nonEmpty l_document_prefix *) & ( eof / l_any_document )
+                                                / ( nonEmpty l_document_prefix *) & "doc" ^ ( wrapTokens BeginDocument EndDocument l_explicit_document ?) ) ) *)
diff --git a/Text/Yaml/Reference.hs b/Text/Yaml/Reference.hs
--- a/Text/Yaml/Reference.hs
+++ b/Text/Yaml/Reference.hs
@@ -1,4 +1,3 @@
--- #ignore-exports
 -------------------------------------------------------------------------------
 -- |
 -- Module      :  Text.Yaml.Reference
@@ -14,14 +13,13 @@
 -- the actual productions from @Reference.bnf@.
 --
 -- The parsing framework is fully streaming (generates output tokens
--- \"immediately\"). The memory leak that existed in previous version has been
--- plugged.
+-- \"immediately\").
 -------------------------------------------------------------------------------
 
 module Text.Yaml.Reference
   (
     -- Basic parsing:
-    Code,
+    Code(..),
     Token,
     Tokenizer,
     yaml,
@@ -94,17 +92,26 @@
 -- files. The output is a normal 'Char' list which is easy to work with and
 -- should be efficient enough as long as the 'Parser' does its job right.
 
--- | Recognized Unicode encodings. UTF-32 isn't required by YAML parsers.
+-- | Recognized Unicode encodings. As of YAML 1.2 UTF-32 is also required.
 data Encoding = UTF8    -- ^ UTF-8 encoding (or ASCII)
               | UTF16LE -- ^ UTF-16 little endian
               | UTF16BE -- ^ UTF-16 big endian
               | UTF32LE -- ^ UTF-32 little endian
               | UTF32BE -- ^ UTF-32 big endian
-    deriving Show
 
+-- | @show encoding@ converts an 'Encoding' to the encoding name (with a "-")
+-- as used by most programs.
+instance Show Encoding where
+    show UTF8    = "UTF-8"
+    show UTF16LE = "UTF-16LE"
+    show UTF16BE = "UTF-16BE"
+    show UTF32LE = "UTF-32LE"
+    show UTF32BE = "UTF-32BE"
+
 -- | @decode bytes@ automatically detects the 'Encoding' used and converts the
--- /bytes/ to Unicode characters.
-decode :: C.ByteString -> (Encoding, [Char])
+-- /bytes/ to Unicode characters, with byte offsets. Note the offset is for
+-- past end of the character, not its beginning.
+decode :: C.ByteString -> (Encoding, [(Int, Char)])
 decode text = (encoding, undoEncoding encoding text)
   where encoding = detectEncoding $ C.unpack $ C.take 4 text
 
@@ -126,14 +133,14 @@
 
 -- | @undoEncoding encoding bytes@ converts a /bytes/ stream to Unicode
 -- characters according to the /encoding/.
-undoEncoding :: Encoding -> C.ByteString -> [Char]
+undoEncoding :: Encoding -> C.ByteString -> [(Int, Char)]
 undoEncoding encoding bytes =
   case encoding of
-    UTF8    -> undoUTF8 bytes
-    UTF16LE -> combinePairs $ undoUTF16LE bytes
-    UTF16BE -> combinePairs $ undoUTF16BE bytes
-    UTF32LE -> combinePairs $ undoUTF32LE bytes
-    UTF32BE -> combinePairs $ undoUTF32BE bytes
+    UTF8    -> undoUTF8 bytes 0
+    UTF16LE -> combinePairs $ undoUTF16LE bytes 0
+    UTF16BE -> combinePairs $ undoUTF16BE bytes 0
+    UTF32LE -> combinePairs $ undoUTF32LE bytes 0
+    UTF32BE -> combinePairs $ undoUTF32BE bytes 0
 
 -- ** UTF-32 decoding
 
@@ -144,11 +151,12 @@
   | n == 1 = C.null bytes
   | n > 1  = C.null bytes || hasFewerThan (n .- 1) (C.tail bytes)
 
--- | @undoUTF32LE bytes@ decoded a UTF-32-LE /bytes/ stream to Unicode chars.
-undoUTF32LE :: C.ByteString -> [Char]
-undoUTF32LE bytes
+-- | @undoUTF32LE bytes offset@ decoded a UTF-32LE /bytes/ stream to Unicode
+-- chars.
+undoUTF32LE :: C.ByteString -> Int -> [(Int, Char)]
+undoUTF32LE bytes offset
   | C.null bytes = []
-  | hasFewerThan 4 bytes = error "UTF-32-LE input contains invalid number of bytes"
+  | hasFewerThan 4 bytes = error "UTF-32LE input contains invalid number of bytes"
   | otherwise = let first    = C.head bytes
                     bytes'   = C.tail bytes
                     second   = C.head bytes'
@@ -157,16 +165,18 @@
                     bytes''' = C.tail bytes''
                     fourth   = C.head bytes'''
                     rest     = C.tail bytes'''
-                in (chr $ (ord first)
+                in (offset .+ 4,
+                    chr $ (ord first)
                         .+ 256 .* ((ord second)
                         .+ 256 .* ((ord third)
-                        .+ 256 .* ((ord fourth))))):(undoUTF32LE rest)
+                        .+ 256 .* ((ord fourth))))):(undoUTF32LE rest $ offset .+ 4)
 
--- | @undoUTF32BE bytes@ decoded a UTF-32-BE /bytes/ stream to Unicode chars.
-undoUTF32BE :: C.ByteString -> [Char]
-undoUTF32BE bytes
+-- | @undoUTF32BE bytes offset@ decoded a UTF-32BE /bytes/ stream to Unicode
+-- chars.
+undoUTF32BE :: C.ByteString -> Int -> [(Int, Char)]
+undoUTF32BE bytes offset
   | C.null bytes = []
-  | hasFewerThan 4 bytes = error "UTF-32-BE input contains invalid number of bytes"
+  | hasFewerThan 4 bytes = error "UTF-32BE input contains invalid number of bytes"
   | otherwise = let first    = C.head bytes
                     bytes'   = C.tail bytes
                     second   = C.head bytes'
@@ -175,30 +185,31 @@
                     bytes''' = C.tail bytes''
                     fourth   = C.head bytes'''
                     rest     = C.tail bytes'''
-                in (chr $ (ord fourth)
+                in (offset .+ 4,
+                    chr $ (ord fourth)
                         .+ 256 .* ((ord third)
                         .+ 256 .* ((ord second)
-                        .+ 256 .* ((ord first))))):(undoUTF32BE rest)
+                        .+ 256 .* ((ord first))))):(undoUTF32BE rest $ offset .+ 4)
 
 -- ** UTF-16 decoding
 
 -- | @combinePairs chars@ converts each pair of UTF-16 surrogate characters to a
 -- single Unicode character.
-combinePairs :: [Char] -> [Char]
+combinePairs :: [(Int, Char)] -> [(Int, Char)]
 combinePairs []                          = []
-combinePairs (lead:rest)
-  | '\xD800' <= lead && lead <= '\xDBFF' = combineLead lead rest
-  | '\xDC00' <= lead && lead <= '\xDFFF' = error "UTF-16 contains trail surrogate without lead surrogate"
-  | otherwise                            = lead:(combinePairs rest)
+combinePairs (head@(_, head_char):tail)
+  | '\xD800' <= head_char && head_char <= '\xDBFF' = combineLead head tail
+  | '\xDC00' <= head_char && head_char <= '\xDFFF' = error "UTF-16 contains trail surrogate without lead surrogate"
+  | otherwise                                      = head:(combinePairs tail)
 
 -- | @combineLead lead rest@ combines the /lead/ surrogate with the head of the
 -- /rest/ of the input chars, assumed to be a /trail/ surrogate, and continues
 -- combining surrogate pairs.
-combineLead :: Char -> [Char] -> [Char]
-combineLead lead []                        = error "UTF-16 contains lead surrogate as final character"
-combineLead lead (trail:rest)
-  | '\xDC00' <= trail && trail <= '\xDFFF' = (combineSurrogates lead trail):combinePairs rest
-  | otherwise                              = error "UTF-16 contains lead surrogate without trail surrogate"
+combineLead :: (Int, Char) -> [(Int, Char)] -> [(Int, Char)]
+combineLead lead []                                  = error "UTF-16 contains lead surrogate as final character"
+combineLead lead@(_, lead_char) ((trail_offset, trail_char):rest)
+  | '\xDC00' <= trail_char && trail_char <= '\xDFFF' = (trail_offset, combineSurrogates lead_char trail_char):combinePairs rest
+  | otherwise                                        = error "UTF-16 contains lead surrogate without trail surrogate"
 
 -- | @surrogateOffset@ is copied from the Unicode FAQs.
 surrogateOffset :: Int
@@ -209,55 +220,57 @@
 combineSurrogates :: Char -> Char -> Char
 combineSurrogates lead trail = chr $ (ord lead) .* 1024 .+ (ord trail) .+ surrogateOffset
 
--- | @undoUTF18LE bytes@ decoded a UTF-16-LE /bytes/ stream to Unicode chars.
-undoUTF16LE :: C.ByteString -> [Char]
-undoUTF16LE bytes
+-- | @undoUTF18LE bytes offset@ decoded a UTF-16LE /bytes/ stream to Unicode
+-- chars.
+undoUTF16LE :: C.ByteString -> Int -> [(Int, Char)]
+undoUTF16LE bytes offset
   | C.null bytes = []
-  | hasFewerThan 2 bytes = error "UTF-16-LE input contains odd number of bytes"
+  | hasFewerThan 2 bytes = error "UTF-16LE input contains odd number of bytes"
   | otherwise = let low    = C.head bytes
                     bytes' = C.tail bytes
                     high   = C.head bytes'
                     rest   = C.tail bytes'
-                in (chr $ (ord low) .+ (ord high) .* 256):(undoUTF16LE rest)
+                in (offset .+ 2, chr $ (ord low) .+ (ord high) .* 256):(undoUTF16LE rest $ offset .+ 2)
 
--- | @undoUTF18BE bytes@ decoded a UTF-16-BE /bytes/ stream to Unicode chars.
-undoUTF16BE :: C.ByteString -> [Char]
-undoUTF16BE bytes
+-- | @undoUTF18BE bytes offset@ decoded a UTF-16BE /bytes/ stream to Unicode
+-- chars.
+undoUTF16BE :: C.ByteString -> Int -> [(Int, Char)]
+undoUTF16BE bytes offset
   | C.null bytes = []
-  | hasFewerThan 2 bytes = error "UTF-16-BE input contains odd number of bytes"
+  | hasFewerThan 2 bytes = error "UTF-16BE input contains odd number of bytes"
   | otherwise = let high   = C.head bytes
                     bytes' = C.tail bytes
                     low    = C.head bytes'
                     rest   = C.tail bytes'
-                in (chr $ (ord low) .+ (ord high) .* 256):(undoUTF16BE rest)
+                in (offset .+ 2, chr $ (ord low) .+ (ord high) .* 256):(undoUTF16BE rest $ offset .+ 2)
 
 -- ** UTF-8 decoding
 
--- | @undoUTF8 bytes@ decoded a UTF-8 /bytes/ stream to Unicode chars.
-undoUTF8 :: C.ByteString -> [Char]
-undoUTF8 bytes
+-- | @undoUTF8 bytes offset@ decoded a UTF-8 /bytes/ stream to Unicode chars.
+undoUTF8 :: C.ByteString -> Int -> [(Int, Char)]
+undoUTF8 bytes offset
   | C.null bytes = []
   | otherwise = let first = C.head bytes
                     rest  = C.tail bytes
                 in case () of
-                      _ | first < '\x80' -> first:(undoUTF8 rest)
-                        | first < '\xC0' -> error "UTF-8 input contains invalid first byte"
-                        | first < '\xE0' -> decodeTwoUTF8 first rest
-                        | first < '\xF0' -> decodeThreeUTF8 first rest
-                        | first < '\xF8' -> decodeFourUTF8 first rest
-                        | otherwise      -> error "UTF-8 input contains invalid first byte"
+                      _ | first < '\x80' -> (offset .+ 1, first):(undoUTF8 rest $ offset .+ 1)
+                        | first < '\xC0' -> error $ "UTF-8 input contains invalid first byte"
+                        | first < '\xE0' -> decodeTwoUTF8 first offset rest
+                        | first < '\xF0' -> decodeThreeUTF8 first offset rest
+                        | first < '\xF8' -> decodeFourUTF8 first offset rest
+                        | otherwise      -> error $ "UTF-8 input contains invalid first byte"
 
--- | @decodeTwoUTF8 first bytes@ decodes a two-byte UTF-8 character, where the
--- /first/ byte is already available and the second is the head of the /bytes/,
--- and then continues to undo the UTF-8 encoding.
-decodeTwoUTF8 :: Char -> C.ByteString -> [Char]
-decodeTwoUTF8 first bytes
+-- | @decodeTwoUTF8 first offset bytes@ decodes a two-byte UTF-8 character,
+-- where the /first/ byte is already available and the second is the head of
+-- the /bytes/, and then continues to undo the UTF-8 encoding.
+decodeTwoUTF8 :: Char -> Int -> C.ByteString -> [(Int, Char)]
+decodeTwoUTF8 first offset bytes
   | C.null bytes = error "UTF-8 double byte char is missing second byte at eof"
   | otherwise = let second = C.head bytes
                     rest   = C.tail bytes
                 in case () of
-                      _ | second < '\x80' || '\xBF' < second -> error "UTF-8 double byte char has invalid second byte"
-                        | otherwise                          -> (combineTwoUTF8 first second):(undoUTF8 rest)
+                      _ | second < '\x80' || '\xBF' < second -> error $ "UTF-8 double byte char has invalid second byte"
+                        | otherwise                          -> (offset .+ 2, combineTwoUTF8 first second):(undoUTF8 rest $ offset .+ 2)
 
 -- | @combineTwoUTF8 first second@ combines the /first/ and /second/ bytes of a
 -- two-byte UTF-8 char into a single Unicode char.
@@ -265,11 +278,11 @@
 combineTwoUTF8 first second = chr(((ord first) .- 0xC0) .* 64
                                .+ ((ord second) .- 0x80))
 
--- | @decodeThreeUTF8 first bytes@ decodes a three-byte UTF-8 character, where
--- the /first/ byte is already available and the second and third are the head
--- of the /bytes/, and then continues to undo the UTF-8 encoding.
-decodeThreeUTF8 :: Char -> C.ByteString -> [Char]
-decodeThreeUTF8 first bytes
+-- | @decodeThreeUTF8 first offset bytes@ decodes a three-byte UTF-8 character,
+-- where the /first/ byte is already available and the second and third are the
+-- head of the /bytes/, and then continues to undo the UTF-8 encoding.
+decodeThreeUTF8 :: Char -> Int -> C.ByteString -> [(Int, Char)]
+decodeThreeUTF8 first offset bytes
   | hasFewerThan 2 bytes = error "UTF-8 triple byte char is missing bytes at eof"
   | otherwise = let second = C.head bytes
                     bytes' = C.tail bytes
@@ -278,7 +291,7 @@
                 in case () of
                       _ | second < '\x80' || '\xBF' < second -> error "UTF-8 triple byte char has invalid second byte"
                         | third < '\x80' || '\xBF' < third   -> error "UTF-8 triple byte char has invalid third byte"
-                        | otherwise                          -> (combineThreeUTF8 first second third):(undoUTF8 rest)
+                        | otherwise                          -> (offset .+ 3, combineThreeUTF8 first second third):(undoUTF8 rest $ offset .+ 3)
 
 -- | @combineThreeUTF8 first second@ combines the /first/, /second/ and /third/
 -- bytes of a three-byte UTF-8 char into a single Unicode char.
@@ -287,11 +300,11 @@
                                        .+ ((ord second) .- 0x80) .* 64
                                        .+ ((ord third)  .- 0x80))
 
--- | @decodeFourUTF8 first bytes@ decodes a four-byte UTF-8 character, where the
--- /first/ byte is already available and the second, third and fourth are the
--- head of the /bytes/, and then continues to undo the UTF-8 encoding.
-decodeFourUTF8 :: Char -> C.ByteString -> [Char]
-decodeFourUTF8 first bytes
+-- | @decodeFourUTF8 first offset bytes@ decodes a four-byte UTF-8 character,
+-- where the /first/ byte is already available and the second, third and fourth
+-- are the head of the /bytes/, and then continues to undo the UTF-8 encoding.
+decodeFourUTF8 :: Char -> Int -> C.ByteString -> [(Int, Char)]
+decodeFourUTF8 first offset bytes
   | hasFewerThan 3 bytes = error "UTF-8 quad byte char is missing bytes at eof"
   | otherwise = let second  = C.head bytes
                     bytes'  = C.tail bytes
@@ -303,7 +316,7 @@
                       _ | second < '\x80' || '\xBF' < second -> error "UTF-8 quad byte char has invalid second byte"
                         | third < '\x80' || '\xBF' < third   -> error "UTF-8 quad byte char has invalid third byte"
                         | third < '\x80' || '\xBF' < third   -> error "UTF-8 quad byte char has invalid fourth byte"
-                        | otherwise                          -> (combineFourUTF8 first second third fourth):(undoUTF8 rest)
+                        | otherwise                          -> (offset .+ 4, combineFourUTF8 first second third fourth):(undoUTF8 rest $ offset .+ 4)
 
 -- | @combineFourUTF8 first second@ combines the /first/, /second/ and /third/
 -- bytes of a three-byte UTF-8 char into a single Unicode char.
@@ -324,14 +337,13 @@
 data Code = Bom             -- ^ BOM, contains \"@TF8@\", \"@TF16LE@\", \"@TF32BE@\", etc.
           | Text            -- ^ Content text characters.
           | Meta            -- ^ Non-content (meta) text characters.
-          | Break           -- ^ Line break preserved in content.
-          | Continue        -- ^ Separation line break.
+          | Break           -- ^ Separation line break.
           | LineFeed        -- ^ Line break normalized to content line feed.
           | LineFold        -- ^ Line break folded to content space.
           | Indicator       -- ^ Character indicating structure.
           | White           -- ^ Separation white space.
           | Indent          -- ^ Indentation spaces.
-          | DocumentStart   -- ^ Document start marker.
+          | DirectivesEnd   -- ^ Document start marker.
           | DocumentEnd     -- ^ Document end marker.
           | BeginEscape     -- ^ Begins escape sequence.
           | EndEscape       -- ^ Ends escape sequence.
@@ -364,10 +376,8 @@
           | BeginStream     -- ^ Begins YAML stream.
           | EndStream       -- ^ Ends YAML stream.
           | Error           -- ^ Parsing error at this point.
-          | Unparsed        -- ^ The rest of the input at the error point.
-          -- For testing:.
-          | Test            -- ^ Test characters otherwise unassigned.
-          | Detected        -- ^ Detected parameter.
+          | Unparsed        -- ^ Unparsed due to errors (or at end of test).
+          | Detected        -- ^ Detected parameter (for testing).
   deriving Eq
 
 -- | @show code@ converts a 'Code' to the one-character YEAST token code char.
@@ -377,14 +387,13 @@
                    Bom             -> "U"
                    Text            -> "T"
                    Meta            -> "t"
-                   Break           -> "B"
-                   Continue        -> "b"
+                   Break           -> "b"
                    LineFeed        -> "L"
                    LineFold        -> "l"
                    Indicator       -> "I"
                    White           -> "w"
                    Indent          -> "i"
-                   DocumentStart   -> "K"
+                   DirectivesEnd   -> "K"
                    DocumentEnd     -> "k"
                    BeginEscape     -> "E"
                    EndEscape       -> "e"
@@ -414,22 +423,28 @@
                    EndPair         -> "x"
                    BeginDocument   -> "O"
                    EndDocument     -> "o"
-                   BeginStream     -> "Y"
-                   EndStream       -> "y"
                    Error           -> "!"
                    Unparsed        -> "-"
-                   Test            -> "?"
                    Detected        -> "$"
 
 -- | Parsed token.
 data Token = Token {
-    tCode :: Code,  -- ^ Specific token 'Code'.
-    tText :: String -- ^ Contained input chars, if any.
+    tByteOffset :: Int,   -- ^ 0-base byte offset in stream.
+    tCharOffset :: Int,   -- ^ 0-base character offset in stream.
+    tLine       :: Int,   -- ^ 1-based line number.
+    tLineChar   :: Int,   -- ^ 0-based character in line.
+    tCode       :: Code,  -- ^ Specific token 'Code'.
+    tText       :: String -- ^ Contained input chars, if any.
   }
 
--- | @show token@ converts a 'Token' to a single YEAST line.
+-- | @show token@ converts a 'Token' to two YEAST lines: a comment with the
+-- position numbers and the actual token line.
 instance Show Token where
-  show token = (show $ token|>tCode) ++ (escapeString $ token|>tText) ++ "\n"
+  show token = "# B: " ++ (show $ token|>tByteOffset)
+            ++ ", C: " ++ (show $ token|>tCharOffset)
+            ++ ", L: " ++ (show $ token|>tLine)
+            ++ ", c: " ++ (show $ token|>tLineChar) ++ "\n"
+            ++ (show $ token|>tCode) ++ (escapeString $ token|>tText) ++ "\n"
 
 -- | @escapeString string@ escapes all the non-ASCII characters in the
 -- /string/, as well as escaping the \"@\\@\" character, using the \"@\\xXX@\",
@@ -515,54 +530,72 @@
 -- \"UserState\", we just bundle the generic and specific fields together (not
 -- that it is that easy to draw the line - is @sLine@ generic or specific?).
 data State = State {
-    sName      :: !String,          -- ^ The input name for error messages.
-    sEncoding  :: !Encoding,        -- ^ The input UTF encoding.
-    sDecision  :: !String,          -- ^ Current decision name.
-    sLimit     :: !Int,             -- ^ Lookahead characters limit.
-    sForbidden :: !(Maybe Pattern), -- ^ Pattern we must not enter into.
-    sIsPeek    :: !Bool,            -- ^ Disables token generation.
-    sChars     :: ![Char],          -- ^ (Reversed) characters collected for a token.
-    sOffset    :: !Int,             -- ^ Offset in characters in the input.
-    sLine      :: !Int,             -- ^ Builds on YAML's line break definition.
-    sColumn    :: !Int,             -- ^ Actually character number - we hate tabs.
-    sCode      :: !Code,            -- ^ Of token we are collecting chars for.
-    sLast      :: !Char,            -- ^ Last matched character.
-    sInput     :: ![Char]           -- ^ The decoded input characters.
+    sName            :: !String,          -- ^ The input name for error messages.
+    sEncoding        :: !Encoding,        -- ^ The input UTF encoding.
+    sDecision        :: !String,          -- ^ Current decision name.
+    sLimit           :: !Int,             -- ^ Lookahead characters limit.
+    sForbidden       :: !(Maybe Pattern), -- ^ Pattern we must not enter into.
+    sIsPeek          :: !Bool,            -- ^ Disables token generation.
+    sIsSol           :: !Bool,            -- ^ Is at start of line?
+    sChars           :: ![Char],          -- ^ (Reversed) characters collected for a token.
+    sCharsByteOffset :: !Int,             -- ^ Byte offset of first collected character.
+    sCharsCharOffset :: !Int,             -- ^ Char offset of first collected character.
+    sCharsLine       :: !Int,             -- ^ Line of first collected character.
+    sCharsLineChar   :: !Int,             -- ^ Character in line of first collected character.
+    sByteOffset      :: !Int,             -- ^ Offset in bytes in the input.
+    sCharOffset      :: !Int,             -- ^ Offset in characters in the input.
+    sLine            :: !Int,             -- ^ Builds on YAML's line break definition.
+    sLineChar        :: !Int,             -- ^ Character number in line.
+    sCode            :: !Code,            -- ^ Of token we are collecting chars for.
+    sLast            :: !Char,            -- ^ Last matched character.
+    sInput           :: ![(Int, Char)]    -- ^ The decoded input characters.
   }
 
 -- Showing a 'State' is only used in debugging. Note that forcing dump of
 -- @sInput@ will disable streaming it.
 instance Show State where
-  show state = "Name: "       ++ (show $ state|>sName)
-            ++ ", Encoding: " ++ (show $ state|>sEncoding)
-            ++ ", Decision: " ++ (show $ state|>sDecision)
-            ++ ", Limit: "    ++ (show $ state|>sLimit)
-            ++ ", IsPeek: "   ++ (show $ state|>sIsPeek)
-            ++ ", Chars: >>>" ++ (reverse $ state|>sChars) ++ "<<<"
-            ++ ", Offset: "   ++ (show $ state|>sOffset)
-            ++ ", Line: "     ++ (show $ state|>sLine)
-            ++ ", Column: "   ++ (show $ state|>sColumn)
-            ++ ", Code: "     ++ (show $ state|>sCode)
-            ++ ", Last: "     ++ (show $ state|>sLast)
---          ++ ", Input: >>>" ++ (show $ state|>sInput) ++ "<<<"
+  show state = "Name: "              ++ (show $ state|>sName)
+            ++ ", Encoding: "        ++ (show $ state|>sEncoding)
+            ++ ", Decision: "        ++ (show $ state|>sDecision)
+            ++ ", Limit: "           ++ (show $ state|>sLimit)
+            ++ ", IsPeek: "          ++ (show $ state|>sIsPeek)
+            ++ ", IsSol: "           ++ (show $ state|>sIsSol)
+            ++ ", Chars: >>>"        ++ (reverse $ state|>sChars) ++ "<<<"
+            ++ ", CharsByteOffset: " ++ (show $ state|>sCharsByteOffset)
+            ++ ", CharsCharOffset: " ++ (show $ state|>sCharsCharOffset)
+            ++ ", CharsLine: "       ++ (show $ state|>sCharsLine)
+            ++ ", CharsLineChar: "   ++ (show $ state|>sCharsLineChar)
+            ++ ", ByteOffset: "      ++ (show $ state|>sByteOffset)
+            ++ ", CharOffset: "      ++ (show $ state|>sCharOffset)
+            ++ ", Line: "            ++ (show $ state|>sLine)
+            ++ ", LineChar: "        ++ (show $ state|>sLineChar)
+            ++ ", Code: "            ++ (show $ state|>sCode)
+            ++ ", Last: "            ++ (show $ state|>sLast)
+--          ++ ", Input: >>>"        ++ (show $ state|>sInput) ++ "<<<"
 
 -- | @initialState name input@ returns an initial 'State' for parsing the
 -- /input/ (with /name/ for error messages).
 initialState :: String -> C.ByteString -> State
 initialState name input = let (encoding, decoded) = decode input
-                          in State { sName      = name,
-                                     sEncoding  = encoding,
-                                     sDecision  = "",
-                                     sLimit     = -1,
-                                     sForbidden = Nothing,
-                                     sIsPeek    = False,
-                                     sChars     = [],
-                                     sOffset    = 0,
-                                     sLine      = 1,
-                                     sColumn    = 0,
-                                     sCode      = Test,
-                                     sLast      = ' ',
-                                     sInput     = decoded }
+                          in State { sName            = name,
+                                     sEncoding        = encoding,
+                                     sDecision        = "",
+                                     sLimit           = -1,
+                                     sForbidden       = Nothing,
+                                     sIsPeek          = False,
+                                     sIsSol           = True,
+                                     sChars           = [],
+                                     sCharsByteOffset = -1,
+                                     sCharsCharOffset = -1,
+                                     sCharsLine       = -1,
+                                     sCharsLineChar   = -1,
+                                     sByteOffset      = 0,
+                                     sCharOffset      = 0,
+                                     sLine            = 1,
+                                     sLineChar        = 0,
+                                     sCode            = Unparsed,
+                                     sLast            = ' ',
+                                     sInput           = decoded }
 
 -- *** Setters
 --
@@ -630,15 +663,16 @@
 tokenReply state token = Reply { rResult = Result (),
                                  rTokens = D.singleton token,
                                  rCommit = Nothing,
-                                 rState  = state { sChars = [] } }
+                                 rState  = state { sCharsByteOffset = -1,
+                                                   sCharsCharOffset = -1,
+                                                   sCharsLine       = -1,
+                                                   sCharsLineChar   = -1,
+                                                   sChars           = [] } }
 
 -- | @failReply state message@ prepares a 'Reply' with the specified /state/
 -- and error /message/.
 failReply :: State -> String -> Reply result
-failReply state message = Reply { rResult = Failed $ state|>sName
-                                                  ++ ": line " ++ (show $ state|>sLine)
-                                                  ++ ": column " ++ (show $ state|>sColumn)
-                                                  ++ ": " ++ message,
+failReply state message = Reply { rResult = Failed message,
                                   rTokens = D.empty,
                                   rCommit = Nothing,
                                   rState  = state }
@@ -646,10 +680,8 @@
 -- | @unexpectedReply state@ returns a @failReply@ for an unexpected character.
 unexpectedReply :: State -> Reply result
 unexpectedReply state = case state|>sInput of
-                             (char:_) -> failReply state $ "Unexpected '" ++ [char] ++ "'"
-                             []       -> failReply state "Unexpected end of input"
-
--- ** Parsing Monad
+                             ((_, char):_) -> failReply state $ "Unexpected '" ++ [char] ++ "'"
+                             []            -> failReply state "Unexpected end of input"
 
 -- | Allow using the @do@ notation for our parsers, which makes for short and
 -- sweet @do@ syntax when we want to examine the results (we typically don't).
@@ -723,7 +755,7 @@
 -- | @decision ^ (option \/ option \/ ...)@ provides a /decision/ name to the
 -- choice about to be made, to allow to @commit@ to it.
 (^) :: (Match match result) => String -> match -> Parser result
-decision ^ parser = choice decision (match parser)
+decision ^ parser = choice decision $ match parser
 
 -- | @parser ! decision@ commits to /decision/ (in an option) after
 -- successfully matching the /parser/.
@@ -772,22 +804,22 @@
 (/) :: (Match match1 result, Match match2 result) => match1 -> match2 -> Parser result
 first / second = Parser $ \ state ->
   let Parser parser = decide (match first) (match second)
-  in  parser state
+  in parser state
 
 -- | @(optional ?)@ tries to match /parser/, otherwise does nothing.
 (?) :: (Match match result) => match -> Pattern
-(?) optional = "?" ^ (optional & empty / empty)
+(?) optional = (optional & empty) / empty
 
 -- | @(parser *)@ matches zero or more occurrences of /repeat/, as long as each
 -- one actually consumes input characters.
 (*) :: (Match match result) => match -> Pattern
 (*) parser = "*" ^ zomParser
-  where zomParser = (nonEmpty parser ! "*" & zomParser) / empty
+  where zomParser = (parser ! "*" & zomParser) / empty
 
 -- | @(parser +)@ matches one or more occurrences of /parser/, as long as each
 -- one actually consumed input characters.
 (+) :: (Match match result) => match -> Pattern
-(+) parser = nonEmpty parser & (parser *)
+(+) parser = parser & (parser *)
 
 -- ** Basic parsers
 
@@ -796,7 +828,7 @@
 decide :: Parser result -> Parser result -> Parser result
 decide left right = Parser $ \ state ->
   let Parser parser = decideParser state D.empty left right
-  in  parser state
+  in parser state
   where decideParser point tokens (Parser left) right = Parser $ \state ->
           let reply = left state
               tokens' reply = D.append tokens $ reply|>rTokens
@@ -809,7 +841,7 @@
                   (More left', Just _)  -> reply { rTokens = tokens' reply,
                                                    rResult = More left' }
                   (More left', Nothing) -> let Parser parser = decideParser point (tokens' reply) left' right
-                                     in  parser $ reply|>rState
+                                           in parser $ reply|>rState
 
 -- | @choice decision parser@ provides a /decision/ name to the choice about to
 -- be made in /parser/, to allow to @commit@ to it.
@@ -830,11 +862,27 @@
                                                      rState = (reply|>rState) { sDecision = parentDecision } }
           in reply'
 
+-- | @parser ``recovery`` pattern@ parses the specified /parser/; if it fails,
+-- it continues to the /recovery/ parser to recover.
+recovery :: (Match match1 result, Match match2 result) => match1 -> match2 -> Parser result
+recovery pattern recover =
+  Parser $ \ state ->
+    let (Parser parser) = match pattern
+        reply = parser state
+    in if state|>sIsPeek
+          then reply
+          else case reply|>rResult of
+                    Result _       -> reply
+                    More more      -> reply { rResult = More $ more `recovery` recover }
+                    Failed message -> reply { rResult = More $ fake Error message & unparsed & recover }
+    where unparsed = let (Parser parser) = match finishToken
+                     in Parser $ \ state -> parser $ state { sCode = Unparsed }
+
 -- | @prev parser@ succeeds if /parser/ matches at the previous character. It
 -- does not consume any input.
 prev :: (Match match result) => match -> Parser result
 prev parser = Parser $ \ state ->
-  prevParser state (match parser) state { sIsPeek = True, sInput = state|>sLast : state|>sInput }
+  prevParser state (match parser) state { sIsPeek = True, sInput = (-1, state|>sLast) : state|>sInput }
   where prevParser point (Parser parser) state =
           let reply = parser state
           in case reply|>rResult of
@@ -869,18 +917,24 @@
                                          Just text -> failReply point $ "Unexpected " ++ text
                   More parser'   -> rejectParser point name parser' $ reply|>rState
 
+-- | @upto parser@ consumes all the character up to and not including the next
+-- point where the specified parser is a match.
+upto :: Pattern -> Pattern
+
+upto parser = ( ( parser >!) & nextIf (const True) *)
+
 -- | @nonEmpty parser@ succeeds if /parser/ matches some non-empty input
 -- characters at this point.
 nonEmpty :: (Match match result) => match -> Parser result
 nonEmpty parser = Parser $ \ state ->
-  let Parser parser' = nonEmptyParser (state|>sOffset) (match parser)
+  let Parser parser' = nonEmptyParser (state|>sCharOffset) (match parser)
   in parser' state
   where nonEmptyParser offset (Parser parser) = Parser $ \ state ->
           let reply = parser state
               state' = reply|>rState
           in case reply|>rResult of
                   Failed message -> reply
-                  Result value   -> if state'|>sOffset > offset
+                  Result value   -> if state'|>sCharOffset > offset
                                        then reply
                                        else failReply state' "Matched empty pattern"
                   More parser'   -> reply { rResult = More $ nonEmptyParser offset parser' }
@@ -894,12 +948,12 @@
 eof = Parser $ \ state ->
   if state|>sInput == []
      then returnReply state ()
-     else failReply state "Expected end of input"
+     else unexpectedReply state
 
 -- | @sol@ matches the start of a line.
 sol :: Pattern
 sol = Parser $ \ state ->
-  if state|>sColumn == 0
+  if state|>sIsSol
      then returnReply state ()
      else failReply state "Expected start of line"
 
@@ -915,11 +969,12 @@
           rResult = Result (),
           rCommit = Just decision }
 
--- | @nextLine@ increments @sLine@ counter and resets @sColumn@.
+-- | @nextLine@ increments @sLine@ counter and resets @sLineChar@.
 nextLine :: Pattern
 nextLine = Parser $ \ state ->
-  returnReply state { sLine = state|>sLine .+ 1,
-                      sColumn = 0 }
+  returnReply state { sIsSol    = True,
+                      sLine     = state|>sLine .+ 1,
+                      sLineChar = 0 }
               ()
 
 -- | @with setField getField value parser@ invokes the specified /parser/ with
@@ -929,7 +984,7 @@
 with setField getField value parser = Parser $ \ state ->
   let value' = getField state
       Parser parser' = value' `seq` withParser value' parser
-  in  parser' $ setField value state
+  in parser' $ setField value state
   where withParser parentValue (Parser parser) = Parser $ \ state ->
           let reply = parser state
           in case reply|>rResult of
@@ -968,17 +1023,35 @@
                limit -> consumeNextIf state { sLimit = state|>sLimit .- 1 }
         consumeNextIf state =
           case state|>sInput of
-               (char:rest) | test char -> let chars = if state|>sIsPeek
-                                                         then []
-                                                         else char:(state|>sChars)
-                                              state' = state { sInput = rest,
-                                                               sLast = char,
-                                                               sChars = chars,
-                                                               sOffset = state|>sOffset .+ 1,
-                                                               sColumn = state|>sColumn .+ 1 }
-                                          in returnReply state' ()
+               ((offset, char):rest) | test char -> let chars = if state|>sIsPeek
+                                                                   then []
+                                                                   else char:(state|>sChars)
+                                                        byte_offset = charsOf sByteOffset sCharsByteOffset
+                                                        char_offset = charsOf sCharOffset sCharsCharOffset
+                                                        line        = charsOf sLine       sCharsLine
+                                                        line_char   = charsOf sLineChar   sCharsLineChar
+                                                        is_sol = if char == '\xFEFF'
+                                                                    then state|>sIsSol
+                                                                    else False
+                                                        state' = state { sInput           = rest,
+                                                                         sLast            = char,
+                                                                         sChars           = chars,
+                                                                         sCharsByteOffset = byte_offset,
+                                                                         sCharsCharOffset = char_offset,
+                                                                         sCharsLine       = line,
+                                                                         sCharsLineChar   = line_char,
+                                                                         sIsSol           = is_sol,
+                                                                         sByteOffset      = offset,
+                                                                         sCharOffset      = state|>sCharOffset .+ 1,
+                                                                         sLineChar        = state|>sLineChar .+ 1 }
+                                                    in returnReply state' ()
                            | otherwise -> unexpectedReply state
                []                      -> unexpectedReply state
+          where charsOf field charsField = if state|>sIsPeek
+                                              then -1
+                                              else if state|>sChars == []
+                                                      then state|>field
+                                                      else state|>charsField
 
 -- ** Producing tokens
 
@@ -986,12 +1059,21 @@
 -- one, or does nothing if there are no collected characters.
 finishToken :: Pattern
 finishToken = Parser $ \ state ->
-  if state|>sIsPeek
-     then returnReply state ()
-     else case state|>sChars of
-               []          -> returnReply state ()
-               chars@(_:_) -> tokenReply state Token { tCode = state|>sCode,
-                                                       tText = reverse chars }
+  let state' = state { sChars           = [],
+                       sCharsByteOffset = -1,
+                       sCharsCharOffset = -1,
+                       sCharsLine       = -1,
+                       sCharsLineChar   = -1 }
+  in if state|>sIsPeek
+        then returnReply state' ()
+        else case state|>sChars of
+                  []          -> returnReply state' ()
+                  chars@(_:_) -> tokenReply state' Token { tByteOffset = state|>sCharsByteOffset,
+                                                           tCharOffset = state|>sCharsCharOffset,
+                                                           tLine       = state|>sCharsLine,
+                                                           tLineChar   = state|>sCharsLineChar,
+                                                           tCode       = state|>sCode,
+                                                           tText       = reverse chars }
 
 -- | @wrap parser@ invokes the /parser/, ensures any unclaimed input characters
 -- are wrapped into a token (only happens when testing productions), ensures no
@@ -1023,8 +1105,16 @@
 fake code text = Parser $ \ state ->
   if state|>sIsPeek
      then returnReply state ()
-     else tokenReply state Token { tCode = code,
-                                   tText = text }
+     else tokenReply state Token { tByteOffset = value state sByteOffset sCharsByteOffset,
+                                   tCharOffset = value state sCharOffset sCharsCharOffset,
+                                   tLine       = value state sLine sCharsLine,
+                                   tLineChar   = value state sLineChar sCharsLineChar,
+                                   tCode       = code,
+                                   tText       = text }
+    where value state field1 field2 =
+            if field2 state == -1
+               then field1 state
+               else field2 state
 
 -- | @meta parser@ collects the text matched by the specified /parser/ into a
 -- | @Meta@ token.
@@ -1041,24 +1131,47 @@
 text :: (Match match result) => match -> Pattern
 text parser = token Text parser
 
--- | @nest code@ returns an empty token with the specified begin\/end /code/ to
--- signal nesting.
-nest :: Code -> Pattern
-nest code = finishToken & nestParser code
-  where nestParser code = Parser $ \ state ->
+-- | @emptyToken code@ returns an empty token.
+emptyToken :: Code -> Pattern
+emptyToken code = finishToken & parser code
+  where parser code = Parser $ \ state ->
           if state|>sIsPeek
              then returnReply state ()
-             else tokenReply state Token { tCode = code,
-                                           tText = "" }
+             else tokenReply state Token { tByteOffset = state|>sByteOffset,
+                                           tCharOffset = state|>sCharOffset,
+                                           tLine       = state|>sLine,
+                                           tLineChar   = state|>sLineChar,
+                                           tCode       = code,
+                                           tText       = "" }
 
+-- | @wrapTokens beginCode endCode parser@ wraps the specified /parser/ with
+-- matching /beginCode/ and /endCode/ tokens.
+wrapTokens :: Code -> Code -> Pattern -> Pattern
+wrapTokens beginCode endCode pattern = emptyToken beginCode
+                                      & prefixErrorWith pattern (emptyToken endCode)
+                                      & emptyToken endCode
+
+-- | @prefixErrorWith pattern prefix@ will invoke the @prefix@ parser if an
+-- error is detected during the @pattern@ parser, and then return the error.
+prefixErrorWith :: (Match match result) => match -> Pattern -> Parser result
+prefixErrorWith pattern prefix =
+  Parser $ \ state ->
+    let (Parser parser) = match pattern
+        reply = parser state
+    in case reply|>rResult of
+            Result _       -> reply
+            More more      -> reply { rResult = More $ prefixErrorWith more prefix }
+            Failed message -> reply { rResult = More $ prefix & (fail message :: Parser result) }
+
 -- * Production parameters
 
 -- | Production context.
-data Context = BlockOut     -- ^ Outside block sequence..
-             | BlockIn      -- ^ Inside block sequence..
+data Context = BlockOut     -- ^ Outside block sequence.
+             | BlockIn      -- ^ Inside block sequence.
              | FlowOut      -- ^ Outside flow collection.
              | FlowIn       -- ^ Inside flow collection.
-             | FlowKey      -- ^ Inside flow key.
+             | BlockKey     -- ^ Implicit block key.
+             | FlowKey      -- ^ Implicit flow key.
 
 -- | @show context@ converts a 'Context' to a 'String'.
 instance Show Context where
@@ -1067,6 +1180,7 @@
                       BlockIn  -> "block-in"
                       FlowOut  -> "flow-out"
                       FlowIn   -> "flow-in"
+                      BlockKey -> "block-key"
                       FlowKey  -> "flow-key"
 
 -- | @read context@ converts a 'String' to a 'Context'. We trust our callers to
@@ -1079,6 +1193,7 @@
                         "block_in"  -> BlockIn
                         "flow_out"  -> FlowOut
                         "flow_in"   -> FlowIn
+                        "block_key" -> BlockKey
                         "flow_key"  -> FlowKey
                         _           -> error $ "unknown context: " ++ word
 
@@ -1110,7 +1225,10 @@
 
 -- | 'Tokenizer' converts a (named) input text into a list of 'Token'. Errors
 -- are reported as tokens with the @Error@ 'Code', and the unparsed text
--- following an error may be attached as a final token.
+-- following an error may be attached as a final token (if the @Bool@ is
+-- @True@). Note that tokens are available \"immediately\", allowing for
+-- streaming of large YAML files with memory requirements depending only on the
+-- YAML nesting level.
 type Tokenizer = String -> C.ByteString -> Bool -> [Token]
 
 -- | @patternTokenizer pattern@ converts the /pattern/ to a simple 'Tokenizer'.
@@ -1120,10 +1238,11 @@
   where patternParser (Parser parser) state =
           let reply = parser state
               tokens = commitBugs reply
+              state' = reply|>rState
           in case reply|>rResult of
-                  Failed message -> errorTokens tokens message withFollowing $ reply|>rState|>sInput
+                  Failed message -> errorTokens tokens state' message withFollowing
                   Result _       -> tokens
-                  More parser'   -> D.append tokens $ patternParser parser' $ reply|>rState
+                  More parser'   -> D.append tokens $ patternParser parser' state'
 
 -- | @parserTokenizer what parser@ converts the /parser/ returning /what/ to a
 -- simple 'Tokenizer' (only used for tests). The result is reported as a token
@@ -1135,20 +1254,35 @@
   where parserParser (Parser parser) state =
           let reply = parser state
               tokens = commitBugs reply
+              state' = reply|>rState
           in case reply|>rResult of
-                  Failed message -> errorTokens tokens message withFollowing $ reply|>rState|>sInput
-                  Result value   -> D.append tokens $ D.singleton Token { tCode = Detected,
-                                                                          tText = what ++ "=" ++ (show value) }
-                  More parser'   -> D.append tokens $ parserParser parser' $ reply|>rState
+                  Failed message -> errorTokens tokens state' message withFollowing
+                  Result value   -> D.append tokens $ D.singleton Token { tByteOffset = state'|>sByteOffset,
+                                                                          tCharOffset = state'|>sCharOffset,
+                                                                          tLine       = state'|>sLine,
+                                                                          tLineChar   = state'|>sLineChar,
+                                                                          tCode       = Detected,
+                                                                          tText       = what ++ "=" ++ (show value) }
+                  More parser'   -> D.append tokens $ parserParser parser' $ state'
 
--- | @errorTokens tokens message withFollowing following@ appends an @Error@
--- token with the specified /message/ at the end of /tokens/, and if
--- /withFollowing/ also appends the unparsed text /following/ the error as a
--- final @Unparsed@ token.
-errorTokens tokens message withFollowing following =
-    let tokens' = D.append tokens $ D.singleton Token { tCode = Error, tText = message }
-    in if withFollowing && following /= ""
-       then D.append tokens' $ D.singleton Token { tCode = Unparsed, tText = following }
+-- | @errorTokens tokens state message withFollowing@ appends an @Error@ token
+-- with the specified /message/ at the end of /tokens/, and if /withFollowing/
+-- also appends the unparsed text following the error as a final @Unparsed@
+-- token.
+errorTokens tokens state message withFollowing =
+    let tokens' = D.append tokens $ D.singleton Token { tByteOffset = state|>sByteOffset,
+                                                        tCharOffset = state|>sCharOffset,
+                                                        tLine       = state|>sLine,
+                                                        tLineChar   = state|>sLineChar,
+                                                        tCode       = Error,
+                                                        tText       = message }
+    in if withFollowing && state|>sInput /= []
+       then D.append tokens' $ D.singleton Token { tByteOffset = state|>sByteOffset,
+                                                   tCharOffset = state|>sCharOffset,
+                                                   tLine       = state|>sLine,
+                                                   tLineChar   = state|>sLineChar,
+                                                   tCode       = Unparsed,
+                                                   tText       = map snd $ state|>sInput }
        else tokens'
 
 -- | @commitBugs reply@ inserts an error token if a commit was made outside a
@@ -1156,10 +1290,15 @@
 commitBugs :: Reply result -> D.DList Token
 commitBugs reply =
   let tokens = reply|>rTokens
+      state = reply|>rState
   in case reply|>rCommit of
           Nothing     -> tokens
-          Just commit -> D.append tokens $ D.singleton Token { tCode = Error,
-                                                               tText = "Commit to '" ++ commit ++ "' was made outside it" }
+          Just commit -> D.append tokens $ D.singleton Token { tByteOffset = state|>sByteOffset,
+                                                               tCharOffset = state|>sCharOffset,
+                                                               tLine       = state|>sLine,
+                                                               tLineChar   = state|>sLineChar,
+                                                               tCode       = Error,
+                                                               tText       = "Commit to '" ++ commit ++ "' was made outside it" }
 
 -- | @yaml name input@ converts the Unicode /input/ (called /name/ in error
 -- messages) to a list of 'Token' according to the YAML spec. This is it!
@@ -1196,24 +1335,25 @@
            $ PAT(b_as_line_feed)
            $ PAT(b_as_space)
            $ PAT(b_carriage_return)
+           $ PAT(b_break)
            $ PAT(b_char)
            $ PAT(b_line_feed)
            $ PAT(b_non_content)
+           $ PAT(b_comment)
            $ PAT(c_alias)
            $ PAT(c_anchor)
            $ PAT(c_byte_order_mark)
            $ PAT(c_collect_entry)
            $ PAT(c_comment)
            $ PAT(c_directive)
+           $ PAT(c_directives_end)
            $ PAT(c_document_end)
-           $ PAT(c_document_start)
            $ PAT(c_double_quote)
            $ PAT(c_escape)
            $ PAT(c_flow_indicator)
            $ PAT(c_folded)
            $ PAT(c_forbidden)
            $ PAT(c_indicator)
-           $ PAT(c_json)
            $ PAT(c_literal)
            $ PAT(c_mapping_end)
            $ PAT(c_mapping_key)
@@ -1236,22 +1376,20 @@
            $ PAT(c_sequence_end)
            $ PAT(c_sequence_entry)
            $ PAT(c_sequence_start)
-           $ PAT(c_s_implicit_json_key)
            $ PAT(c_single_quote)
            $ PAT(c_tag)
            $ PAT(c_tag_handle)
            $ PAT(c_verbatim_tag)
            $ PAT(e_node)
            $ PAT(e_scalar)
+           $ PAT(l_any_document)
+           $ PAT(l_bare_document)
            $ PAT(l_comment)
            $ PAT(l_directive)
+           $ PAT(l_directives_document)
            $ PAT(l_document_prefix)
-           $ PAT(l_documents)
            $ PAT(l_document_suffix)
            $ PAT(l_explicit_document)
-           $ PAT(l_following_document)
-           $ PAT(l_implicit_document)
-           $ PAT(l_leading_document)
            $ PAT(l_yaml_stream)
            $ PAT(nb_char)
            $ PAT(nb_double_char)
@@ -1295,7 +1433,6 @@
            $ PAT(ns_plain_safe_out)
            $ PAT(ns_reserved_directive)
            $ PAT(ns_s_block_map_implicit_key)
-           $ PAT(ns_s_implicit_yaml_key)
            $ PAT(ns_single_char)
            $ PAT(ns_tag_char)
            $ PAT(ns_tag_directive)
@@ -1354,6 +1491,10 @@
                 $ PAT(ns_l_in_line_mapping)
                 $ PAT(ns_l_in_line_sequence)
                 $ PAT(s_block_line_prefix)
+                $ PAT(s_double_break)
+                $ PAT(s_double_escaped)
+                $ PAT(s_double_next_line)
+                $ PAT(s_flow_folded)
                 $ PAT(s_flow_line_prefix)
                 $ PAT(s_indent)
                 $ PAT(s_indent_le)
@@ -1361,12 +1502,8 @@
                 $ PAT(s_l__flow_in_block)
                 $ PAT(s_nb_folded_text)
                 $ PAT(s_nb_spaced_text)
-                $ PAT(s_ns_double_next_line)
-                $ PAT(s_ns_single_next_line)
-                $ PAT(s_s_double_break)
-                $ PAT(s_s_double_escaped)
                 $ PAT(s_separate_lines)
-                $ PAT(s_s_flow_folded)
+                $ PAT(s_single_next_line)
                 $ Map.empty
   where pat name pattern     = Map.insert (pName name) (\ n -> patternTokenizer     (match   $ pattern n))
         par name parser what = Map.insert (pName name) (\ n -> parserTokenizer what (match   $ parser  n))
@@ -1384,12 +1521,13 @@
 -- | @tokenizersWithC@ returns a mapping from a production name to a production
 -- tokenizer (that takes a /c/ argument).
 tokenizersWithC :: Map.Map String (Context -> Tokenizer)
-tokenizersWithC = PAT(nb_ns_plain_in_line)
-                $ PAT(nb_plain_char)
+tokenizersWithC = PAT(c_s_implicit_json_key)
+                $ PAT(nb_ns_plain_in_line)
                 $ PAT(ns_plain_char)
                 $ PAT(ns_plain_first)
                 $ PAT(ns_plain_one_line)
                 $ PAT(ns_plain_safe)
+                $ PAT(ns_s_implicit_yaml_key)
                 $ Map.empty
   where pat name pattern = Map.insert (pName name) (\ c -> patternTokenizer (match $ pattern c))
 
@@ -1508,14 +1646,15 @@
 -- | @detect_utf_encoding@ doesn't actually detect the encoding, we just call it
 -- this way to make the productions compatible with the spec. Instead it simply
 -- reports the encoding (which was already detected when we started parsing).
-detect_utf_encoding = Parser $ \ state -> let text = case state|>sEncoding of
-                                                          UTF8    -> "TF8"
-                                                          UTF16LE -> "TF16LE"
-                                                          UTF16BE -> "TF16BE"
-                                                          UTF32LE -> "TF32LE"
-                                                          UTF32BE -> "TF32BE"
-                                              Parser parser = fake Bom text
-                                          in  parser state { sColumn = state|>sColumn .- 1 }
+bom code = code
+         & (Parser $ \ state -> let text = case state|>sEncoding of
+                                                UTF8    -> "TF-8"
+                                                UTF16LE -> "TF-16LE"
+                                                UTF16BE -> "TF-16BE"
+                                                UTF32LE -> "TF-32LE"
+                                                UTF32BE -> "TF-32BE"
+                                    Parser parser = fake Bom text
+                                in parser state)
 
 -- | @na@ is the \"non-applicable\" indentation value. We use Haskell's laziness
 -- to verify it really is never used.
diff --git a/YamlReference.cabal b/YamlReference.cabal
--- a/YamlReference.cabal
+++ b/YamlReference.cabal
@@ -1,6 +1,6 @@
 Name:                YamlReference
-Version:             0.9.2
-Cabal-Version:       >= 1.2
+Version:             0.9.3
+Cabal-Version:       >= 1.6
 License:             LGPL
 License-File:        lgpl.txt
 Copyright:           Oren Ben-Kiki 2007, 2008
@@ -22,12 +22,17 @@
                      possible to build interesting tools on top of it, such as
                      the @yeast2html@ YAML syntax visualizer (contained in this
                      package), pretty printers, etc. This is a streaming parser
-                     that will \"immediately\" begin to generate output. Updated
-                     to be compatible with the May 11, 2008 working draft.
+                     that will \"immediately\" begin to generate output.
+                     Updated to be compatible with the final Apr 1, 2009 YAML
+                     1.2 spec.
 Extra-Source-Files:  Text/Yaml/Reference.bnf yeast2html yaml2yeast.css
                      tests/b-as-line-feed.input tests/b-as-line-feed.output
                      tests/b-as-space.input tests/b-as-space.invalid.input
                      tests/b-as-space.invalid.output tests/b-as-space.output
+                     tests/b-break.cr.input tests/b-break.crlf.input
+                     tests/b-break.crlf.output tests/b-break.cr.output
+                     tests/b-break.invalid.input tests/b-break.invalid.output
+                     tests/b-break.lf.input tests/b-break.lf.output
                      tests/b-carriage-return.input
                      tests/b-carriage-return.output tests/b-char.cr.input
                      tests/b-char.cr.output tests/b-char.invalid.input
@@ -40,6 +45,10 @@
                      tests/b-chomped-last.t=keep.output
                      tests/b-chomped-last.t=strip.input
                      tests/b-chomped-last.t=strip.output
+                     tests/b-comment.eof.input tests/b-comment.eof.output
+                     tests/b-comment.invalid.input
+                     tests/b-comment.invalid.output tests/b-comment.lf.input
+                     tests/b-comment.lf.output
                      tests/b-l-folded.n=4.c=flow-in.as-space.input
                      tests/b-l-folded.n=4.c=flow-in.as-space.output
                      tests/b-l-folded.n=4.c=flow-in.invalid.input
@@ -95,13 +104,17 @@
                      tests/c-collect-entry.input tests/c-collect-entry.output
                      tests/c-comment.input tests/c-comment.output
                      tests/c-directive.input tests/c-directive.output
-                     tests/c-document-end.input
+                     tests/c-directives-end.input
+                     tests/c-directives-end.invalid.input
+                     tests/c-directives-end.invalid.output
+                     tests/c-directives-end.output tests/c-document-end.input
                      tests/c-document-end.invalid.input
                      tests/c-document-end.invalid.output
-                     tests/c-document-end.output tests/c-document-start.input
-                     tests/c-document-start.invalid.input
-                     tests/c-document-start.invalid.output
-                     tests/c-document-start.output
+                     tests/c-document-end.output
+                     tests/c-double-quoted.n=0.c=flow-out.input
+                     tests/c-double-quoted.n=0.c=flow-out.output
+                     tests/c-double-quoted.n=2.c=flow-out.input
+                     tests/c-double-quoted.n=2.c=flow-out.output
                      tests/c-double-quoted.n=4.c=flow-out.input
                      tests/c-double-quoted.n=4.c=flow-out.invalid.input
                      tests/c-double-quoted.n=4.c=flow-out.invalid.output
@@ -145,8 +158,10 @@
                      tests/c-flow-mapping.n=4.c=flow-in.spaced.output
                      tests/c-flow-sequence.n=4.c=flow-in.compact.input
                      tests/c-flow-sequence.n=4.c=flow-in.compact.output
+                     tests/c-flow-sequence.n=4.c=flow-in.::.input
                      tests/c-flow-sequence.n=4.c=flow-in.invalid.input
                      tests/c-flow-sequence.n=4.c=flow-in.invalid.output
+                     tests/c-flow-sequence.n=4.c=flow-in.::.output
                      tests/c-flow-sequence.n=4.c=flow-in.spaced.input
                      tests/c-flow-sequence.n=4.c=flow-in.spaced.output
                      tests/c-folded.input tests/c-folded.output
@@ -201,20 +216,6 @@
                      tests/c-indicator.single-quote.input
                      tests/c-indicator.single-quote.output
                      tests/c-indicator.tag.input tests/c-indicator.tag.output
-                     tests/c-json.10000.input tests/c-json.10000.output
-                     tests/c-json.10ffff.input tests/c-json.10ffff.output
-                     tests/c-json.cr.input tests/c-json.cr.output
-                     tests/c-json.d7ff.input tests/c-json.d7ff.output
-                     tests/c-json.e000.input tests/c-json.e000.output
-                     tests/c-json.fffd.input tests/c-json.fffd.output
-                     tests/c-json.ff.input tests/c-json.ff.output
-                     tests/c-json.invalid.input tests/c-json.invalid.output
-                     tests/c-json.lf.input tests/c-json.lf.output
-                     tests/c-json.nbsp.input tests/c-json.nbsp.output
-                     tests/c-json.nel.input tests/c-json.nel.output
-                     tests/c-json.sp.input tests/c-json.sp.output
-                     tests/c-json.tab.input tests/c-json.tab.output
-                     tests/c-json.tilde.input tests/c-json.tilde.output
                      tests/c-l-block-map-explicit-entry.n=2.input
                      tests/c-l-block-map-explicit-entry.n=2.invalid.input
                      tests/c-l-block-map-explicit-entry.n=2.invalid.output
@@ -410,12 +411,18 @@
                      tests/c-sequence-end.input tests/c-sequence-end.output
                      tests/c-sequence-entry.input tests/c-sequence-entry.output
                      tests/c-sequence-start.input tests/c-sequence-start.output
-                     tests/c-s-implicit-json-key.just.input
-                     tests/c-s-implicit-json-key.just.output
-                     tests/c-s-implicit-json-key.long.input
-                     tests/c-s-implicit-json-key.long.output
-                     tests/c-s-implicit-json-key.short.input
-                     tests/c-s-implicit-json-key.short.output
+                     tests/c-s-implicit-json-key.c=flow-key.invalid.input
+                     tests/c-s-implicit-json-key.c=flow-key.invalid.output
+                     tests/c-s-implicit-json-key.c=flow-key.just.input
+                     tests/c-s-implicit-json-key.c=flow-key.just.output
+                     tests/c-s-implicit-json-key.c=flow-key.long.input
+                     tests/c-s-implicit-json-key.c=flow-key.long.output
+                     tests/c-s-implicit-json-key.c=flow-key.short.input
+                     tests/c-s-implicit-json-key.c=flow-key.short.output
+                     tests/c-single-quoted.n=0.c=flow-out.input
+                     tests/c-single-quoted.n=0.c=flow-out.output
+                     tests/c-single-quoted.n=2.c=flow-out.input
+                     tests/c-single-quoted.n=2.c=flow-out.output
                      tests/c-single-quoted.n=4.c=flow-out.input
                      tests/c-single-quoted.n=4.c=flow-out.invalid.input
                      tests/c-single-quoted.n=4.c=flow-out.invalid.output
@@ -440,7 +447,19 @@
                      tests/detect-scalar-indentation.n=2.input
                      tests/detect-scalar-indentation.n=2.output
                      tests/e-node.input tests/e-node.output
-                     tests/e-scalar.input tests/e-scalar.output tests/junk
+                     tests/e-scalar.input tests/e-scalar.output
+                     tests/l-any-document.bare.input
+                     tests/l-any-document.bare.output
+                     tests/l-any-document.directives.input
+                     tests/l-any-document.directives.output
+                     tests/l-any-document.explicit.input
+                     tests/l-any-document.explicit.output
+                     tests/l-bare-document.invalid.input
+                     tests/l-bare-document.invalid.output
+                     tests/l-bare-document.literal.input
+                     tests/l-bare-document.literal.output
+                     tests/l-bare-document.plain.input
+                     tests/l-bare-document.plain.output
                      tests/l-block-map-explicit-value.n=2.input
                      tests/l-block-map-explicit-value.n=2.invalid.input
                      tests/l-block-map-explicit-value.n=2.invalid.output
@@ -461,6 +480,7 @@
                      tests/l-chomped-empty.n=4.t=keep.output
                      tests/l-chomped-empty.n=4.t=strip.input
                      tests/l-chomped-empty.n=4.t=strip.output
+                     tests/l-comment.break.input tests/l-comment.break.output
                      tests/l-comment.empty.input tests/l-comment.empty.output
                      tests/l-comment.invalid.input
                      tests/l-comment.invalid.output
@@ -470,6 +490,8 @@
                      tests/l-directive.invalid.output
                      tests/l-directive.reserved.input
                      tests/l-directive.reserved.output
+                     tests/l-directives-document.input
+                     tests/l-directives-document.output
                      tests/l-directive.tag.input
                      tests/l-directive.tag.invalid.input
                      tests/l-directive.tag.invalid.output
@@ -487,10 +509,6 @@
                      tests/l-document-prefix.empty.output
                      tests/l-document-prefix.invalid.input
                      tests/l-document-prefix.invalid.output
-                     tests/l-documents.explicit.input
-                     tests/l-documents.explicit.output
-                     tests/l-documents.implicit.input
-                     tests/l-documents.implicit.output
                      tests/l-document-suffix.input
                      tests/l-document-suffix.invalid.input
                      tests/l-document-suffix.invalid.output
@@ -511,34 +529,14 @@
                      tests/l-explicit-document.invalid.output
                      tests/l-explicit-document.literal.input
                      tests/l-explicit-document.literal.output
-                     tests/l-explicit-document.plain.input
-                     tests/l-explicit-document.plain.output
                      tests/l-folded-content.n=4.t=strip.input
                      tests/l-folded-content.n=4.t=strip.invalid.input
                      tests/l-folded-content.n=4.t=strip.invalid.output
                      tests/l-folded-content.n=4.t=strip.output
-                     tests/l-following-document.empty.input
-                     tests/l-following-document.empty.output
-                     tests/l-following-document.explicit.input
-                     tests/l-following-document.explicit.output
-                     tests/l-following-document.invalid.input
-                     tests/l-following-document.invalid.output
-                     tests/l-implicit-document.invalid.input
-                     tests/l-implicit-document.invalid.output
-                     tests/l-implicit-document.literal.input
-                     tests/l-implicit-document.literal.output
-                     tests/l-implicit-document.plain.input
-                     tests/l-implicit-document.plain.output
                      tests/l-keep-empty.n=4.0.input
                      tests/l-keep-empty.n=4.0.output
                      tests/l-keep-empty.n=4.1.input
                      tests/l-keep-empty.n=4.1.output
-                     tests/l-leading-document.empty.input
-                     tests/l-leading-document.empty.output
-                     tests/l-leading-document.explicit.input
-                     tests/l-leading-document.explicit.output
-                     tests/l-leading-document.implicit.input
-                     tests/l-leading-document.implicit.output
                      tests/l-literal-content.n=4.t=strip.input
                      tests/l-literal-content.n=4.t=strip.invalid.input
                      tests/l-literal-content.n=4.t=strip.invalid.output
@@ -573,15 +571,29 @@
                      tests/l-trail-comments.n=4.3.output
                      tests/l-trail-comments.n=4.invalid.input
                      tests/l-trail-comments.n=4.invalid.output
+                     tests/l-yaml-stream.bare.input
+                     tests/l-yaml-stream.bare.output
+                     tests/l-yaml-stream.directives.input
+                     tests/l-yaml-stream.directives.invalid.input
+                     tests/l-yaml-stream.directives.invalid.output
+                     tests/l-yaml-stream.directives.output
                      tests/l-yaml-stream.empty.input
                      tests/l-yaml-stream.empty.output
                      tests/l-yaml-stream.explicit.input
                      tests/l-yaml-stream.explicit.output
-                     tests/l-yaml-stream.implicit.input
-                     tests/l-yaml-stream.implicit.output tests/nb-char.input
-                     tests/nb-char.invalid.input tests/nb-char.invalid.output
-                     tests/nb-char.output tests/nb-double-char.a.input
-                     tests/nb-double-char.a.output
+                     tests/l-yaml-stream.map-no-eof.input
+                     tests/l-yaml-stream.map-no-eof.output
+                     tests/l-yaml-stream.plain-no-eof.input
+                     tests/l-yaml-stream.plain-no-eof.output
+                     tests/l-yaml-stream.unparsed-docs.input
+                     tests/l-yaml-stream.unparsed-docs.output
+                     tests/l-yaml-stream.unparsed-map.input
+                     tests/l-yaml-stream.unparsed-map.output
+                     tests/l-yaml-stream.unparsed-seq.input
+                     tests/l-yaml-stream.unparsed-seq.output
+                     tests/nb-char.input tests/nb-char.invalid.input
+                     tests/nb-char.invalid.output tests/nb-char.output
+                     tests/nb-double-char.a.input tests/nb-double-char.a.output
                      tests/nb-double-char.backslash.invalid.input
                      tests/nb-double-char.backslash.invalid.output
                      tests/nb-double-char.double-quote.invalid.input
@@ -600,8 +612,19 @@
                      tests/nb-double-text.n=4.c=flow-key.output
                      tests/nb-double-text.n=4.c=flow-out.input
                      tests/nb-double-text.n=4.c=flow-out.output
+                     tests/nb-json.10000.input tests/nb-json.10000.output
+                     tests/nb-json.10ffff.input tests/nb-json.10ffff.output
+                     tests/nb-json.d7ff.input tests/nb-json.d7ff.output
+                     tests/nb-json.e000.input tests/nb-json.e000.output
+                     tests/nb-json.fffd.input tests/nb-json.fffd.output
+                     tests/nb-json.ff.input tests/nb-json.ff.output
                      tests/nb-json.input tests/nb-json.invalid.input
-                     tests/nb-json.invalid.output tests/nb-json.output
+                     tests/nb-json.invalid.output tests/nb-json.nbsp.input
+                     tests/nb-json.nbsp.output tests/nb-json.nel.input
+                     tests/nb-json.nel.output tests/nb-json.output
+                     tests/nb-json.sp.input tests/nb-json.sp.output
+                     tests/nb-json.tab.input tests/nb-json.tab.output
+                     tests/nb-json.tilde.input tests/nb-json.tilde.output
                      tests/nb-ns-double-in-line.input
                      tests/nb-ns-double-in-line.invalid.input
                      tests/nb-ns-double-in-line.invalid.output
@@ -616,14 +639,6 @@
                      tests/nb-ns-single-in-line.invalid.input
                      tests/nb-ns-single-in-line.invalid.output
                      tests/nb-ns-single-in-line.output
-                     tests/nb-plain-char.c=flow-in.invalid.input
-                     tests/nb-plain-char.c=flow-in.invalid.output
-                     tests/nb-plain-char.c=flow-in.space.input
-                     tests/nb-plain-char.c=flow-in.space.output
-                     tests/nb-plain-char.c=flow-out.a.input
-                     tests/nb-plain-char.c=flow-out.a.output
-                     tests/nb-plain-char.c=flow-out.comma.input
-                     tests/nb-plain-char.c=flow-out.comma.output
                      tests/nb-single-char.escaped.input
                      tests/nb-single-char.escaped.output
                      tests/nb-single-char.invalid.input
@@ -853,12 +868,14 @@
                      tests/ns-plain.n=1.c=flow-key.dc.output
                      tests/ns-plain.n=1.c=flow-key.ds.input
                      tests/ns-plain.n=1.c=flow-key.ds.output
+                     tests/ns-plain.n=1.c=flow-key.::.input
                      tests/ns-plain.n=1.c=flow-key.ka.input
                      tests/ns-plain.n=1.c=flow-key.ka.output
                      tests/ns-plain.n=1.c=flow-key.kc.input
                      tests/ns-plain.n=1.c=flow-key.kc.output
                      tests/ns-plain.n=1.c=flow-key.ks.input
                      tests/ns-plain.n=1.c=flow-key.ks.output
+                     tests/ns-plain.n=1.c=flow-key.::.output
                      tests/ns-plain.n=1.c=flow-key.va.input
                      tests/ns-plain.n=1.c=flow-key.va.output
                      tests/ns-plain.n=1.c=flow-key.vc.input
@@ -927,12 +944,16 @@
                      tests/ns-s-flow-seq-entries.n=4.c=flow-in.multi.output
                      tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.input
                      tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.output
-                     tests/ns-s-implicit-yaml-key.just.input
-                     tests/ns-s-implicit-yaml-key.just.output
-                     tests/ns-s-implicit-yaml-key.long.input
-                     tests/ns-s-implicit-yaml-key.long.output
-                     tests/ns-s-implicit-yaml-key.short.input
-                     tests/ns-s-implicit-yaml-key.short.output
+                     tests/ns-s-implicit-yaml-key.c=block-key.short.input
+                     tests/ns-s-implicit-yaml-key.c=block-key.short.output
+                     tests/ns-s-implicit-yaml-key.c=flow-key.invalid.input
+                     tests/ns-s-implicit-yaml-key.c=flow-key.invalid.output
+                     tests/ns-s-implicit-yaml-key.c=flow-key.just.input
+                     tests/ns-s-implicit-yaml-key.c=flow-key.just.output
+                     tests/ns-s-implicit-yaml-key.c=flow-key.long.input
+                     tests/ns-s-implicit-yaml-key.c=flow-key.long.output
+                     tests/ns-s-implicit-yaml-key.c=flow-key.short.input
+                     tests/ns-s-implicit-yaml-key.c=flow-key.short.output
                      tests/ns-single-char.input
                      tests/ns-single-char.invalid.input
                      tests/ns-single-char.invalid.output
@@ -1007,7 +1028,9 @@
                      tests/ns-yaml-directive.output tests/ns-yaml-version.input
                      tests/ns-yaml-version.invalid.input
                      tests/ns-yaml-version.invalid.output
-                     tests/ns-yaml-version.output tests/s-b-comment.empty.input
+                     tests/ns-yaml-version.output tests/s-b-comment.break.input
+                     tests/s-b-comment.break.output
+                     tests/s-b-comment.empty.input
                      tests/s-b-comment.empty.output
                      tests/s-b-comment.invalid.input
                      tests/s-b-comment.invalid.output
@@ -1021,6 +1044,28 @@
                      tests/s-block-line-prefix.n=4.invalid.input
                      tests/s-block-line-prefix.n=4.invalid.output
                      tests/s-block-line-prefix.n=4.output
+                     tests/s-double-break.n=4.escaped.input
+                     tests/s-double-break.n=4.escaped.output
+                     tests/s-double-break.n=4.folded.input
+                     tests/s-double-break.n=4.folded.output
+                     tests/s-double-break.n=4.invalid.input
+                     tests/s-double-break.n=4.invalid.output
+                     tests/s-double-escaped.n=2.input
+                     tests/s-double-escaped.n=2.invalid.input
+                     tests/s-double-escaped.n=2.invalid.output
+                     tests/s-double-escaped.n=2.output
+                     tests/s-double-next-line.n=4.input
+                     tests/s-double-next-line.n=4.invalid.input
+                     tests/s-double-next-line.n=4.invalid.output
+                     tests/s-double-next-line.n=4.output
+                     tests/s-flow-folded.n=2.input
+                     tests/s-flow-folded.n=2.output
+                     tests/s-flow-folded.n=4.invalid.input
+                     tests/s-flow-folded.n=4.invalid.output
+                     tests/s-flow-folded.n=4.lf.input
+                     tests/s-flow-folded.n=4.lf.output
+                     tests/s-flow-folded.n=4.sp-lf-lf.input
+                     tests/s-flow-folded.n=4.sp-lf-lf.output
                      tests/s-flow-line-prefix.n=4.indent.input
                      tests/s-flow-line-prefix.n=4.indent.output
                      tests/s-flow-line-prefix.n=4.invalid.input
@@ -1146,28 +1191,10 @@
                      tests/s-nb-spaced-text.n=4.invalid.input
                      tests/s-nb-spaced-text.n=4.invalid.output
                      tests/s-nb-spaced-text.n=4.output
-                     tests/s-ns-double-next-line.n=4.input
-                     tests/s-ns-double-next-line.n=4.invalid.input
-                     tests/s-ns-double-next-line.n=4.invalid.output
-                     tests/s-ns-double-next-line.n=4.output
                      tests/s-ns-plain-next-line.n=4.c=flow-in.input
                      tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.input
                      tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.output
                      tests/s-ns-plain-next-line.n=4.c=flow-in.output
-                     tests/s-ns-single-next-line.n=4.input
-                     tests/s-ns-single-next-line.n=4.invalid.input
-                     tests/s-ns-single-next-line.n=4.invalid.output
-                     tests/s-ns-single-next-line.n=4.output
-                     tests/s-s-double-break.n=4.escaped.input
-                     tests/s-s-double-break.n=4.escaped.output
-                     tests/s-s-double-break.n=4.folded.input
-                     tests/s-s-double-break.n=4.folded.output
-                     tests/s-s-double-break.n=4.invalid.input
-                     tests/s-s-double-break.n=4.invalid.output
-                     tests/s-s-double-escaped.n=2.input
-                     tests/s-s-double-escaped.n=2.invalid.input
-                     tests/s-s-double-escaped.n=2.invalid.output
-                     tests/s-s-double-escaped.n=2.output
                      tests/s-separate-in-line.invalid.input
                      tests/s-separate-in-line.invalid.output
                      tests/s-separate-in-line.sol.input
@@ -1176,8 +1203,6 @@
                      tests/s-separate-in-line.sp.output
                      tests/s-separate-lines.n=4.invalid.input
                      tests/s-separate-lines.n=4.invalid.output
-                     tests/s-separate-lines.n=4.lines.input
-                     tests/s-separate-lines.n=4.lines.output
                      tests/s-separate-lines.n=4.sol.input
                      tests/s-separate-lines.n=4.sol.output
                      tests/s-separate-lines.n=4.sp.input
@@ -1190,25 +1215,20 @@
                      tests/s-separate.n=4.c=flow-key.sp.output
                      tests/s-separate.n=4.c=flow-out.empty.input
                      tests/s-separate.n=4.c=flow-out.empty.output
-                     tests/s-separate.n=4.c=flow-out.line.input
-                     tests/s-separate.n=4.c=flow-out.line.output
                      tests/s-separate.n=4.c=flow-out.sp.input
                      tests/s-separate.n=4.c=flow-out.sp.output
-                     tests/s-s-flow-folded.n=2.input
-                     tests/s-s-flow-folded.n=2.output
-                     tests/s-s-flow-folded.n=4.invalid.input
-                     tests/s-s-flow-folded.n=4.invalid.output
-                     tests/s-s-flow-folded.n=4.lf.input
-                     tests/s-s-flow-folded.n=4.lf.output
-                     tests/s-s-flow-folded.n=4.sp-lf-lf.input
-                     tests/s-s-flow-folded.n=4.sp-lf-lf.output
-                     tests/s-space.input tests/s-space.invalid.input
-                     tests/s-space.invalid.output tests/s-space.output
-                     tests/s-tab.input tests/s-tab.invalid.input
-                     tests/s-tab.invalid.output tests/s-tab.output
-                     tests/s-white.invalid.input tests/s-white.invalid.output
-                     tests/s-white.sp.input tests/s-white.sp.output
-                     tests/s-white.tab.input tests/s-white.tab.output
+                     tests/s-single-next-line.n=4.input
+                     tests/s-single-next-line.n=4.invalid.input
+                     tests/s-single-next-line.n=4.invalid.output
+                     tests/s-single-next-line.n=4.output tests/s-space.input
+                     tests/s-space.invalid.input tests/s-space.invalid.output
+                     tests/s-space.output tests/s-tab.input
+                     tests/s-tab.invalid.input tests/s-tab.invalid.output
+                     tests/s-tab.output tests/s-white.invalid.input
+                     tests/s-white.invalid.output tests/s-white.sp.input
+                     tests/s-white.sp.output tests/s-white.tab.input
+                     tests/s-white.tab.output
+
 Flag small_base
     Description:         Choose the new smaller, split-up base package.
 
@@ -1219,17 +1239,31 @@
     else
         Build-Depends:   base < 3
     Build-Depends:       HUnit >= 1.1, regex-compat >= 0.71, dlist >= 0.2
-    Extensions:          CPP, MultiParamTypeClasses, FunctionalDependencies,
+    if impl(ghc >= 6.10.0)
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
+                         FlexibleInstances, TypeSynonymInstances, PostfixOperators
+    else
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
                          FlexibleInstances, TypeSynonymInstances
 
 Executable yaml2yeast
-    Main-Is:             yaml2yeast/Main.hs
-    Extensions:          CPP, MultiParamTypeClasses, FunctionalDependencies,
+    Hs-Source-Dirs:      yaml2yeast .
+    Main-Is:             Main.hs
+    if impl(ghc >= 6.10.0)
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
+                         FlexibleInstances, TypeSynonymInstances, PostfixOperators
+    else
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
                          FlexibleInstances, TypeSynonymInstances
 
 Executable yaml2yeast-test
-    Main-Is:             yaml2yeast-test/Main.hs
-    Extensions:          CPP, MultiParamTypeClasses, FunctionalDependencies,
+    Hs-Source-Dirs:      yaml2yeast-test .
+    Main-Is:             Main.hs
+    if impl(ghc >= 6.10.0)
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
+                         FlexibleInstances, TypeSynonymInstances, PostfixOperators
+    else
+        Extensions:      CPP, MultiParamTypeClasses, FunctionalDependencies,
                          FlexibleInstances, TypeSynonymInstances
     if flag(small_base)
         Build-Depends:   directory
diff --git a/tests/b-as-line-feed.output b/tests/b-as-line-feed.output
--- a/tests/b-as-line-feed.output
+++ b/tests/b-as-line-feed.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
diff --git a/tests/b-as-space.invalid.output b/tests/b-as-space.invalid.output
--- a/tests/b-as-space.invalid.output
+++ b/tests/b-as-space.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 l\x0a
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 1, C: 1, L: 2, c: 0
+!Unexpected '\x0a'
diff --git a/tests/b-as-space.output b/tests/b-as-space.output
--- a/tests/b-as-space.output
+++ b/tests/b-as-space.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 l\x0a
diff --git a/tests/b-break.cr.input b/tests/b-break.cr.input
new file mode 100644
--- /dev/null
+++ b/tests/b-break.cr.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/b-break.cr.output b/tests/b-break.cr.output
new file mode 100644
--- /dev/null
+++ b/tests/b-break.cr.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\x0d
diff --git a/tests/b-break.crlf.input b/tests/b-break.crlf.input
new file mode 100644
--- /dev/null
+++ b/tests/b-break.crlf.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/b-break.crlf.output b/tests/b-break.crlf.output
new file mode 100644
--- /dev/null
+++ b/tests/b-break.crlf.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\x0d\x0a
diff --git a/tests/b-break.invalid.input b/tests/b-break.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/b-break.invalid.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/b-break.invalid.output b/tests/b-break.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/b-break.invalid.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/b-break.lf.input b/tests/b-break.lf.input
new file mode 100644
--- /dev/null
+++ b/tests/b-break.lf.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/b-break.lf.output b/tests/b-break.lf.output
new file mode 100644
--- /dev/null
+++ b/tests/b-break.lf.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\x0a
diff --git a/tests/b-carriage-return.output b/tests/b-carriage-return.output
--- a/tests/b-carriage-return.output
+++ b/tests/b-carriage-return.output
@@ -1,1 +1,2 @@
-?\x0d
+# B: 0, C: 0, L: 1, c: 0
+-\x0d
diff --git a/tests/b-char.cr.output b/tests/b-char.cr.output
--- a/tests/b-char.cr.output
+++ b/tests/b-char.cr.output
@@ -1,1 +1,2 @@
-?\x0d
+# B: 0, C: 0, L: 1, c: 0
+-\x0d
diff --git a/tests/b-char.invalid.output b/tests/b-char.invalid.output
--- a/tests/b-char.invalid.output
+++ b/tests/b-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/b-char.lf.output b/tests/b-char.lf.output
--- a/tests/b-char.lf.output
+++ b/tests/b-char.lf.output
@@ -1,1 +1,2 @@
-?\x0a
+# B: 0, C: 0, L: 1, c: 0
+-\x0a
diff --git a/tests/b-chomped-last.t=clip.invalid.output b/tests/b-chomped-last.t=clip.invalid.output
--- a/tests/b-chomped-last.t=clip.invalid.output
+++ b/tests/b-chomped-last.t=clip.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/b-chomped-last.t=clip.output b/tests/b-chomped-last.t=clip.output
--- a/tests/b-chomped-last.t=clip.output
+++ b/tests/b-chomped-last.t=clip.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 s
diff --git a/tests/b-chomped-last.t=keep.output b/tests/b-chomped-last.t=keep.output
--- a/tests/b-chomped-last.t=keep.output
+++ b/tests/b-chomped-last.t=keep.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
diff --git a/tests/b-chomped-last.t=strip.output b/tests/b-chomped-last.t=strip.output
--- a/tests/b-chomped-last.t=strip.output
+++ b/tests/b-chomped-last.t=strip.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
diff --git a/tests/b-comment.eof.input b/tests/b-comment.eof.input
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.eof.input
diff --git a/tests/b-comment.eof.output b/tests/b-comment.eof.output
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.eof.output
diff --git a/tests/b-comment.invalid.input b/tests/b-comment.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.invalid.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/b-comment.invalid.output b/tests/b-comment.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.invalid.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/b-comment.lf.input b/tests/b-comment.lf.input
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.lf.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/b-comment.lf.output b/tests/b-comment.lf.output
new file mode 100644
--- /dev/null
+++ b/tests/b-comment.lf.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+b\x0a
diff --git a/tests/b-l-folded.n=4.c=flow-in.as-space.output b/tests/b-l-folded.n=4.c=flow-in.as-space.output
--- a/tests/b-l-folded.n=4.c=flow-in.as-space.output
+++ b/tests/b-l-folded.n=4.c=flow-in.as-space.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 l\x0a
diff --git a/tests/b-l-folded.n=4.c=flow-in.invalid.output b/tests/b-l-folded.n=4.c=flow-in.invalid.output
--- a/tests/b-l-folded.n=4.c=flow-in.invalid.output
+++ b/tests/b-l-folded.n=4.c=flow-in.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/b-l-folded.n=4.c=flow-in.trimmed.output b/tests/b-l-folded.n=4.c=flow-in.trimmed.output
--- a/tests/b-l-folded.n=4.c=flow-in.trimmed.output
+++ b/tests/b-l-folded.n=4.c=flow-in.trimmed.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 L\x0a
diff --git a/tests/b-l-spaced.n=4.invalid.output b/tests/b-l-spaced.n=4.invalid.output
--- a/tests/b-l-spaced.n=4.invalid.output
+++ b/tests/b-l-spaced.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/b-l-spaced.n=4.output b/tests/b-l-spaced.n=4.output
--- a/tests/b-l-spaced.n=4.output
+++ b/tests/b-l-spaced.n=4.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
diff --git a/tests/b-l-trimmed.n=4.c=flow-in.invalid.output b/tests/b-l-trimmed.n=4.c=flow-in.invalid.output
--- a/tests/b-l-trimmed.n=4.c=flow-in.invalid.output
+++ b/tests/b-l-trimmed.n=4.c=flow-in.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
-!$InputFile$: line 2: column 0: Unexpected end of input
+# B: 1, C: 1, L: 2, c: 0
+!Unexpected end of input
diff --git a/tests/b-line-feed.output b/tests/b-line-feed.output
--- a/tests/b-line-feed.output
+++ b/tests/b-line-feed.output
@@ -1,1 +1,2 @@
-?\x0a
+# B: 0, C: 0, L: 1, c: 0
+-\x0a
diff --git a/tests/b-nb-literal-next.n=4.invalid.output b/tests/b-nb-literal-next.n=4.invalid.output
--- a/tests/b-nb-literal-next.n=4.invalid.output
+++ b/tests/b-nb-literal-next.n=4.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
-!$InputFile$: line 2: column 2: Unexpected 'a'
+# B: 3, C: 3, L: 2, c: 2
+!Unexpected 'a'
diff --git a/tests/b-nb-literal-next.n=4.output b/tests/b-nb-literal-next.n=4.output
--- a/tests/b-nb-literal-next.n=4.output
+++ b/tests/b-nb-literal-next.n=4.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 i    
-?  a  
+# B: 8, C: 8, L: 3, c: 4
+-  a  
diff --git a/tests/b-non-content.invalid.output b/tests/b-non-content.invalid.output
--- a/tests/b-non-content.invalid.output
+++ b/tests/b-non-content.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/b-non-content.lf.output b/tests/b-non-content.lf.output
--- a/tests/b-non-content.lf.output
+++ b/tests/b-non-content.lf.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
diff --git a/tests/c-alias.output b/tests/c-alias.output
--- a/tests/c-alias.output
+++ b/tests/c-alias.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I*
diff --git a/tests/c-anchor.output b/tests/c-anchor.output
--- a/tests/c-anchor.output
+++ b/tests/c-anchor.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I&
diff --git a/tests/c-b-block-header.n=2.e.output b/tests/c-b-block-header.n=2.e.output
--- a/tests/c-b-block-header.n=2.e.output
+++ b/tests/c-b-block-header.n=2.e.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 $(m,t)=(1,clip)
diff --git a/tests/c-b-block-header.n=2.im.output b/tests/c-b-block-header.n=2.im.output
--- a/tests/c-b-block-header.n=2.im.output
+++ b/tests/c-b-block-header.n=2.im.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 I7
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 $(m,t)=(7,clip)
diff --git a/tests/c-b-block-header.n=2.imt.output b/tests/c-b-block-header.n=2.imt.output
--- a/tests/c-b-block-header.n=2.imt.output
+++ b/tests/c-b-block-header.n=2.imt.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 I7
+# B: 1, C: 1, L: 1, c: 1
 I-
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 $(m,t)=(7,strip)
diff --git a/tests/c-b-block-header.n=2.it.output b/tests/c-b-block-header.n=2.it.output
--- a/tests/c-b-block-header.n=2.it.output
+++ b/tests/c-b-block-header.n=2.it.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 $(m,t)=(1,strip)
diff --git a/tests/c-b-block-header.n=2.itm.output b/tests/c-b-block-header.n=2.itm.output
--- a/tests/c-b-block-header.n=2.itm.output
+++ b/tests/c-b-block-header.n=2.itm.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 I7
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 $(m,t)=(7,strip)
diff --git a/tests/c-byte-order-mark.invalid.output b/tests/c-byte-order-mark.invalid.output
--- a/tests/c-byte-order-mark.invalid.output
+++ b/tests/c-byte-order-mark.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-byte-order-mark.utf16be.output b/tests/c-byte-order-mark.utf16be.output
--- a/tests/c-byte-order-mark.utf16be.output
+++ b/tests/c-byte-order-mark.utf16be.output
@@ -1,1 +1,2 @@
-UTF16BE
+# B: 0, C: 0, L: 1, c: 0
+UTF-16BE
diff --git a/tests/c-byte-order-mark.utf16le.output b/tests/c-byte-order-mark.utf16le.output
--- a/tests/c-byte-order-mark.utf16le.output
+++ b/tests/c-byte-order-mark.utf16le.output
@@ -1,1 +1,2 @@
-UTF16LE
+# B: 0, C: 0, L: 1, c: 0
+UTF-16LE
diff --git a/tests/c-byte-order-mark.utf32be.output b/tests/c-byte-order-mark.utf32be.output
--- a/tests/c-byte-order-mark.utf32be.output
+++ b/tests/c-byte-order-mark.utf32be.output
@@ -1,1 +1,2 @@
-UTF32BE
+# B: 0, C: 0, L: 1, c: 0
+UTF-32BE
diff --git a/tests/c-byte-order-mark.utf32le.output b/tests/c-byte-order-mark.utf32le.output
--- a/tests/c-byte-order-mark.utf32le.output
+++ b/tests/c-byte-order-mark.utf32le.output
@@ -1,1 +1,2 @@
-UTF32LE
+# B: 0, C: 0, L: 1, c: 0
+UTF-32LE
diff --git a/tests/c-byte-order-mark.utf8.output b/tests/c-byte-order-mark.utf8.output
--- a/tests/c-byte-order-mark.utf8.output
+++ b/tests/c-byte-order-mark.utf8.output
@@ -1,1 +1,2 @@
-UTF8
+# B: 0, C: 0, L: 1, c: 0
+UTF-8
diff --git a/tests/c-chomping-indicator.empty.output b/tests/c-chomping-indicator.empty.output
--- a/tests/c-chomping-indicator.empty.output
+++ b/tests/c-chomping-indicator.empty.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $t=clip
diff --git a/tests/c-chomping-indicator.hyphen.output b/tests/c-chomping-indicator.hyphen.output
--- a/tests/c-chomping-indicator.hyphen.output
+++ b/tests/c-chomping-indicator.hyphen.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 $t=strip
diff --git a/tests/c-chomping-indicator.invalid.output b/tests/c-chomping-indicator.invalid.output
--- a/tests/c-chomping-indicator.invalid.output
+++ b/tests/c-chomping-indicator.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '2'
diff --git a/tests/c-chomping-indicator.plus.output b/tests/c-chomping-indicator.plus.output
--- a/tests/c-chomping-indicator.plus.output
+++ b/tests/c-chomping-indicator.plus.output
@@ -1,3 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I+
-!Commit to 'header' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 $t=keep
diff --git a/tests/c-collect-entry.output b/tests/c-collect-entry.output
--- a/tests/c-collect-entry.output
+++ b/tests/c-collect-entry.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I,
diff --git a/tests/c-comment.output b/tests/c-comment.output
--- a/tests/c-comment.output
+++ b/tests/c-comment.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I#
diff --git a/tests/c-directive.output b/tests/c-directive.output
--- a/tests/c-directive.output
+++ b/tests/c-directive.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I%
diff --git a/tests/c-directives-end.input b/tests/c-directives-end.input
new file mode 100644
--- /dev/null
+++ b/tests/c-directives-end.input
@@ -0,0 +1,1 @@
+---
diff --git a/tests/c-directives-end.invalid.input b/tests/c-directives-end.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/c-directives-end.invalid.input
@@ -0,0 +1,1 @@
+--+
diff --git a/tests/c-directives-end.invalid.output b/tests/c-directives-end.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/c-directives-end.invalid.output
@@ -0,0 +1,2 @@
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '+'
diff --git a/tests/c-directives-end.output b/tests/c-directives-end.output
new file mode 100644
--- /dev/null
+++ b/tests/c-directives-end.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+K---
diff --git a/tests/c-document-end.invalid.output b/tests/c-document-end.invalid.output
--- a/tests/c-document-end.invalid.output
+++ b/tests/c-document-end.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 2: Unexpected '+'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '+'
diff --git a/tests/c-document-end.output b/tests/c-document-end.output
--- a/tests/c-document-end.output
+++ b/tests/c-document-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 k...
diff --git a/tests/c-document-start.input b/tests/c-document-start.input
deleted file mode 100644
--- a/tests/c-document-start.input
+++ /dev/null
@@ -1,1 +0,0 @@
----
diff --git a/tests/c-document-start.invalid.input b/tests/c-document-start.invalid.input
deleted file mode 100644
--- a/tests/c-document-start.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
---+
diff --git a/tests/c-document-start.invalid.output b/tests/c-document-start.invalid.output
deleted file mode 100644
--- a/tests/c-document-start.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 2: Unexpected '+'
diff --git a/tests/c-document-start.output b/tests/c-document-start.output
deleted file mode 100644
--- a/tests/c-document-start.output
+++ /dev/null
@@ -1,1 +0,0 @@
-K---
diff --git a/tests/c-double-quote.output b/tests/c-double-quote.output
--- a/tests/c-double-quote.output
+++ b/tests/c-double-quote.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I"
diff --git a/tests/c-double-quoted.n=0.c=flow-out.input b/tests/c-double-quoted.n=0.c=flow-out.input
new file mode 100644
--- /dev/null
+++ b/tests/c-double-quoted.n=0.c=flow-out.input
@@ -0,0 +1,3 @@
+"
+a
+"
diff --git a/tests/c-double-quoted.n=0.c=flow-out.output b/tests/c-double-quoted.n=0.c=flow-out.output
new file mode 100644
--- /dev/null
+++ b/tests/c-double-quoted.n=0.c=flow-out.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I"
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+l\x0a
+# B: 2, C: 2, L: 2, c: 0
+Ta
+# B: 3, C: 3, L: 2, c: 1
+l\x0a
+# B: 4, C: 4, L: 3, c: 0
+I"
+# B: 5, C: 5, L: 3, c: 1
+s
diff --git a/tests/c-double-quoted.n=2.c=flow-out.input b/tests/c-double-quoted.n=2.c=flow-out.input
new file mode 100644
--- /dev/null
+++ b/tests/c-double-quoted.n=2.c=flow-out.input
@@ -0,0 +1,1 @@
+" a "
diff --git a/tests/c-double-quoted.n=2.c=flow-out.output b/tests/c-double-quoted.n=2.c=flow-out.output
new file mode 100644
--- /dev/null
+++ b/tests/c-double-quoted.n=2.c=flow-out.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I"
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+T a 
+# B: 4, C: 4, L: 1, c: 4
+I"
+# B: 5, C: 5, L: 1, c: 5
+s
diff --git a/tests/c-double-quoted.n=4.c=flow-out.invalid.output b/tests/c-double-quoted.n=4.c=flow-out.invalid.output
--- a/tests/c-double-quoted.n=4.c=flow-out.invalid.output
+++ b/tests/c-double-quoted.n=4.c=flow-out.invalid.output
@@ -1,5 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ta
-!$InputFile$: line 1: column 2: Unexpected '\x0a'
+# B: 2, C: 2, L: 1, c: 2
+s
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '\x0a'
diff --git a/tests/c-double-quoted.n=4.c=flow-out.output b/tests/c-double-quoted.n=4.c=flow-out.output
--- a/tests/c-double-quoted.n=4.c=flow-out.output
+++ b/tests/c-double-quoted.n=4.c=flow-out.output
@@ -1,11 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 T a
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 l\x0a
+# B: 5, C: 5, L: 2, c: 0
 i    
+# B: 9, C: 9, L: 2, c: 4
 w\x09
+# B: 10, C: 10, L: 2, c: 5
 Ta b\x09c 
+# B: 16, C: 16, L: 2, c: 11
 I"
+# B: 17, C: 17, L: 2, c: 12
 s
diff --git a/tests/c-escape.invalid.output b/tests/c-escape.invalid.output
--- a/tests/c-escape.invalid.output
+++ b/tests/c-escape.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-escape.output b/tests/c-escape.output
--- a/tests/c-escape.output
+++ b/tests/c-escape.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
diff --git a/tests/c-flow-indicator.collect-entry.output b/tests/c-flow-indicator.collect-entry.output
--- a/tests/c-flow-indicator.collect-entry.output
+++ b/tests/c-flow-indicator.collect-entry.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I,
diff --git a/tests/c-flow-indicator.invalid.output b/tests/c-flow-indicator.invalid.output
--- a/tests/c-flow-indicator.invalid.output
+++ b/tests/c-flow-indicator.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '-'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '-'
diff --git a/tests/c-flow-indicator.mapping-end.output b/tests/c-flow-indicator.mapping-end.output
--- a/tests/c-flow-indicator.mapping-end.output
+++ b/tests/c-flow-indicator.mapping-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I}
diff --git a/tests/c-flow-indicator.mapping-start.output b/tests/c-flow-indicator.mapping-start.output
--- a/tests/c-flow-indicator.mapping-start.output
+++ b/tests/c-flow-indicator.mapping-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I{
diff --git a/tests/c-flow-indicator.sequence-end.output b/tests/c-flow-indicator.sequence-end.output
--- a/tests/c-flow-indicator.sequence-end.output
+++ b/tests/c-flow-indicator.sequence-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I]
diff --git a/tests/c-flow-indicator.sequence-start.output b/tests/c-flow-indicator.sequence-start.output
--- a/tests/c-flow-indicator.sequence-start.output
+++ b/tests/c-flow-indicator.sequence-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I[
diff --git a/tests/c-flow-json-content.n=4.c=flow-in.double.output b/tests/c-flow-json-content.n=4.c=flow-in.double.output
--- a/tests/c-flow-json-content.n=4.c=flow-in.double.output
+++ b/tests/c-flow-json-content.n=4.c=flow-in.double.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
diff --git a/tests/c-flow-json-content.n=4.c=flow-in.invalid.output b/tests/c-flow-json-content.n=4.c=flow-in.invalid.output
--- a/tests/c-flow-json-content.n=4.c=flow-in.invalid.output
+++ b/tests/c-flow-json-content.n=4.c=flow-in.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '|'
diff --git a/tests/c-flow-json-content.n=4.c=flow-in.mapping.output b/tests/c-flow-json-content.n=4.c=flow-in.mapping.output
--- a/tests/c-flow-json-content.n=4.c=flow-in.mapping.output
+++ b/tests/c-flow-json-content.n=4.c=flow-in.mapping.output
@@ -1,20 +1,40 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 I{
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I:
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 x
+# B: 5, C: 5, L: 1, c: 5
 I}
+# B: 6, C: 6, L: 1, c: 6
 m
diff --git a/tests/c-flow-json-content.n=4.c=flow-in.sequence.output b/tests/c-flow-json-content.n=4.c=flow-in.sequence.output
--- a/tests/c-flow-json-content.n=4.c=flow-in.sequence.output
+++ b/tests/c-flow-json-content.n=4.c=flow-in.sequence.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I[
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I]
+# B: 3, C: 3, L: 1, c: 3
 q
diff --git a/tests/c-flow-json-node.n=4.c=flow-in.invalid.output b/tests/c-flow-json-node.n=4.c=flow-in.invalid.output
--- a/tests/c-flow-json-node.n=4.c=flow-in.invalid.output
+++ b/tests/c-flow-json-node.n=4.c=flow-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-flow-json-node.n=4.c=flow-in.tagged.output b/tests/c-flow-json-node.n=4.c=flow-in.tagged.output
--- a/tests/c-flow-json-node.n=4.c=flow-in.tagged.output
+++ b/tests/c-flow-json-node.n=4.c=flow-in.tagged.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 I"
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Ta
+# B: 5, C: 5, L: 1, c: 5
 I"
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
diff --git a/tests/c-flow-json-node.n=4.c=flow-in.untagged.output b/tests/c-flow-json-node.n=4.c=flow-in.untagged.output
--- a/tests/c-flow-json-node.n=4.c=flow-in.untagged.output
+++ b/tests/c-flow-json-node.n=4.c=flow-in.untagged.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/c-flow-mapping.n=4.c=flow-in.compact.output b/tests/c-flow-mapping.n=4.c=flow-in.compact.output
--- a/tests/c-flow-mapping.n=4.c=flow-in.compact.output
+++ b/tests/c-flow-mapping.n=4.c=flow-in.compact.output
@@ -1,62 +1,124 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 I{
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 I"
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 I"
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 I:
+# B: 5, C: 5, L: 1, c: 5
 N
+# B: 5, C: 5, L: 1, c: 5
 S
+# B: 6, C: 6, L: 1, c: 6
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 Tb
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
+# B: 6, C: 6, L: 1, c: 6
 x
+# B: 6, C: 6, L: 1, c: 6
 I,
+# B: 7, C: 7, L: 1, c: 7
 X
+# B: 7, C: 7, L: 1, c: 7
 I?
+# B: 8, C: 8, L: 1, c: 8
 w 
+# B: 9, C: 9, L: 1, c: 9
 N
+# B: 9, C: 9, L: 1, c: 9
 S
+# B: 9, C: 9, L: 1, c: 9
 Tc
+# B: 10, C: 10, L: 1, c: 10
 s
+# B: 10, C: 10, L: 1, c: 10
 n
+# B: 10, C: 10, L: 1, c: 10
 N
+# B: 10, C: 10, L: 1, c: 10
 S
+# B: 10, C: 10, L: 1, c: 10
 s
+# B: 10, C: 10, L: 1, c: 10
 n
+# B: 10, C: 10, L: 1, c: 10
 x
+# B: 10, C: 10, L: 1, c: 10
 I,
+# B: 11, C: 11, L: 1, c: 11
 X
+# B: 11, C: 11, L: 1, c: 11
 N
+# B: 11, C: 11, L: 1, c: 11
 S
+# B: 11, C: 11, L: 1, c: 11
 s
+# B: 11, C: 11, L: 1, c: 11
 n
+# B: 11, C: 11, L: 1, c: 11
 I:
+# B: 12, C: 12, L: 1, c: 12
 w 
+# B: 13, C: 13, L: 1, c: 13
 N
+# B: 13, C: 13, L: 1, c: 13
 S
+# B: 14, C: 14, L: 1, c: 14
 !Commit to 'node' was made outside it
+# B: 13, C: 13, L: 1, c: 13
 Td
+# B: 14, C: 14, L: 1, c: 14
 s
+# B: 14, C: 14, L: 1, c: 14
 n
+# B: 14, C: 14, L: 1, c: 14
 x
+# B: 14, C: 14, L: 1, c: 14
 I,
+# B: 15, C: 15, L: 1, c: 15
 X
+# B: 15, C: 15, L: 1, c: 15
 N
+# B: 15, C: 15, L: 1, c: 15
 S
+# B: 15, C: 15, L: 1, c: 15
 Te
+# B: 16, C: 16, L: 1, c: 16
 s
+# B: 16, C: 16, L: 1, c: 16
 n
+# B: 16, C: 16, L: 1, c: 16
 N
+# B: 16, C: 16, L: 1, c: 16
 S
+# B: 16, C: 16, L: 1, c: 16
 s
+# B: 16, C: 16, L: 1, c: 16
 n
+# B: 16, C: 16, L: 1, c: 16
 x
+# B: 16, C: 16, L: 1, c: 16
 I}
+# B: 17, C: 17, L: 1, c: 17
 m
diff --git a/tests/c-flow-mapping.n=4.c=flow-in.invalid.output b/tests/c-flow-mapping.n=4.c=flow-in.invalid.output
--- a/tests/c-flow-mapping.n=4.c=flow-in.invalid.output
+++ b/tests/c-flow-mapping.n=4.c=flow-in.invalid.output
@@ -1,15 +1,32 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 I{
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 x
-!$InputFile$: line 1: column 2: Unexpected end of input
+# B: 2, C: 2, L: 1, c: 2
+m
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected end of input
diff --git a/tests/c-flow-mapping.n=4.c=flow-in.long.output b/tests/c-flow-mapping.n=4.c=flow-in.long.output
--- a/tests/c-flow-mapping.n=4.c=flow-in.long.output
+++ b/tests/c-flow-mapping.n=4.c=flow-in.long.output
@@ -1,23 +1,46 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 I{
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 I"
+# B: 2, C: 2, L: 1, c: 2
 T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdeX
+# B: 1025, C: 1025, L: 1, c: 1025
 I"
+# B: 1026, C: 1026, L: 1, c: 1026
 s
+# B: 1026, C: 1026, L: 1, c: 1026
 n
+# B: 1026, C: 1026, L: 1, c: 1026
 I:
+# B: 1027, C: 1027, L: 1, c: 1027
 N
+# B: 1027, C: 1027, L: 1, c: 1027
 S
+# B: 1027, C: 1027, L: 1, c: 1027
 I"
+# B: 1028, C: 1028, L: 1, c: 1028
 !Commit to 'node' was made outside it
+# B: 1028, C: 1028, L: 1, c: 1028
 Tvalue
+# B: 1033, C: 1033, L: 1, c: 1033
 I"
+# B: 1034, C: 1034, L: 1, c: 1034
 s
+# B: 1034, C: 1034, L: 1, c: 1034
 n
+# B: 1034, C: 1034, L: 1, c: 1034
 x
+# B: 1034, C: 1034, L: 1, c: 1034
 I}
+# B: 1035, C: 1035, L: 1, c: 1035
 m
diff --git a/tests/c-flow-mapping.n=4.c=flow-in.spaced.output b/tests/c-flow-mapping.n=4.c=flow-in.spaced.output
--- a/tests/c-flow-mapping.n=4.c=flow-in.spaced.output
+++ b/tests/c-flow-mapping.n=4.c=flow-in.spaced.output
@@ -1,72 +1,144 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 I{
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 X
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 Ta
+# B: 4, C: 4, L: 1, c: 4
 I"
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 I:
+# B: 7, C: 7, L: 1, c: 7
 w 
+# B: 8, C: 8, L: 1, c: 8
 N
+# B: 8, C: 8, L: 1, c: 8
 S
+# B: 9, C: 9, L: 1, c: 9
 !Commit to 'node' was made outside it
+# B: 8, C: 8, L: 1, c: 8
 Tb
+# B: 9, C: 9, L: 1, c: 9
 s
+# B: 9, C: 9, L: 1, c: 9
 n
+# B: 9, C: 9, L: 1, c: 9
 x
+# B: 9, C: 9, L: 1, c: 9
 I,
+# B: 10, C: 10, L: 1, c: 10
 w 
+# B: 11, C: 11, L: 1, c: 11
 X
+# B: 11, C: 11, L: 1, c: 11
 I?
+# B: 12, C: 12, L: 1, c: 12
 w 
+# B: 13, C: 13, L: 1, c: 13
 N
+# B: 13, C: 13, L: 1, c: 13
 S
+# B: 13, C: 13, L: 1, c: 13
 Tc
+# B: 14, C: 14, L: 1, c: 14
 s
+# B: 14, C: 14, L: 1, c: 14
 n
+# B: 14, C: 14, L: 1, c: 14
 N
+# B: 14, C: 14, L: 1, c: 14
 S
+# B: 14, C: 14, L: 1, c: 14
 s
+# B: 14, C: 14, L: 1, c: 14
 n
+# B: 14, C: 14, L: 1, c: 14
 x
+# B: 14, C: 14, L: 1, c: 14
 I,
+# B: 15, C: 15, L: 1, c: 15
 w 
+# B: 16, C: 16, L: 1, c: 16
 X
+# B: 16, C: 16, L: 1, c: 16
 N
+# B: 16, C: 16, L: 1, c: 16
 S
+# B: 16, C: 16, L: 1, c: 16
 s
+# B: 16, C: 16, L: 1, c: 16
 n
+# B: 16, C: 16, L: 1, c: 16
 I:
+# B: 17, C: 17, L: 1, c: 17
 w 
+# B: 18, C: 18, L: 1, c: 18
 N
+# B: 18, C: 18, L: 1, c: 18
 S
+# B: 19, C: 19, L: 1, c: 19
 !Commit to 'node' was made outside it
+# B: 18, C: 18, L: 1, c: 18
 Td
+# B: 19, C: 19, L: 1, c: 19
 s
+# B: 19, C: 19, L: 1, c: 19
 n
+# B: 19, C: 19, L: 1, c: 19
 x
+# B: 19, C: 19, L: 1, c: 19
 w 
+# B: 20, C: 20, L: 1, c: 20
 I,
+# B: 21, C: 21, L: 1, c: 21
 w 
+# B: 22, C: 22, L: 1, c: 22
 X
+# B: 22, C: 22, L: 1, c: 22
 N
+# B: 22, C: 22, L: 1, c: 22
 S
+# B: 22, C: 22, L: 1, c: 22
 Te
+# B: 23, C: 23, L: 1, c: 23
 s
+# B: 23, C: 23, L: 1, c: 23
 n
+# B: 23, C: 23, L: 1, c: 23
 N
+# B: 23, C: 23, L: 1, c: 23
 S
+# B: 23, C: 23, L: 1, c: 23
 s
+# B: 23, C: 23, L: 1, c: 23
 n
+# B: 23, C: 23, L: 1, c: 23
 x
+# B: 23, C: 23, L: 1, c: 23
 w 
+# B: 24, C: 24, L: 1, c: 24
 I,
+# B: 25, C: 25, L: 1, c: 25
 w 
+# B: 26, C: 26, L: 1, c: 26
 I}
+# B: 27, C: 27, L: 1, c: 27
 m
diff --git a/tests/c-flow-sequence.n=4.c=flow-in.::.input b/tests/c-flow-sequence.n=4.c=flow-in.::.input
new file mode 100644
--- /dev/null
+++ b/tests/c-flow-sequence.n=4.c=flow-in.::.input
@@ -0,0 +1,1 @@
+[ ::std::vector ]
diff --git a/tests/c-flow-sequence.n=4.c=flow-in.::.output b/tests/c-flow-sequence.n=4.c=flow-in.::.output
new file mode 100644
--- /dev/null
+++ b/tests/c-flow-sequence.n=4.c=flow-in.::.output
@@ -0,0 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
+Q
+# B: 0, C: 0, L: 1, c: 0
+I[
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+w 
+# B: 2, C: 2, L: 1, c: 2
+N
+# B: 2, C: 2, L: 1, c: 2
+S
+# B: 2, C: 2, L: 1, c: 2
+T::std::vector
+# B: 15, C: 15, L: 1, c: 15
+s
+# B: 15, C: 15, L: 1, c: 15
+n
+# B: 15, C: 15, L: 1, c: 15
+w 
+# B: 16, C: 16, L: 1, c: 16
+I]
+# B: 17, C: 17, L: 1, c: 17
+q
diff --git a/tests/c-flow-sequence.n=4.c=flow-in.compact.output b/tests/c-flow-sequence.n=4.c=flow-in.compact.output
--- a/tests/c-flow-sequence.n=4.c=flow-in.compact.output
+++ b/tests/c-flow-sequence.n=4.c=flow-in.compact.output
@@ -1,28 +1,56 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I[
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I,
+# B: 3, C: 3, L: 1, c: 3
 M
+# B: 3, C: 3, L: 1, c: 3
 X
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 Tc
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 I:
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 N
+# B: 6, C: 6, L: 1, c: 6
 S
+# B: 7, C: 7, L: 1, c: 7
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 1, c: 6
 Td
+# B: 7, C: 7, L: 1, c: 7
 s
+# B: 7, C: 7, L: 1, c: 7
 n
+# B: 7, C: 7, L: 1, c: 7
 x
+# B: 7, C: 7, L: 1, c: 7
 m
+# B: 7, C: 7, L: 1, c: 7
 I]
+# B: 8, C: 8, L: 1, c: 8
 q
diff --git a/tests/c-flow-sequence.n=4.c=flow-in.invalid.output b/tests/c-flow-sequence.n=4.c=flow-in.invalid.output
--- a/tests/c-flow-sequence.n=4.c=flow-in.invalid.output
+++ b/tests/c-flow-sequence.n=4.c=flow-in.invalid.output
@@ -1,10 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I[
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I,
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+q
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/c-flow-sequence.n=4.c=flow-in.spaced.output b/tests/c-flow-sequence.n=4.c=flow-in.spaced.output
--- a/tests/c-flow-sequence.n=4.c=flow-in.spaced.output
+++ b/tests/c-flow-sequence.n=4.c=flow-in.spaced.output
@@ -1,34 +1,68 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I[
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 I,
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 M
+# B: 6, C: 6, L: 1, c: 6
 X
+# B: 6, C: 6, L: 1, c: 6
 N
+# B: 6, C: 6, L: 1, c: 6
 S
+# B: 6, C: 6, L: 1, c: 6
 Tc
+# B: 7, C: 7, L: 1, c: 7
 s
+# B: 7, C: 7, L: 1, c: 7
 n
+# B: 7, C: 7, L: 1, c: 7
 I:
+# B: 8, C: 8, L: 1, c: 8
 w 
+# B: 9, C: 9, L: 1, c: 9
 N
+# B: 9, C: 9, L: 1, c: 9
 S
+# B: 10, C: 10, L: 1, c: 10
 !Commit to 'node' was made outside it
+# B: 9, C: 9, L: 1, c: 9
 Td
+# B: 10, C: 10, L: 1, c: 10
 s
+# B: 10, C: 10, L: 1, c: 10
 n
+# B: 10, C: 10, L: 1, c: 10
 x
+# B: 10, C: 10, L: 1, c: 10
 m
+# B: 10, C: 10, L: 1, c: 10
 w 
+# B: 11, C: 11, L: 1, c: 11
 I,
+# B: 12, C: 12, L: 1, c: 12
 w 
+# B: 13, C: 13, L: 1, c: 13
 I]
+# B: 14, C: 14, L: 1, c: 14
 q
diff --git a/tests/c-folded.output b/tests/c-folded.output
--- a/tests/c-folded.output
+++ b/tests/c-folded.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I>
diff --git a/tests/c-forbidden.end-space.output b/tests/c-forbidden.end-space.output
--- a/tests/c-forbidden.end-space.output
+++ b/tests/c-forbidden.end-space.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 k...
-? 
+# B: 3, C: 3, L: 1, c: 3
+- 
diff --git a/tests/c-forbidden.invalid.output b/tests/c-forbidden.invalid.output
--- a/tests/c-forbidden.invalid.output
+++ b/tests/c-forbidden.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 K---
-!$InputFile$: line 1: column 3: Expected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected '-'
diff --git a/tests/c-forbidden.start-lf.output b/tests/c-forbidden.start-lf.output
--- a/tests/c-forbidden.start-lf.output
+++ b/tests/c-forbidden.start-lf.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 K---
-?\x0a
+# B: 3, C: 3, L: 1, c: 3
+-\x0a
diff --git a/tests/c-forbidden.start.output b/tests/c-forbidden.start.output
--- a/tests/c-forbidden.start.output
+++ b/tests/c-forbidden.start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 K---
diff --git a/tests/c-indentation-indicator.n=0.invalid.output b/tests/c-indentation-indicator.n=0.invalid.output
--- a/tests/c-indentation-indicator.n=0.invalid.output
+++ b/tests/c-indentation-indicator.n=0.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '0'
diff --git a/tests/c-indentation-indicator.n=0.output b/tests/c-indentation-indicator.n=0.output
--- a/tests/c-indentation-indicator.n=0.output
+++ b/tests/c-indentation-indicator.n=0.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I7
+# B: 1, C: 1, L: 1, c: 1
 $m=7
diff --git a/tests/c-indicator.alias.output b/tests/c-indicator.alias.output
--- a/tests/c-indicator.alias.output
+++ b/tests/c-indicator.alias.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I*
diff --git a/tests/c-indicator.anchor.output b/tests/c-indicator.anchor.output
--- a/tests/c-indicator.anchor.output
+++ b/tests/c-indicator.anchor.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I&
diff --git a/tests/c-indicator.collect-entry.output b/tests/c-indicator.collect-entry.output
--- a/tests/c-indicator.collect-entry.output
+++ b/tests/c-indicator.collect-entry.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I,
diff --git a/tests/c-indicator.comment.output b/tests/c-indicator.comment.output
--- a/tests/c-indicator.comment.output
+++ b/tests/c-indicator.comment.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I#
diff --git a/tests/c-indicator.directive.output b/tests/c-indicator.directive.output
--- a/tests/c-indicator.directive.output
+++ b/tests/c-indicator.directive.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I%
diff --git a/tests/c-indicator.double-quote.output b/tests/c-indicator.double-quote.output
--- a/tests/c-indicator.double-quote.output
+++ b/tests/c-indicator.double-quote.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I"
diff --git a/tests/c-indicator.folded.output b/tests/c-indicator.folded.output
--- a/tests/c-indicator.folded.output
+++ b/tests/c-indicator.folded.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I>
diff --git a/tests/c-indicator.invalid.output b/tests/c-indicator.invalid.output
--- a/tests/c-indicator.invalid.output
+++ b/tests/c-indicator.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-indicator.literal.output b/tests/c-indicator.literal.output
--- a/tests/c-indicator.literal.output
+++ b/tests/c-indicator.literal.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I|
diff --git a/tests/c-indicator.mapping-end.output b/tests/c-indicator.mapping-end.output
--- a/tests/c-indicator.mapping-end.output
+++ b/tests/c-indicator.mapping-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I}
diff --git a/tests/c-indicator.mapping-key.output b/tests/c-indicator.mapping-key.output
--- a/tests/c-indicator.mapping-key.output
+++ b/tests/c-indicator.mapping-key.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I?
diff --git a/tests/c-indicator.mapping-start.output b/tests/c-indicator.mapping-start.output
--- a/tests/c-indicator.mapping-start.output
+++ b/tests/c-indicator.mapping-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I{
diff --git a/tests/c-indicator.mapping-value.output b/tests/c-indicator.mapping-value.output
--- a/tests/c-indicator.mapping-value.output
+++ b/tests/c-indicator.mapping-value.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
diff --git a/tests/c-indicator.reserved.at.output b/tests/c-indicator.reserved.at.output
--- a/tests/c-indicator.reserved.at.output
+++ b/tests/c-indicator.reserved.at.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I@
diff --git a/tests/c-indicator.reserved.backtick.output b/tests/c-indicator.reserved.backtick.output
--- a/tests/c-indicator.reserved.backtick.output
+++ b/tests/c-indicator.reserved.backtick.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I`
diff --git a/tests/c-indicator.sequence-end.output b/tests/c-indicator.sequence-end.output
--- a/tests/c-indicator.sequence-end.output
+++ b/tests/c-indicator.sequence-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I]
diff --git a/tests/c-indicator.sequence-entry.output b/tests/c-indicator.sequence-entry.output
--- a/tests/c-indicator.sequence-entry.output
+++ b/tests/c-indicator.sequence-entry.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
diff --git a/tests/c-indicator.sequence-start.output b/tests/c-indicator.sequence-start.output
--- a/tests/c-indicator.sequence-start.output
+++ b/tests/c-indicator.sequence-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I[
diff --git a/tests/c-indicator.single-quote.output b/tests/c-indicator.single-quote.output
--- a/tests/c-indicator.single-quote.output
+++ b/tests/c-indicator.single-quote.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I'
diff --git a/tests/c-indicator.tag.output b/tests/c-indicator.tag.output
--- a/tests/c-indicator.tag.output
+++ b/tests/c-indicator.tag.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
diff --git a/tests/c-json.10000.input b/tests/c-json.10000.input
deleted file mode 100644
--- a/tests/c-json.10000.input
+++ /dev/null
@@ -1,1 +0,0 @@
-𐀀
diff --git a/tests/c-json.10000.output b/tests/c-json.10000.output
deleted file mode 100644
--- a/tests/c-json.10000.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\U00010000
diff --git a/tests/c-json.10ffff.input b/tests/c-json.10ffff.input
deleted file mode 100644
--- a/tests/c-json.10ffff.input
+++ /dev/null
@@ -1,1 +0,0 @@
-􏿿
diff --git a/tests/c-json.10ffff.output b/tests/c-json.10ffff.output
deleted file mode 100644
--- a/tests/c-json.10ffff.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\U0010ffff
diff --git a/tests/c-json.cr.input b/tests/c-json.cr.input
deleted file mode 100644
--- a/tests/c-json.cr.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/c-json.cr.output b/tests/c-json.cr.output
deleted file mode 100644
--- a/tests/c-json.cr.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\x0d
diff --git a/tests/c-json.d7ff.input b/tests/c-json.d7ff.input
deleted file mode 100644
--- a/tests/c-json.d7ff.input
+++ /dev/null
@@ -1,1 +0,0 @@
-퟿
diff --git a/tests/c-json.d7ff.output b/tests/c-json.d7ff.output
deleted file mode 100644
--- a/tests/c-json.d7ff.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\ud7ff
diff --git a/tests/c-json.e000.input b/tests/c-json.e000.input
deleted file mode 100644
--- a/tests/c-json.e000.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/c-json.e000.output b/tests/c-json.e000.output
deleted file mode 100644
--- a/tests/c-json.e000.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\ue000
diff --git a/tests/c-json.ff.input b/tests/c-json.ff.input
deleted file mode 100644
--- a/tests/c-json.ff.input
+++ /dev/null
@@ -1,1 +0,0 @@
-ÿ
diff --git a/tests/c-json.ff.output b/tests/c-json.ff.output
deleted file mode 100644
--- a/tests/c-json.ff.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\xff
diff --git a/tests/c-json.fffd.input b/tests/c-json.fffd.input
deleted file mode 100644
--- a/tests/c-json.fffd.input
+++ /dev/null
@@ -1,1 +0,0 @@
-�
diff --git a/tests/c-json.fffd.output b/tests/c-json.fffd.output
deleted file mode 100644
--- a/tests/c-json.fffd.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\ufffd
diff --git a/tests/c-json.invalid.input b/tests/c-json.invalid.input
deleted file mode 100644
--- a/tests/c-json.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/c-json.invalid.output b/tests/c-json.invalid.output
deleted file mode 100644
--- a/tests/c-json.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 0: Unexpected '\x01'
diff --git a/tests/c-json.lf.input b/tests/c-json.lf.input
deleted file mode 100644
--- a/tests/c-json.lf.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/c-json.lf.output b/tests/c-json.lf.output
deleted file mode 100644
--- a/tests/c-json.lf.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\x0a
diff --git a/tests/c-json.nbsp.input b/tests/c-json.nbsp.input
deleted file mode 100644
--- a/tests/c-json.nbsp.input
+++ /dev/null
@@ -1,1 +0,0 @@
- 
diff --git a/tests/c-json.nbsp.output b/tests/c-json.nbsp.output
deleted file mode 100644
--- a/tests/c-json.nbsp.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\xa0
diff --git a/tests/c-json.nel.input b/tests/c-json.nel.input
deleted file mode 100644
--- a/tests/c-json.nel.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/c-json.nel.output b/tests/c-json.nel.output
deleted file mode 100644
--- a/tests/c-json.nel.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\x85
diff --git a/tests/c-json.sp.input b/tests/c-json.sp.input
deleted file mode 100644
--- a/tests/c-json.sp.input
+++ /dev/null
@@ -1,1 +0,0 @@
- 
diff --git a/tests/c-json.sp.output b/tests/c-json.sp.output
deleted file mode 100644
--- a/tests/c-json.sp.output
+++ /dev/null
@@ -1,1 +0,0 @@
-? 
diff --git a/tests/c-json.tab.input b/tests/c-json.tab.input
deleted file mode 100644
--- a/tests/c-json.tab.input
+++ /dev/null
@@ -1,1 +0,0 @@
-	
diff --git a/tests/c-json.tab.output b/tests/c-json.tab.output
deleted file mode 100644
--- a/tests/c-json.tab.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?\x09
diff --git a/tests/c-json.tilde.input b/tests/c-json.tilde.input
deleted file mode 100644
--- a/tests/c-json.tilde.input
+++ /dev/null
@@ -1,1 +0,0 @@
-~
diff --git a/tests/c-json.tilde.output b/tests/c-json.tilde.output
deleted file mode 100644
--- a/tests/c-json.tilde.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?~
diff --git a/tests/c-l+folded.n=2.indent.output b/tests/c-l+folded.n=2.indent.output
--- a/tests/c-l+folded.n=2.indent.output
+++ b/tests/c-l+folded.n=2.indent.output
@@ -1,25 +1,52 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I>
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 I2
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 C
+# B: 3, C: 3, L: 1, c: 3
 I#
+# B: 4, C: 4, L: 1, c: 4
 c
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 i    
+# B: 9, C: 9, L: 2, c: 4
 T a
+# B: 11, C: 11, L: 2, c: 6
 L\x0a
+# B: 12, C: 12, L: 3, c: 0
 i    
+# B: 16, C: 16, L: 3, c: 4
 Tb
+# B: 17, C: 17, L: 3, c: 5
 L\x0a
+# B: 18, C: 18, L: 4, c: 0
 L\x0a
+# B: 19, C: 19, L: 5, c: 0
 i    
+# B: 23, C: 23, L: 5, c: 4
 T c
+# B: 25, C: 25, L: 5, c: 6
 L\x0a
+# B: 26, C: 26, L: 6, c: 0
 s
+# B: 26, C: 26, L: 6, c: 0
 b\x0a
+# B: 27, C: 27, L: 7, c: 0
 i  
+# B: 29, C: 29, L: 7, c: 2
 C
+# B: 29, C: 29, L: 7, c: 2
 I#
+# B: 30, C: 30, L: 7, c: 3
 c
+# B: 30, C: 30, L: 7, c: 3
 b\x0a
diff --git a/tests/c-l+folded.n=2.invalid.output b/tests/c-l+folded.n=2.invalid.output
--- a/tests/c-l+folded.n=2.invalid.output
+++ b/tests/c-l+folded.n=2.invalid.output
@@ -1,4 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I>
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 2, C: 2, L: 2, c: 0
+s
+# B: 2, C: 2, L: 2, c: 0
+!Unexpected ' '
diff --git a/tests/c-l+folded.n=2.simple.output b/tests/c-l+folded.n=2.simple.output
--- a/tests/c-l+folded.n=2.simple.output
+++ b/tests/c-l+folded.n=2.simple.output
@@ -1,7 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I>
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 i    
+# B: 6, C: 6, L: 2, c: 4
 Ta
+# B: 7, C: 7, L: 2, c: 5
 L\x0a
+# B: 8, C: 8, L: 3, c: 0
 s
diff --git a/tests/c-l+literal.n=2.invalid.output b/tests/c-l+literal.n=2.invalid.output
--- a/tests/c-l+literal.n=2.invalid.output
+++ b/tests/c-l+literal.n=2.invalid.output
@@ -1,6 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 I2
+# B: 2, C: 2, L: 1, c: 2
 I-
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 4, C: 4, L: 2, c: 0
+s
+# B: 4, C: 4, L: 2, c: 0
+!Unexpected ' '
diff --git a/tests/c-l+literal.n=2.simple.output b/tests/c-l+literal.n=2.simple.output
--- a/tests/c-l+literal.n=2.simple.output
+++ b/tests/c-l+literal.n=2.simple.output
@@ -1,7 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 i    
+# B: 6, C: 6, L: 2, c: 4
 Ta
+# B: 7, C: 7, L: 2, c: 5
 L\x0a
+# B: 8, C: 8, L: 3, c: 0
 s
diff --git a/tests/c-l+literal.n=2.strip-indent.output b/tests/c-l+literal.n=2.strip-indent.output
--- a/tests/c-l+literal.n=2.strip-indent.output
+++ b/tests/c-l+literal.n=2.strip-indent.output
@@ -1,23 +1,48 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 I-
+# B: 2, C: 2, L: 1, c: 2
 I2
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 i    
+# B: 8, C: 8, L: 2, c: 4
 T# a
+# B: 11, C: 11, L: 2, c: 7
 L\x0a
+# B: 12, C: 12, L: 3, c: 0
 i    
+# B: 16, C: 16, L: 3, c: 4
 Tb
+# B: 17, C: 17, L: 3, c: 5
 L\x0a
+# B: 18, C: 18, L: 4, c: 0
 i    
+# B: 22, C: 22, L: 4, c: 4
 T  #c
+# B: 26, C: 26, L: 4, c: 8
 s
+# B: 26, C: 26, L: 4, c: 8
 b\x0a
+# B: 27, C: 27, L: 5, c: 0
 b\x0a
+# B: 28, C: 28, L: 6, c: 0
 i  
+# B: 30, C: 30, L: 6, c: 2
 b\x0a
+# B: 31, C: 31, L: 7, c: 0
 i  
+# B: 33, C: 33, L: 7, c: 2
 C
+# B: 33, C: 33, L: 7, c: 2
 I#
+# B: 34, C: 34, L: 7, c: 3
 c
+# B: 34, C: 34, L: 7, c: 3
 b\x0a
diff --git a/tests/c-l+literal.n=2.strip.output b/tests/c-l+literal.n=2.strip.output
--- a/tests/c-l+literal.n=2.strip.output
+++ b/tests/c-l+literal.n=2.strip.output
@@ -1,22 +1,46 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 I-
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 i    
+# B: 7, C: 7, L: 2, c: 4
 T# a
+# B: 10, C: 10, L: 2, c: 7
 L\x0a
+# B: 11, C: 11, L: 3, c: 0
 i    
+# B: 15, C: 15, L: 3, c: 4
 Tb
+# B: 16, C: 16, L: 3, c: 5
 L\x0a
+# B: 17, C: 17, L: 4, c: 0
 i    
+# B: 21, C: 21, L: 4, c: 4
 T  #c
+# B: 25, C: 25, L: 4, c: 8
 s
+# B: 25, C: 25, L: 4, c: 8
 b\x0a
+# B: 26, C: 26, L: 5, c: 0
 b\x0a
+# B: 27, C: 27, L: 6, c: 0
 i  
+# B: 29, C: 29, L: 6, c: 2
 b\x0a
+# B: 30, C: 30, L: 7, c: 0
 i  
+# B: 32, C: 32, L: 7, c: 2
 C
+# B: 32, C: 32, L: 7, c: 2
 I#
+# B: 33, C: 33, L: 7, c: 3
 c
+# B: 33, C: 33, L: 7, c: 3
 b\x0a
diff --git a/tests/c-l-block-map-explicit-entry.n=2.invalid.output b/tests/c-l-block-map-explicit-entry.n=2.invalid.output
--- a/tests/c-l-block-map-explicit-entry.n=2.invalid.output
+++ b/tests/c-l-block-map-explicit-entry.n=2.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-l-block-map-explicit-entry.n=2.output b/tests/c-l-block-map-explicit-entry.n=2.output
--- a/tests/c-l-block-map-explicit-entry.n=2.output
+++ b/tests/c-l-block-map-explicit-entry.n=2.output
@@ -1,20 +1,36 @@
+# B: 0, C: 0, L: 1, c: 0
 I?
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 i  
+# B: 6, C: 6, L: 2, c: 2
 I:
+# B: 7, C: 7, L: 2, c: 3
 w 
+# B: 8, C: 8, L: 2, c: 4
 N
+# B: 8, C: 8, L: 2, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 8, C: 8, L: 2, c: 4
 Tb
+# B: 9, C: 9, L: 2, c: 5
 s
+# B: 9, C: 9, L: 2, c: 5
 n
+# B: 9, C: 9, L: 2, c: 5
 b\x0a
diff --git a/tests/c-l-block-map-explicit-key.n=2.invalid.output b/tests/c-l-block-map-explicit-key.n=2.invalid.output
--- a/tests/c-l-block-map-explicit-key.n=2.invalid.output
+++ b/tests/c-l-block-map-explicit-key.n=2.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-l-block-map-explicit-key.n=2.output b/tests/c-l-block-map-explicit-key.n=2.output
--- a/tests/c-l-block-map-explicit-key.n=2.output
+++ b/tests/c-l-block-map-explicit-key.n=2.output
@@ -1,10 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 I?
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
diff --git a/tests/c-l-block-map-implicit-value.n=2.empty.output b/tests/c-l-block-map-implicit-value.n=2.empty.output
--- a/tests/c-l-block-map-implicit-value.n=2.empty.output
+++ b/tests/c-l-block-map-implicit-value.n=2.empty.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/c-l-block-map-implicit-value.n=2.invalid.output b/tests/c-l-block-map-implicit-value.n=2.invalid.output
--- a/tests/c-l-block-map-implicit-value.n=2.invalid.output
+++ b/tests/c-l-block-map-implicit-value.n=2.invalid.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
-!$InputFile$: line 1: column 1: Expected start of line
+# B: 1, C: 1, L: 1, c: 1
+-"a"
diff --git a/tests/c-l-block-map-implicit-value.n=2.plain.output b/tests/c-l-block-map-implicit-value.n=2.plain.output
--- a/tests/c-l-block-map-implicit-value.n=2.plain.output
+++ b/tests/c-l-block-map-implicit-value.n=2.plain.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
diff --git a/tests/c-l-block-seq-entry.n=2.invalid.output b/tests/c-l-block-seq-entry.n=2.invalid.output
--- a/tests/c-l-block-seq-entry.n=2.invalid.output
+++ b/tests/c-l-block-seq-entry.n=2.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
-!$InputFile$: line 1: column 1: Unexpected '1'
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '1'
diff --git a/tests/c-l-block-seq-entry.n=2.output b/tests/c-l-block-seq-entry.n=2.output
--- a/tests/c-l-block-seq-entry.n=2.output
+++ b/tests/c-l-block-seq-entry.n=2.output
@@ -1,10 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
diff --git a/tests/c-literal.output b/tests/c-literal.output
--- a/tests/c-literal.output
+++ b/tests/c-literal.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I|
diff --git a/tests/c-mapping-end.output b/tests/c-mapping-end.output
--- a/tests/c-mapping-end.output
+++ b/tests/c-mapping-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I}
diff --git a/tests/c-mapping-key.output b/tests/c-mapping-key.output
--- a/tests/c-mapping-key.output
+++ b/tests/c-mapping-key.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I?
diff --git a/tests/c-mapping-start.output b/tests/c-mapping-start.output
--- a/tests/c-mapping-start.output
+++ b/tests/c-mapping-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I{
diff --git a/tests/c-mapping-value.output b/tests/c-mapping-value.output
--- a/tests/c-mapping-value.output
+++ b/tests/c-mapping-value.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
diff --git a/tests/c-named-tag-handle.invalid.output b/tests/c-named-tag-handle.invalid.output
--- a/tests/c-named-tag-handle.invalid.output
+++ b/tests/c-named-tag-handle.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+h
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-named-tag-handle.output b/tests/c-named-tag-handle.output
--- a/tests/c-named-tag-handle.output
+++ b/tests/c-named-tag-handle.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 tname
+# B: 5, C: 5, L: 1, c: 5
 I!
+# B: 6, C: 6, L: 1, c: 6
 h
diff --git a/tests/c-nb-comment-text.comment-text.output b/tests/c-nb-comment-text.comment-text.output
--- a/tests/c-nb-comment-text.comment-text.output
+++ b/tests/c-nb-comment-text.comment-text.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 C
+# B: 0, C: 0, L: 1, c: 0
 I#
+# B: 1, C: 1, L: 1, c: 1
 t text
+# B: 6, C: 6, L: 1, c: 6
 c
diff --git a/tests/c-nb-comment-text.comment.output b/tests/c-nb-comment-text.comment.output
--- a/tests/c-nb-comment-text.comment.output
+++ b/tests/c-nb-comment-text.comment.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 C
+# B: 0, C: 0, L: 1, c: 0
 I#
+# B: 1, C: 1, L: 1, c: 1
 c
diff --git a/tests/c-nb-comment-text.invalid.output b/tests/c-nb-comment-text.invalid.output
--- a/tests/c-nb-comment-text.invalid.output
+++ b/tests/c-nb-comment-text.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 C
-!$InputFile$: line 1: column 0: Unexpected '\x0a'
+# B: 0, C: 0, L: 1, c: 0
+c
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x0a'
diff --git a/tests/c-non-specific-tag.invalid.output b/tests/c-non-specific-tag.invalid.output
--- a/tests/c-non-specific-tag.invalid.output
+++ b/tests/c-non-specific-tag.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-non-specific-tag.output b/tests/c-non-specific-tag.output
--- a/tests/c-non-specific-tag.output
+++ b/tests/c-non-specific-tag.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
diff --git a/tests/c-ns-alias-node.output b/tests/c-ns-alias-node.output
--- a/tests/c-ns-alias-node.output
+++ b/tests/c-ns-alias-node.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 R
+# B: 0, C: 0, L: 1, c: 0
 I*
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t*&!name
+# B: 8, C: 8, L: 1, c: 8
 r
diff --git a/tests/c-ns-anchor-property.invalid.output b/tests/c-ns-anchor-property.invalid.output
--- a/tests/c-ns-anchor-property.invalid.output
+++ b/tests/c-ns-anchor-property.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-ns-anchor-property.output b/tests/c-ns-anchor-property.output
--- a/tests/c-ns-anchor-property.output
+++ b/tests/c-ns-anchor-property.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 A
+# B: 0, C: 0, L: 1, c: 0
 I&
+# B: 1, C: 1, L: 1, c: 1
 t&*!name
+# B: 8, C: 8, L: 1, c: 8
 a
diff --git a/tests/c-ns-esc-char.16-bit.output b/tests/c-ns-esc-char.16-bit.output
--- a/tests/c-ns-esc-char.16-bit.output
+++ b/tests/c-ns-esc-char.16-bit.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Iu
+# B: 2, C: 2, L: 1, c: 2
 tFEDC
+# B: 6, C: 6, L: 1, c: 6
 e
diff --git a/tests/c-ns-esc-char.32-bit.output b/tests/c-ns-esc-char.32-bit.output
--- a/tests/c-ns-esc-char.32-bit.output
+++ b/tests/c-ns-esc-char.32-bit.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 IU
+# B: 2, C: 2, L: 1, c: 2
 t0010FEDC
+# B: 10, C: 10, L: 1, c: 10
 e
diff --git a/tests/c-ns-esc-char.8-bit.output b/tests/c-ns-esc-char.8-bit.output
--- a/tests/c-ns-esc-char.8-bit.output
+++ b/tests/c-ns-esc-char.8-bit.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ix
+# B: 2, C: 2, L: 1, c: 2
 tFF
+# B: 4, C: 4, L: 1, c: 4
 e
diff --git a/tests/c-ns-esc-char.backslash.output b/tests/c-ns-esc-char.backslash.output
--- a/tests/c-ns-esc-char.backslash.output
+++ b/tests/c-ns-esc-char.backslash.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t\x5c
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.bell.output b/tests/c-ns-esc-char.bell.output
--- a/tests/c-ns-esc-char.bell.output
+++ b/tests/c-ns-esc-char.bell.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.bs.output b/tests/c-ns-esc-char.bs.output
--- a/tests/c-ns-esc-char.bs.output
+++ b/tests/c-ns-esc-char.bs.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tb
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.cr.output b/tests/c-ns-esc-char.cr.output
--- a/tests/c-ns-esc-char.cr.output
+++ b/tests/c-ns-esc-char.cr.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tr
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.double-quote.output b/tests/c-ns-esc-char.double-quote.output
--- a/tests/c-ns-esc-char.double-quote.output
+++ b/tests/c-ns-esc-char.double-quote.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t"
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.esc.output b/tests/c-ns-esc-char.esc.output
--- a/tests/c-ns-esc-char.esc.output
+++ b/tests/c-ns-esc-char.esc.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 te
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.ff.output b/tests/c-ns-esc-char.ff.output
--- a/tests/c-ns-esc-char.ff.output
+++ b/tests/c-ns-esc-char.ff.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tf
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.lf.output b/tests/c-ns-esc-char.lf.output
--- a/tests/c-ns-esc-char.lf.output
+++ b/tests/c-ns-esc-char.lf.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tn
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.ls.output b/tests/c-ns-esc-char.ls.output
--- a/tests/c-ns-esc-char.ls.output
+++ b/tests/c-ns-esc-char.ls.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tL
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.nbsp.output b/tests/c-ns-esc-char.nbsp.output
--- a/tests/c-ns-esc-char.nbsp.output
+++ b/tests/c-ns-esc-char.nbsp.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t_
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.nl.output b/tests/c-ns-esc-char.nl.output
--- a/tests/c-ns-esc-char.nl.output
+++ b/tests/c-ns-esc-char.nl.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tN
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.null.output b/tests/c-ns-esc-char.null.output
--- a/tests/c-ns-esc-char.null.output
+++ b/tests/c-ns-esc-char.null.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t0
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.ps.output b/tests/c-ns-esc-char.ps.output
--- a/tests/c-ns-esc-char.ps.output
+++ b/tests/c-ns-esc-char.ps.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tP
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.sp.output b/tests/c-ns-esc-char.sp.output
--- a/tests/c-ns-esc-char.sp.output
+++ b/tests/c-ns-esc-char.sp.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t 
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.tab.output b/tests/c-ns-esc-char.tab.output
--- a/tests/c-ns-esc-char.tab.output
+++ b/tests/c-ns-esc-char.tab.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-esc-char.vt.output b/tests/c-ns-esc-char.vt.output
--- a/tests/c-ns-esc-char.vt.output
+++ b/tests/c-ns-esc-char.vt.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tv
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.compact.output b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.compact.output
--- a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.compact.output
+++ b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.compact.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
diff --git a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.empty.output b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.empty.output
--- a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.empty.output
+++ b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.empty.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.invalid.output b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.invalid.output
--- a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.invalid.output
+++ b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.spaced.output b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.spaced.output
--- a/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.spaced.output
+++ b/tests/c-ns-flow-map-adjacent-value.n=4.c=flow-in.spaced.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.invalid.output b/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.invalid.output
--- a/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.invalid.output
+++ b/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.invalid.output
@@ -1,11 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 I:
-!Commit to 'pair' was made outside it
-N
-S
-s
-n
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '"'
diff --git a/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.output b/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.output
--- a/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.output
+++ b/tests/c-ns-flow-map-empty-key-entry.n=4.c=flow-in.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.compact.output b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.compact.output
--- a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.compact.output
+++ b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.compact.output
@@ -1,16 +1,32 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'pair' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'pair' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
diff --git a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.empty.output b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.empty.output
--- a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.empty.output
+++ b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.empty.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'pair' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.invalid.output b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.invalid.output
--- a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.invalid.output
+++ b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.spaced.output b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.spaced.output
--- a/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.spaced.output
+++ b/tests/c-ns-flow-map-json-key-entry.n=4.c=flow-in.spaced.output
@@ -1,18 +1,36 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'pair' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 I:
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'pair' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 N
+# B: 6, C: 6, L: 1, c: 6
 S
+# B: 7, C: 7, L: 1, c: 7
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 1, c: 6
 Tb
+# B: 7, C: 7, L: 1, c: 7
 s
+# B: 7, C: 7, L: 1, c: 7
 n
diff --git a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.empty.output b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.empty.output
--- a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.empty.output
+++ b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.empty.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.invalid.output b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.invalid.output
--- a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.invalid.output
+++ b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.invalid.output
@@ -1,7 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
-!Commit to 'pair' was made outside it
-N
-S
-s
-n
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected 'a'
diff --git a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.value.output b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.value.output
--- a/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.value.output
+++ b/tests/c-ns-flow-map-separate-value.n=4.c=flow-in.value.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.invalid.output b/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.invalid.output
--- a/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.invalid.output
+++ b/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.output b/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.output
--- a/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.output
+++ b/tests/c-ns-flow-pair-json-key-entry.n=4.c=flow-in.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'pair' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
diff --git a/tests/c-ns-local-tag-prefix.invalid.output b/tests/c-ns-local-tag-prefix.invalid.output
--- a/tests/c-ns-local-tag-prefix.invalid.output
+++ b/tests/c-ns-local-tag-prefix.invalid.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 ta
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '^'
diff --git a/tests/c-ns-local-tag-prefix.output b/tests/c-ns-local-tag-prefix.output
--- a/tests/c-ns-local-tag-prefix.output
+++ b/tests/c-ns-local-tag-prefix.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 tprefix
diff --git a/tests/c-ns-properties.n=0.c=block-in.invalid.output b/tests/c-ns-properties.n=0.c=block-in.invalid.output
--- a/tests/c-ns-properties.n=0.c=block-in.invalid.output
+++ b/tests/c-ns-properties.n=0.c=block-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '@'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '@'
diff --git a/tests/c-ns-properties.n=0.c=block-in.output b/tests/c-ns-properties.n=0.c=block-in.output
--- a/tests/c-ns-properties.n=0.c=block-in.output
+++ b/tests/c-ns-properties.n=0.c=block-in.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
+# B: 0, C: 0, L: 1, c: 0
 I&
+# B: 1, C: 1, L: 1, c: 1
 t&*!name
+# B: 8, C: 8, L: 1, c: 8
 a
+# B: 8, C: 8, L: 1, c: 8
 w 
+# B: 9, C: 9, L: 1, c: 9
 G
+# B: 9, C: 9, L: 1, c: 9
 H
+# B: 9, C: 9, L: 1, c: 9
 I!
+# B: 10, C: 10, L: 1, c: 10
 h
+# B: 10, C: 10, L: 1, c: 10
 tsuffix
+# B: 16, C: 16, L: 1, c: 16
 g
+# B: 16, C: 16, L: 1, c: 16
 p
diff --git a/tests/c-ns-properties.n=0.c=block-out.output b/tests/c-ns-properties.n=0.c=block-out.output
--- a/tests/c-ns-properties.n=0.c=block-out.output
+++ b/tests/c-ns-properties.n=0.c=block-out.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
+# B: 0, C: 0, L: 1, c: 0
 I&
+# B: 1, C: 1, L: 1, c: 1
 t&*!name
+# B: 8, C: 8, L: 1, c: 8
 a
+# B: 8, C: 8, L: 1, c: 8
 w 
+# B: 9, C: 9, L: 1, c: 9
 G
+# B: 9, C: 9, L: 1, c: 9
 H
+# B: 9, C: 9, L: 1, c: 9
 I!
+# B: 10, C: 10, L: 1, c: 10
 h
+# B: 10, C: 10, L: 1, c: 10
 tsuffix
+# B: 16, C: 16, L: 1, c: 16
 g
+# B: 16, C: 16, L: 1, c: 16
 p
diff --git a/tests/c-ns-properties.n=0.c=flow-out.invalid.output b/tests/c-ns-properties.n=0.c=flow-out.invalid.output
--- a/tests/c-ns-properties.n=0.c=flow-out.invalid.output
+++ b/tests/c-ns-properties.n=0.c=flow-out.invalid.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '\x0a'
diff --git a/tests/c-ns-properties.n=0.c=flow-out.output b/tests/c-ns-properties.n=0.c=flow-out.output
--- a/tests/c-ns-properties.n=0.c=flow-out.output
+++ b/tests/c-ns-properties.n=0.c=flow-out.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 A
+# B: 3, C: 3, L: 2, c: 0
 I&
+# B: 4, C: 4, L: 2, c: 1
 tb
+# B: 5, C: 5, L: 2, c: 2
 a
+# B: 5, C: 5, L: 2, c: 2
 p
diff --git a/tests/c-ns-shorthand-tag.invalid.output b/tests/c-ns-shorthand-tag.invalid.output
--- a/tests/c-ns-shorthand-tag.invalid.output
+++ b/tests/c-ns-shorthand-tag.invalid.output
@@ -1,4 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
+I!
+# B: 2, C: 2, L: 1, c: 2
 h
-!$InputFile$: line 1: column 1: Unexpected '!'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected end of input
diff --git a/tests/c-ns-shorthand-tag.named.output b/tests/c-ns-shorthand-tag.named.output
--- a/tests/c-ns-shorthand-tag.named.output
+++ b/tests/c-ns-shorthand-tag.named.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 tname
+# B: 5, C: 5, L: 1, c: 5
 I!
+# B: 6, C: 6, L: 1, c: 6
 h
+# B: 6, C: 6, L: 1, c: 6
 tsuffix
diff --git a/tests/c-ns-shorthand-tag.primary.output b/tests/c-ns-shorthand-tag.primary.output
--- a/tests/c-ns-shorthand-tag.primary.output
+++ b/tests/c-ns-shorthand-tag.primary.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tsuffix
diff --git a/tests/c-ns-shorthand-tag.secondary.output b/tests/c-ns-shorthand-tag.secondary.output
--- a/tests/c-ns-shorthand-tag.secondary.output
+++ b/tests/c-ns-shorthand-tag.secondary.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I!
+# B: 2, C: 2, L: 1, c: 2
 h
+# B: 2, C: 2, L: 1, c: 2
 tsuffix
diff --git a/tests/c-ns-tag-property.invalid.output b/tests/c-ns-tag-property.invalid.output
--- a/tests/c-ns-tag-property.invalid.output
+++ b/tests/c-ns-tag-property.invalid.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 g
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '<'
diff --git a/tests/c-ns-tag-property.non-specific.output b/tests/c-ns-tag-property.non-specific.output
--- a/tests/c-ns-tag-property.non-specific.output
+++ b/tests/c-ns-tag-property.non-specific.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 g
diff --git a/tests/c-ns-tag-property.shorthand.output b/tests/c-ns-tag-property.shorthand.output
--- a/tests/c-ns-tag-property.shorthand.output
+++ b/tests/c-ns-tag-property.shorthand.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tsuffix
+# B: 7, C: 7, L: 1, c: 7
 g
diff --git a/tests/c-ns-tag-property.verbatim.output b/tests/c-ns-tag-property.verbatim.output
--- a/tests/c-ns-tag-property.verbatim.output
+++ b/tests/c-ns-tag-property.verbatim.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I<
+# B: 2, C: 2, L: 1, c: 2
 tverbatim
+# B: 10, C: 10, L: 1, c: 10
 I>
+# B: 11, C: 11, L: 1, c: 11
 g
diff --git a/tests/c-primary-tag-handle.invalid.output b/tests/c-primary-tag-handle.invalid.output
--- a/tests/c-primary-tag-handle.invalid.output
+++ b/tests/c-primary-tag-handle.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+h
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-primary-tag-handle.output b/tests/c-primary-tag-handle.output
--- a/tests/c-primary-tag-handle.output
+++ b/tests/c-primary-tag-handle.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
diff --git a/tests/c-printable.10000.output b/tests/c-printable.10000.output
--- a/tests/c-printable.10000.output
+++ b/tests/c-printable.10000.output
@@ -1,1 +1,2 @@
-?\U00010000
+# B: 0, C: 0, L: 1, c: 0
+-\U00010000
diff --git a/tests/c-printable.10ffff.output b/tests/c-printable.10ffff.output
--- a/tests/c-printable.10ffff.output
+++ b/tests/c-printable.10ffff.output
@@ -1,1 +1,2 @@
-?\U0010ffff
+# B: 0, C: 0, L: 1, c: 0
+-\U0010ffff
diff --git a/tests/c-printable.cr.output b/tests/c-printable.cr.output
--- a/tests/c-printable.cr.output
+++ b/tests/c-printable.cr.output
@@ -1,1 +1,2 @@
-?\x0d
+# B: 0, C: 0, L: 1, c: 0
+-\x0d
diff --git a/tests/c-printable.d7ff.output b/tests/c-printable.d7ff.output
--- a/tests/c-printable.d7ff.output
+++ b/tests/c-printable.d7ff.output
@@ -1,1 +1,2 @@
-?\ud7ff
+# B: 0, C: 0, L: 1, c: 0
+-\ud7ff
diff --git a/tests/c-printable.e000.output b/tests/c-printable.e000.output
--- a/tests/c-printable.e000.output
+++ b/tests/c-printable.e000.output
@@ -1,1 +1,2 @@
-?\ue000
+# B: 0, C: 0, L: 1, c: 0
+-\ue000
diff --git a/tests/c-printable.fffd.output b/tests/c-printable.fffd.output
--- a/tests/c-printable.fffd.output
+++ b/tests/c-printable.fffd.output
@@ -1,1 +1,2 @@
-?\ufffd
+# B: 0, C: 0, L: 1, c: 0
+-\ufffd
diff --git a/tests/c-printable.invalid.output b/tests/c-printable.invalid.output
--- a/tests/c-printable.invalid.output
+++ b/tests/c-printable.invalid.output
@@ -1,1 +1,2 @@
-?\xff
+# B: 0, C: 0, L: 1, c: 0
+-\xff
diff --git a/tests/c-printable.lf.output b/tests/c-printable.lf.output
--- a/tests/c-printable.lf.output
+++ b/tests/c-printable.lf.output
@@ -1,1 +1,2 @@
-?\x0a
+# B: 0, C: 0, L: 1, c: 0
+-\x0a
diff --git a/tests/c-printable.nbsp.output b/tests/c-printable.nbsp.output
--- a/tests/c-printable.nbsp.output
+++ b/tests/c-printable.nbsp.output
@@ -1,1 +1,2 @@
-?\xa0
+# B: 0, C: 0, L: 1, c: 0
+-\xa0
diff --git a/tests/c-printable.nel.output b/tests/c-printable.nel.output
--- a/tests/c-printable.nel.output
+++ b/tests/c-printable.nel.output
@@ -1,1 +1,2 @@
-?\x85
+# B: 0, C: 0, L: 1, c: 0
+-\x85
diff --git a/tests/c-printable.sp.output b/tests/c-printable.sp.output
--- a/tests/c-printable.sp.output
+++ b/tests/c-printable.sp.output
@@ -1,1 +1,2 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
diff --git a/tests/c-printable.tab.output b/tests/c-printable.tab.output
--- a/tests/c-printable.tab.output
+++ b/tests/c-printable.tab.output
@@ -1,1 +1,2 @@
-?\x09
+# B: 0, C: 0, L: 1, c: 0
+-\x09
diff --git a/tests/c-printable.tilde.output b/tests/c-printable.tilde.output
--- a/tests/c-printable.tilde.output
+++ b/tests/c-printable.tilde.output
@@ -1,1 +1,2 @@
-?~
+# B: 0, C: 0, L: 1, c: 0
+-~
diff --git a/tests/c-quoted-quote.invalid.output b/tests/c-quoted-quote.invalid.output
--- a/tests/c-quoted-quote.invalid.output
+++ b/tests/c-quoted-quote.invalid.output
@@ -1,4 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I'
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
-!$InputFile$: line 1: column 1: Unexpected 'a'
+# B: 1, C: 1, L: 1, c: 1
+e
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected 'a'
diff --git a/tests/c-quoted-quote.output b/tests/c-quoted-quote.output
--- a/tests/c-quoted-quote.output
+++ b/tests/c-quoted-quote.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I'
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escape' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t'
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/c-reserved.at.output b/tests/c-reserved.at.output
--- a/tests/c-reserved.at.output
+++ b/tests/c-reserved.at.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I@
diff --git a/tests/c-reserved.backtick.output b/tests/c-reserved.backtick.output
--- a/tests/c-reserved.backtick.output
+++ b/tests/c-reserved.backtick.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I`
diff --git a/tests/c-s-implicit-json-key.c=flow-key.invalid.input b/tests/c-s-implicit-json-key.c=flow-key.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.invalid.input
@@ -0,0 +1,1 @@
+a, b 
diff --git a/tests/c-s-implicit-json-key.c=flow-key.invalid.output b/tests/c-s-implicit-json-key.c=flow-key.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.invalid.output
@@ -0,0 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-s-implicit-json-key.c=flow-key.just.input b/tests/c-s-implicit-json-key.c=flow-key.just.input
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.just.input
@@ -0,0 +1,1 @@
+"123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcde"
diff --git a/tests/c-s-implicit-json-key.c=flow-key.just.output b/tests/c-s-implicit-json-key.c=flow-key.just.output
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.just.output
@@ -0,0 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I"
+# B: 1, C: 1, L: 1, c: 1
+T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcde
+# B: 1023, C: 1023, L: 1, c: 1023
+I"
+# B: 1024, C: 1024, L: 1, c: 1024
+s
+# B: 1024, C: 1024, L: 1, c: 1024
+n
diff --git a/tests/c-s-implicit-json-key.c=flow-key.long.input b/tests/c-s-implicit-json-key.c=flow-key.long.input
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.long.input
@@ -0,0 +1,1 @@
+"123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdeX"
diff --git a/tests/c-s-implicit-json-key.c=flow-key.long.output b/tests/c-s-implicit-json-key.c=flow-key.long.output
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.long.output
@@ -0,0 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I"
+# B: 1, C: 1, L: 1, c: 1
+T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdeX
+# B: 1024, C: 1024, L: 1, c: 1024
+s
+# B: 1024, C: 1024, L: 1, c: 1024
+n
+# B: 1024, C: 1024, L: 1, c: 1024
+!Lookahead limit reached
diff --git a/tests/c-s-implicit-json-key.c=flow-key.short.input b/tests/c-s-implicit-json-key.c=flow-key.short.input
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.short.input
@@ -0,0 +1,1 @@
+"a" 
diff --git a/tests/c-s-implicit-json-key.c=flow-key.short.output b/tests/c-s-implicit-json-key.c=flow-key.short.output
new file mode 100644
--- /dev/null
+++ b/tests/c-s-implicit-json-key.c=flow-key.short.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I"
+# B: 1, C: 1, L: 1, c: 1
+Ta
+# B: 2, C: 2, L: 1, c: 2
+I"
+# B: 3, C: 3, L: 1, c: 3
+s
+# B: 3, C: 3, L: 1, c: 3
+n
+# B: 3, C: 3, L: 1, c: 3
+w 
diff --git a/tests/c-s-implicit-json-key.just.input b/tests/c-s-implicit-json-key.just.input
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.just.input
+++ /dev/null
@@ -1,1 +0,0 @@
-"123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcde"
diff --git a/tests/c-s-implicit-json-key.just.output b/tests/c-s-implicit-json-key.just.output
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.just.output
+++ /dev/null
@@ -1,7 +0,0 @@
-N
-S
-I"
-T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcde
-I"
-s
-n
diff --git a/tests/c-s-implicit-json-key.long.input b/tests/c-s-implicit-json-key.long.input
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.long.input
+++ /dev/null
@@ -1,1 +0,0 @@
-"123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdeX"
diff --git a/tests/c-s-implicit-json-key.long.output b/tests/c-s-implicit-json-key.long.output
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.long.output
+++ /dev/null
@@ -1,5 +0,0 @@
-N
-S
-I"
-T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdeX
-!$InputFile$: line 1: column 1024: Lookahead limit reached
diff --git a/tests/c-s-implicit-json-key.short.input b/tests/c-s-implicit-json-key.short.input
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.short.input
+++ /dev/null
@@ -1,1 +0,0 @@
-"a" 
diff --git a/tests/c-s-implicit-json-key.short.output b/tests/c-s-implicit-json-key.short.output
deleted file mode 100644
--- a/tests/c-s-implicit-json-key.short.output
+++ /dev/null
@@ -1,8 +0,0 @@
-N
-S
-I"
-Ta
-I"
-s
-n
-w 
diff --git a/tests/c-secondary-tag-handle.invalid.output b/tests/c-secondary-tag-handle.invalid.output
--- a/tests/c-secondary-tag-handle.invalid.output
+++ b/tests/c-secondary-tag-handle.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+h
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-secondary-tag-handle.output b/tests/c-secondary-tag-handle.output
--- a/tests/c-secondary-tag-handle.output
+++ b/tests/c-secondary-tag-handle.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I!
+# B: 2, C: 2, L: 1, c: 2
 h
diff --git a/tests/c-sequence-end.output b/tests/c-sequence-end.output
--- a/tests/c-sequence-end.output
+++ b/tests/c-sequence-end.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I]
diff --git a/tests/c-sequence-entry.output b/tests/c-sequence-entry.output
--- a/tests/c-sequence-entry.output
+++ b/tests/c-sequence-entry.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I-
diff --git a/tests/c-sequence-start.output b/tests/c-sequence-start.output
--- a/tests/c-sequence-start.output
+++ b/tests/c-sequence-start.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I[
diff --git a/tests/c-single-quote.output b/tests/c-single-quote.output
--- a/tests/c-single-quote.output
+++ b/tests/c-single-quote.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I'
diff --git a/tests/c-single-quoted.n=0.c=flow-out.input b/tests/c-single-quoted.n=0.c=flow-out.input
new file mode 100644
--- /dev/null
+++ b/tests/c-single-quoted.n=0.c=flow-out.input
@@ -0,0 +1,3 @@
+'
+a
+'
diff --git a/tests/c-single-quoted.n=0.c=flow-out.output b/tests/c-single-quoted.n=0.c=flow-out.output
new file mode 100644
--- /dev/null
+++ b/tests/c-single-quoted.n=0.c=flow-out.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I'
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+l\x0a
+# B: 2, C: 2, L: 2, c: 0
+Ta
+# B: 3, C: 3, L: 2, c: 1
+l\x0a
+# B: 4, C: 4, L: 3, c: 0
+I'
+# B: 5, C: 5, L: 3, c: 1
+s
diff --git a/tests/c-single-quoted.n=2.c=flow-out.input b/tests/c-single-quoted.n=2.c=flow-out.input
new file mode 100644
--- /dev/null
+++ b/tests/c-single-quoted.n=2.c=flow-out.input
@@ -0,0 +1,1 @@
+' a '
diff --git a/tests/c-single-quoted.n=2.c=flow-out.output b/tests/c-single-quoted.n=2.c=flow-out.output
new file mode 100644
--- /dev/null
+++ b/tests/c-single-quoted.n=2.c=flow-out.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I'
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+T a 
+# B: 4, C: 4, L: 1, c: 4
+I'
+# B: 5, C: 5, L: 1, c: 5
+s
diff --git a/tests/c-single-quoted.n=4.c=flow-out.invalid.output b/tests/c-single-quoted.n=4.c=flow-out.invalid.output
--- a/tests/c-single-quoted.n=4.c=flow-out.invalid.output
+++ b/tests/c-single-quoted.n=4.c=flow-out.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-single-quoted.n=4.c=flow-out.output b/tests/c-single-quoted.n=4.c=flow-out.output
--- a/tests/c-single-quoted.n=4.c=flow-out.output
+++ b/tests/c-single-quoted.n=4.c=flow-out.output
@@ -1,10 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I'
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 T a
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 l\x0a
+# B: 5, C: 5, L: 2, c: 0
 i    
+# B: 9, C: 9, L: 2, c: 4
 w\x09
+# B: 10, C: 10, L: 2, c: 5
 Ta b\x09c 
+# B: 16, C: 16, L: 2, c: 11
 I'
+# B: 17, C: 17, L: 2, c: 12
 s
diff --git a/tests/c-tag-handle.invalid.output b/tests/c-tag-handle.invalid.output
--- a/tests/c-tag-handle.invalid.output
+++ b/tests/c-tag-handle.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+h
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/c-tag-handle.named.output b/tests/c-tag-handle.named.output
--- a/tests/c-tag-handle.named.output
+++ b/tests/c-tag-handle.named.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 tname
+# B: 5, C: 5, L: 1, c: 5
 I!
+# B: 6, C: 6, L: 1, c: 6
 h
diff --git a/tests/c-tag-handle.primary.output b/tests/c-tag-handle.primary.output
--- a/tests/c-tag-handle.primary.output
+++ b/tests/c-tag-handle.primary.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
diff --git a/tests/c-tag-handle.secondary.output b/tests/c-tag-handle.secondary.output
--- a/tests/c-tag-handle.secondary.output
+++ b/tests/c-tag-handle.secondary.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I!
+# B: 2, C: 2, L: 1, c: 2
 h
diff --git a/tests/c-tag.output b/tests/c-tag.output
--- a/tests/c-tag.output
+++ b/tests/c-tag.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
diff --git a/tests/c-verbatim-tag.invalid.output b/tests/c-verbatim-tag.invalid.output
--- a/tests/c-verbatim-tag.invalid.output
+++ b/tests/c-verbatim-tag.invalid.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I<
+# B: 2, C: 2, L: 1, c: 2
 ta
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/c-verbatim-tag.output b/tests/c-verbatim-tag.output
--- a/tests/c-verbatim-tag.output
+++ b/tests/c-verbatim-tag.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 I<
+# B: 2, C: 2, L: 1, c: 2
 tverbatim
+# B: 10, C: 10, L: 1, c: 10
 I>
diff --git a/tests/count-spaces.n=-1.0.output b/tests/count-spaces.n=-1.0.output
--- a/tests/count-spaces.n=-1.0.output
+++ b/tests/count-spaces.n=-1.0.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=1
diff --git a/tests/count-spaces.n=-1.1.output b/tests/count-spaces.n=-1.1.output
--- a/tests/count-spaces.n=-1.1.output
+++ b/tests/count-spaces.n=-1.1.output
@@ -1,2 +1,4 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
+# B: 1, C: 1, L: 1, c: 1
 $m=1
diff --git a/tests/count-spaces.n=-1.2.output b/tests/count-spaces.n=-1.2.output
--- a/tests/count-spaces.n=-1.2.output
+++ b/tests/count-spaces.n=-1.2.output
@@ -1,2 +1,4 @@
-?  
+# B: 0, C: 0, L: 1, c: 0
+-  
+# B: 2, C: 2, L: 1, c: 2
 $m=1
diff --git a/tests/count-spaces.n=0.0.output b/tests/count-spaces.n=0.0.output
--- a/tests/count-spaces.n=0.0.output
+++ b/tests/count-spaces.n=0.0.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=1
diff --git a/tests/count-spaces.n=0.1.output b/tests/count-spaces.n=0.1.output
--- a/tests/count-spaces.n=0.1.output
+++ b/tests/count-spaces.n=0.1.output
@@ -1,2 +1,4 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
+# B: 1, C: 1, L: 1, c: 1
 $m=1
diff --git a/tests/count-spaces.n=0.2.output b/tests/count-spaces.n=0.2.output
--- a/tests/count-spaces.n=0.2.output
+++ b/tests/count-spaces.n=0.2.output
@@ -1,2 +1,4 @@
-?  
+# B: 0, C: 0, L: 1, c: 0
+-  
+# B: 2, C: 2, L: 1, c: 2
 $m=2
diff --git a/tests/count-spaces.n=1.0.output b/tests/count-spaces.n=1.0.output
--- a/tests/count-spaces.n=1.0.output
+++ b/tests/count-spaces.n=1.0.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=1
diff --git a/tests/count-spaces.n=1.1.output b/tests/count-spaces.n=1.1.output
--- a/tests/count-spaces.n=1.1.output
+++ b/tests/count-spaces.n=1.1.output
@@ -1,2 +1,4 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
+# B: 1, C: 1, L: 1, c: 1
 $m=2
diff --git a/tests/count-spaces.n=1.2.output b/tests/count-spaces.n=1.2.output
--- a/tests/count-spaces.n=1.2.output
+++ b/tests/count-spaces.n=1.2.output
@@ -1,2 +1,4 @@
-?  
+# B: 0, C: 0, L: 1, c: 0
+-  
+# B: 2, C: 2, L: 1, c: 2
 $m=3
diff --git a/tests/detect-collection-indentation.n=1.output b/tests/detect-collection-indentation.n=1.output
--- a/tests/detect-collection-indentation.n=1.output
+++ b/tests/detect-collection-indentation.n=1.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=1
diff --git a/tests/detect-inline-indentation.output b/tests/detect-inline-indentation.output
--- a/tests/detect-inline-indentation.output
+++ b/tests/detect-inline-indentation.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=2
diff --git a/tests/detect-scalar-indentation.n=2.output b/tests/detect-scalar-indentation.n=2.output
--- a/tests/detect-scalar-indentation.n=2.output
+++ b/tests/detect-scalar-indentation.n=2.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 $m=1
diff --git a/tests/e-node.output b/tests/e-node.output
--- a/tests/e-node.output
+++ b/tests/e-node.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
diff --git a/tests/e-scalar.output b/tests/e-scalar.output
--- a/tests/e-scalar.output
+++ b/tests/e-scalar.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
diff --git a/tests/junk b/tests/junk
deleted file mode 100644
--- a/tests/junk
+++ /dev/null
@@ -1,1 +0,0 @@
-ÿ
diff --git a/tests/l+block-mapping.n=-1.output b/tests/l+block-mapping.n=-1.output
--- a/tests/l+block-mapping.n=-1.output
+++ b/tests/l+block-mapping.n=-1.output
@@ -1,30 +1,60 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 x
+# B: 3, C: 3, L: 2, c: 0
 X
+# B: 3, C: 3, L: 2, c: 0
 N
+# B: 3, C: 3, L: 2, c: 0
 S
+# B: 3, C: 3, L: 2, c: 0
 Tb
+# B: 4, C: 4, L: 2, c: 1
 s
+# B: 4, C: 4, L: 2, c: 1
 n
+# B: 4, C: 4, L: 2, c: 1
 I:
+# B: 5, C: 5, L: 2, c: 2
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 2
 N
+# B: 5, C: 5, L: 2, c: 2
 S
+# B: 5, C: 5, L: 2, c: 2
 s
+# B: 5, C: 5, L: 2, c: 2
 n
+# B: 5, C: 5, L: 2, c: 2
 b\x0a
+# B: 6, C: 6, L: 3, c: 0
 x
+# B: 6, C: 6, L: 3, c: 0
 m
diff --git a/tests/l+block-mapping.n=1.output b/tests/l+block-mapping.n=1.output
--- a/tests/l+block-mapping.n=1.output
+++ b/tests/l+block-mapping.n=1.output
@@ -1,43 +1,82 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 X
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 N
+# B: 5, C: 5, L: 1, c: 5
 S
+# B: 6, C: 6, L: 1, c: 6
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 Tb
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
+# B: 6, C: 6, L: 1, c: 6
 b\x0a
+# B: 7, C: 7, L: 2, c: 0
 x
+# B: 7, C: 7, L: 2, c: 0
 i  
+# B: 9, C: 9, L: 2, c: 2
 X
+# B: 9, C: 9, L: 2, c: 2
 I?
+# B: 10, C: 10, L: 2, c: 3
 !Commit to 'node' was made outside it
+# B: 10, C: 10, L: 2, c: 3
 w 
+# B: 11, C: 11, L: 2, c: 4
 N
+# B: 11, C: 11, L: 2, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 11, C: 11, L: 2, c: 4
 Tc
+# B: 12, C: 12, L: 2, c: 5
 s
+# B: 12, C: 12, L: 2, c: 5
 n
+# B: 12, C: 12, L: 2, c: 5
 b\x0a
+# B: 13, C: 13, L: 3, c: 0
 i  
+# B: 15, C: 15, L: 3, c: 2
 I:
+# B: 16, C: 16, L: 3, c: 3
 w 
+# B: 17, C: 17, L: 3, c: 4
 N
+# B: 17, C: 17, L: 3, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 17, C: 17, L: 3, c: 4
 Td
+# B: 18, C: 18, L: 3, c: 5
 s
+# B: 18, C: 18, L: 3, c: 5
 n
+# B: 18, C: 18, L: 3, c: 5
 b\x0a
+# B: 19, C: 19, L: 4, c: 0
 x
+# B: 19, C: 19, L: 4, c: 0
 m
diff --git a/tests/l+block-mapping.n=2.invalid.output b/tests/l+block-mapping.n=2.invalid.output
--- a/tests/l+block-mapping.n=2.invalid.output
+++ b/tests/l+block-mapping.n=2.invalid.output
@@ -1,2 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 M
-!$InputFile$: line 1: column 2: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+-  
+# B: 2, C: 2, L: 1, c: 2
+m
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'a'
diff --git a/tests/l+block-sequence.n=1.output b/tests/l+block-sequence.n=1.output
--- a/tests/l+block-sequence.n=1.output
+++ b/tests/l+block-sequence.n=1.output
@@ -1,57 +1,108 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 I-
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Ta
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 i  
+# B: 8, C: 8, L: 2, c: 2
 I-
+# B: 9, C: 9, L: 2, c: 3
 !Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 3
 N
+# B: 9, C: 9, L: 2, c: 3
 b\x0a
+# B: 10, C: 10, L: 3, c: 0
 Q
+# B: 10, C: 10, L: 3, c: 0
 i   
+# B: 13, C: 13, L: 3, c: 3
 I-
-!Commit to 'node' was made outside it
+# B: 14, C: 14, L: 3, c: 4
 w 
+# B: 15, C: 15, L: 3, c: 5
 N
+# B: 15, C: 15, L: 3, c: 5
 S
-!Commit to 'node' was made outside it
+# B: 15, C: 15, L: 3, c: 5
 Tb
+# B: 16, C: 16, L: 3, c: 6
 s
+# B: 16, C: 16, L: 3, c: 6
 n
+# B: 16, C: 16, L: 3, c: 6
 b\x0a
+# B: 17, C: 17, L: 4, c: 0
 q
+# B: 17, C: 17, L: 4, c: 0
 n
+# B: 17, C: 17, L: 4, c: 0
 i  
+# B: 19, C: 19, L: 4, c: 2
 I-
+# B: 20, C: 20, L: 4, c: 3
 !Commit to 'node' was made outside it
+# B: 20, C: 20, L: 4, c: 3
 i 
+# B: 21, C: 21, L: 4, c: 4
 N
+# B: 21, C: 21, L: 4, c: 4
 Q
+# B: 21, C: 21, L: 4, c: 4
 I-
+# B: 22, C: 22, L: 4, c: 5
 w 
+# B: 23, C: 23, L: 4, c: 6
 N
+# B: 23, C: 23, L: 4, c: 6
 S
+# B: 23, C: 23, L: 4, c: 6
 Tc
+# B: 24, C: 24, L: 4, c: 7
 s
+# B: 24, C: 24, L: 4, c: 7
 n
+# B: 24, C: 24, L: 4, c: 7
 b\x0a
+# B: 25, C: 25, L: 5, c: 0
 i    
+# B: 29, C: 29, L: 5, c: 4
 I-
+# B: 30, C: 30, L: 5, c: 5
 w 
+# B: 31, C: 31, L: 5, c: 6
 N
+# B: 31, C: 31, L: 5, c: 6
 S
+# B: 31, C: 31, L: 5, c: 6
 Td
+# B: 32, C: 32, L: 5, c: 7
 s
+# B: 32, C: 32, L: 5, c: 7
 n
+# B: 32, C: 32, L: 5, c: 7
 b\x0a
+# B: 33, C: 33, L: 6, c: 0
 q
+# B: 33, C: 33, L: 6, c: 0
 n
+# B: 33, C: 33, L: 6, c: 0
 q
diff --git a/tests/l+block-sequence.n=2.invalid.output b/tests/l+block-sequence.n=2.invalid.output
--- a/tests/l+block-sequence.n=2.invalid.output
+++ b/tests/l+block-sequence.n=2.invalid.output
@@ -1,2 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 Q
-!$InputFile$: line 1: column 2: Unexpected '-'
+# B: 0, C: 0, L: 1, c: 0
+-  
+# B: 2, C: 2, L: 1, c: 2
+q
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '-'
diff --git a/tests/l-any-document.bare.input b/tests/l-any-document.bare.input
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.bare.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/l-any-document.bare.output b/tests/l-any-document.bare.output
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.bare.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
+# B: 2, C: 2, L: 2, c: 0
+o
diff --git a/tests/l-any-document.directives.input b/tests/l-any-document.directives.input
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.directives.input
@@ -0,0 +1,2 @@
+%YAML 1.1
+--- a
diff --git a/tests/l-any-document.directives.output b/tests/l-any-document.directives.output
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.directives.output
@@ -0,0 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+D
+# B: 0, C: 0, L: 1, c: 0
+I%
+# B: 1, C: 1, L: 1, c: 1
+tYAML
+# B: 5, C: 5, L: 1, c: 5
+w 
+# B: 6, C: 6, L: 1, c: 6
+t1.1
+# B: 9, C: 9, L: 1, c: 9
+d
+# B: 9, C: 9, L: 1, c: 9
+b\x0a
+# B: 10, C: 10, L: 2, c: 0
+K---
+# B: 13, C: 13, L: 2, c: 3
+w 
+# B: 14, C: 14, L: 2, c: 4
+N
+# B: 14, C: 14, L: 2, c: 4
+S
+# B: 14, C: 14, L: 2, c: 4
+Ta
+# B: 15, C: 15, L: 2, c: 5
+s
+# B: 15, C: 15, L: 2, c: 5
+n
+# B: 15, C: 15, L: 2, c: 5
+b\x0a
+# B: 16, C: 16, L: 3, c: 0
+o
diff --git a/tests/l-any-document.explicit.input b/tests/l-any-document.explicit.input
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.explicit.input
@@ -0,0 +1,2 @@
+--- |
+a
diff --git a/tests/l-any-document.explicit.output b/tests/l-any-document.explicit.output
new file mode 100644
--- /dev/null
+++ b/tests/l-any-document.explicit.output
@@ -0,0 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+K---
+# B: 3, C: 3, L: 1, c: 3
+N
+# B: 3, C: 3, L: 1, c: 3
+w 
+# B: 4, C: 4, L: 1, c: 4
+S
+# B: 4, C: 4, L: 1, c: 4
+I|
+# B: 5, C: 5, L: 1, c: 5
+b\x0a
+# B: 6, C: 6, L: 2, c: 0
+Ta
+# B: 7, C: 7, L: 2, c: 1
+L\x0a
+# B: 8, C: 8, L: 3, c: 0
+s
+# B: 8, C: 8, L: 3, c: 0
+n
+# B: 8, C: 8, L: 3, c: 0
+o
diff --git a/tests/l-bare-document.invalid.input b/tests/l-bare-document.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.invalid.input
@@ -0,0 +1,1 @@
+---
diff --git a/tests/l-bare-document.invalid.output b/tests/l-bare-document.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.invalid.output
@@ -0,0 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+P
+# B: 0, C: 0, L: 1, c: 0
+A
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected forbidden pattern
diff --git a/tests/l-bare-document.literal.input b/tests/l-bare-document.literal.input
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.literal.input
@@ -0,0 +1,2 @@
+|
+a
diff --git a/tests/l-bare-document.literal.output b/tests/l-bare-document.literal.output
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.literal.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I|
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
+# B: 2, C: 2, L: 2, c: 0
+Ta
+# B: 3, C: 3, L: 2, c: 1
+L\x0a
+# B: 4, C: 4, L: 3, c: 0
+s
+# B: 4, C: 4, L: 3, c: 0
+n
diff --git a/tests/l-bare-document.plain.input b/tests/l-bare-document.plain.input
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.plain.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/l-bare-document.plain.output b/tests/l-bare-document.plain.output
new file mode 100644
--- /dev/null
+++ b/tests/l-bare-document.plain.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
diff --git a/tests/l-block-map-explicit-value.n=2.invalid.output b/tests/l-block-map-explicit-value.n=2.invalid.output
--- a/tests/l-block-map-explicit-value.n=2.invalid.output
+++ b/tests/l-block-map-explicit-value.n=2.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
-!$InputFile$: line 1: column 2: Unexpected '?'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '?'
diff --git a/tests/l-block-map-explicit-value.n=2.output b/tests/l-block-map-explicit-value.n=2.output
--- a/tests/l-block-map-explicit-value.n=2.output
+++ b/tests/l-block-map-explicit-value.n=2.output
@@ -1,10 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 I:
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Ta
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
diff --git a/tests/l-chomped-empty.n=4.t=clip.output b/tests/l-chomped-empty.n=4.t=clip.output
--- a/tests/l-chomped-empty.n=4.t=clip.output
+++ b/tests/l-chomped-empty.n=4.t=clip.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 b\x0a
+# B: 4, C: 4, L: 3, c: 0
 i  
+# B: 6, C: 6, L: 3, c: 2
 C
+# B: 6, C: 6, L: 3, c: 2
 I#
+# B: 7, C: 7, L: 3, c: 3
 c
+# B: 7, C: 7, L: 3, c: 3
 b\x0a
+# B: 8, C: 8, L: 4, c: 0
 b\x0a
diff --git a/tests/l-chomped-empty.n=4.t=keep.output b/tests/l-chomped-empty.n=4.t=keep.output
--- a/tests/l-chomped-empty.n=4.t=keep.output
+++ b/tests/l-chomped-empty.n=4.t=keep.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 s
+# B: 4, C: 4, L: 3, c: 0
 i  
+# B: 6, C: 6, L: 3, c: 2
 C
+# B: 6, C: 6, L: 3, c: 2
 I#
+# B: 7, C: 7, L: 3, c: 3
 c
+# B: 7, C: 7, L: 3, c: 3
 b\x0a
+# B: 8, C: 8, L: 4, c: 0
 b\x0a
diff --git a/tests/l-chomped-empty.n=4.t=strip.output b/tests/l-chomped-empty.n=4.t=strip.output
--- a/tests/l-chomped-empty.n=4.t=strip.output
+++ b/tests/l-chomped-empty.n=4.t=strip.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 b\x0a
+# B: 4, C: 4, L: 3, c: 0
 i  
+# B: 6, C: 6, L: 3, c: 2
 C
+# B: 6, C: 6, L: 3, c: 2
 I#
+# B: 7, C: 7, L: 3, c: 3
 c
+# B: 7, C: 7, L: 3, c: 3
 b\x0a
+# B: 8, C: 8, L: 4, c: 0
 b\x0a
diff --git a/tests/l-comment.break.input b/tests/l-comment.break.input
new file mode 100644
--- /dev/null
+++ b/tests/l-comment.break.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/l-comment.break.output b/tests/l-comment.break.output
new file mode 100644
--- /dev/null
+++ b/tests/l-comment.break.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+b\x0a
diff --git a/tests/l-comment.empty.output b/tests/l-comment.empty.output
--- a/tests/l-comment.empty.output
+++ b/tests/l-comment.empty.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
diff --git a/tests/l-comment.invalid.output b/tests/l-comment.invalid.output
--- a/tests/l-comment.invalid.output
+++ b/tests/l-comment.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 w  
-!$InputFile$: line 1: column 2: Unexpected 'a'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'a'
diff --git a/tests/l-comment.spaces-comment.output b/tests/l-comment.spaces-comment.output
--- a/tests/l-comment.spaces-comment.output
+++ b/tests/l-comment.spaces-comment.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 C
+# B: 1, C: 1, L: 1, c: 1
 I#
+# B: 2, C: 2, L: 1, c: 2
 c
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
diff --git a/tests/l-directive.invalid.output b/tests/l-directive.invalid.output
--- a/tests/l-directive.invalid.output
+++ b/tests/l-directive.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
-!$InputFile$: line 1: column 1: Unexpected ' '
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+d
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected ' '
diff --git a/tests/l-directive.reserved.output b/tests/l-directive.reserved.output
--- a/tests/l-directive.reserved.output
+++ b/tests/l-directive.reserved.output
@@ -1,11 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tname
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 tvalue
+# B: 11, C: 11, L: 1, c: 11
 w 
+# B: 12, C: 12, L: 1, c: 12
 t#
+# B: 13, C: 13, L: 1, c: 13
 w 
+# B: 14, C: 14, L: 1, c: 14
 ttext
+# B: 18, C: 18, L: 1, c: 18
 d
+# B: 18, C: 18, L: 1, c: 18
 b\x0a
diff --git a/tests/l-directive.tag.invalid.output b/tests/l-directive.tag.invalid.output
--- a/tests/l-directive.tag.invalid.output
+++ b/tests/l-directive.tag.invalid.output
@@ -1,6 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tTAG
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 H
-!$InputFile$: line 1: column 5: Unexpected 'a'
+# B: 5, C: 5, L: 1, c: 5
+h
+# B: 5, C: 5, L: 1, c: 5
+d
+# B: 5, C: 5, L: 1, c: 5
+!Unexpected 'a'
diff --git a/tests/l-directive.tag.output b/tests/l-directive.tag.output
--- a/tests/l-directive.tag.output
+++ b/tests/l-directive.tag.output
@@ -1,20 +1,42 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tTAG
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 H
+# B: 5, C: 5, L: 1, c: 5
 I!
+# B: 6, C: 6, L: 1, c: 6
 tname
+# B: 10, C: 10, L: 1, c: 10
 I!
+# B: 11, C: 11, L: 1, c: 11
 h
+# B: 11, C: 11, L: 1, c: 11
 w 
+# B: 12, C: 12, L: 1, c: 12
 G
+# B: 12, C: 12, L: 1, c: 12
 I!
+# B: 13, C: 13, L: 1, c: 13
 tprefix
+# B: 19, C: 19, L: 1, c: 19
 g
+# B: 19, C: 19, L: 1, c: 19
 d
+# B: 19, C: 19, L: 1, c: 19
 b\x0a
+# B: 20, C: 20, L: 2, c: 0
 C
+# B: 20, C: 20, L: 2, c: 0
 I#
+# B: 21, C: 21, L: 2, c: 1
 c
+# B: 21, C: 21, L: 2, c: 1
 b\x0a
diff --git a/tests/l-directive.yaml.invalid.output b/tests/l-directive.yaml.invalid.output
--- a/tests/l-directive.yaml.invalid.output
+++ b/tests/l-directive.yaml.invalid.output
@@ -1,5 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tYAML
+# B: 5, C: 5, L: 1, c: 5
 w 
-!$InputFile$: line 1: column 6: Unexpected 'a'
+# B: 6, C: 6, L: 1, c: 6
+d
+# B: 6, C: 6, L: 1, c: 6
+!Unexpected 'a'
diff --git a/tests/l-directive.yaml.output b/tests/l-directive.yaml.output
--- a/tests/l-directive.yaml.output
+++ b/tests/l-directive.yaml.output
@@ -1,7 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 D
+# B: 0, C: 0, L: 1, c: 0
 I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tYAML
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 t0.1
+# B: 9, C: 9, L: 1, c: 9
 d
+# B: 9, C: 9, L: 1, c: 9
 b\x0a
diff --git a/tests/l-directives-document.input b/tests/l-directives-document.input
new file mode 100644
--- /dev/null
+++ b/tests/l-directives-document.input
@@ -0,0 +1,2 @@
+%YAML 1.1
+--- a
diff --git a/tests/l-directives-document.output b/tests/l-directives-document.output
new file mode 100644
--- /dev/null
+++ b/tests/l-directives-document.output
@@ -0,0 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
+D
+# B: 0, C: 0, L: 1, c: 0
+I%
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'doc' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+tYAML
+# B: 5, C: 5, L: 1, c: 5
+w 
+# B: 6, C: 6, L: 1, c: 6
+t1.1
+# B: 9, C: 9, L: 1, c: 9
+d
+# B: 9, C: 9, L: 1, c: 9
+b\x0a
+# B: 10, C: 10, L: 2, c: 0
+K---
+# B: 13, C: 13, L: 2, c: 3
+!Commit to 'doc' was made outside it
+# B: 13, C: 13, L: 2, c: 3
+w 
+# B: 14, C: 14, L: 2, c: 4
+N
+# B: 14, C: 14, L: 2, c: 4
+S
+# B: 14, C: 14, L: 2, c: 4
+Ta
+# B: 15, C: 15, L: 2, c: 5
+s
+# B: 15, C: 15, L: 2, c: 5
+n
+# B: 15, C: 15, L: 2, c: 5
+b\x0a
diff --git a/tests/l-document-prefix.bom-comment.output b/tests/l-document-prefix.bom-comment.output
--- a/tests/l-document-prefix.bom-comment.output
+++ b/tests/l-document-prefix.bom-comment.output
@@ -1,6 +1,12 @@
-UTF8
+# B: 0, C: 0, L: 1, c: 0
+UTF-8
+# B: 3, C: 1, L: 1, c: 1
 C
+# B: 3, C: 1, L: 1, c: 1
 I#
+# B: 4, C: 2, L: 1, c: 2
 t comment
+# B: 12, C: 10, L: 1, c: 10
 c
+# B: 12, C: 10, L: 1, c: 10
 b\x0a
diff --git a/tests/l-document-prefix.bom.output b/tests/l-document-prefix.bom.output
--- a/tests/l-document-prefix.bom.output
+++ b/tests/l-document-prefix.bom.output
@@ -1,1 +1,2 @@
-UTF8
+# B: 0, C: 0, L: 1, c: 0
+UTF-8
diff --git a/tests/l-document-prefix.comment.output b/tests/l-document-prefix.comment.output
--- a/tests/l-document-prefix.comment.output
+++ b/tests/l-document-prefix.comment.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 C
+# B: 0, C: 0, L: 1, c: 0
 I#
+# B: 1, C: 1, L: 1, c: 1
 t comment
+# B: 9, C: 9, L: 1, c: 9
 c
+# B: 9, C: 9, L: 1, c: 9
 b\x0a
diff --git a/tests/l-document-prefix.invalid.output b/tests/l-document-prefix.invalid.output
--- a/tests/l-document-prefix.invalid.output
+++ b/tests/l-document-prefix.invalid.output
@@ -1,2 +1,4 @@
-UTF8
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+UTF-8
+# B: 3, C: 1, L: 1, c: 1
+!Unexpected '\ufeff'
diff --git a/tests/l-document-suffix.invalid.output b/tests/l-document-suffix.invalid.output
--- a/tests/l-document-suffix.invalid.output
+++ b/tests/l-document-suffix.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 k...
-!$InputFile$: line 1: column 3: Expected start of line
+# B: 3, C: 3, L: 1, c: 3
+!Expected start of line
diff --git a/tests/l-document-suffix.output b/tests/l-document-suffix.output
--- a/tests/l-document-suffix.output
+++ b/tests/l-document-suffix.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 k...
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 C
+# B: 4, C: 4, L: 1, c: 4
 I#
+# B: 5, C: 5, L: 1, c: 5
 t end
+# B: 9, C: 9, L: 1, c: 9
 c
+# B: 9, C: 9, L: 1, c: 9
 b\x0a
diff --git a/tests/l-documents.explicit.input b/tests/l-documents.explicit.input
deleted file mode 100644
--- a/tests/l-documents.explicit.input
+++ /dev/null
@@ -1,2 +0,0 @@
---- a
---- b
diff --git a/tests/l-documents.explicit.output b/tests/l-documents.explicit.output
deleted file mode 100644
--- a/tests/l-documents.explicit.output
+++ /dev/null
@@ -1,24 +0,0 @@
-O
-K---
-O
-w 
-N
-S
-Ta
-s
-n
-b\x0a
-o
-o
-O
-K---
-O
-w 
-N
-S
-Tb
-s
-n
-b\x0a
-o
-o
diff --git a/tests/l-documents.implicit.input b/tests/l-documents.implicit.input
deleted file mode 100644
--- a/tests/l-documents.implicit.input
+++ /dev/null
@@ -1,2 +0,0 @@
-a
---- b
diff --git a/tests/l-documents.implicit.output b/tests/l-documents.implicit.output
deleted file mode 100644
--- a/tests/l-documents.implicit.output
+++ /dev/null
@@ -1,20 +0,0 @@
-O
-N
-S
-Ta
-s
-n
-b\x0a
-o
-O
-K---
-O
-w 
-N
-S
-Tb
-s
-n
-b\x0a
-o
-o
diff --git a/tests/l-empty.n=4.c=block-in.indent-lt.output b/tests/l-empty.n=4.c=block-in.indent-lt.output
--- a/tests/l-empty.n=4.c=block-in.indent-lt.output
+++ b/tests/l-empty.n=4.c=block-in.indent-lt.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i   
+# B: 3, C: 3, L: 1, c: 3
 L\x0a
diff --git a/tests/l-empty.n=4.c=block-in.indent-sp.invalid.output b/tests/l-empty.n=4.c=block-in.indent-sp.invalid.output
--- a/tests/l-empty.n=4.c=block-in.indent-sp.invalid.output
+++ b/tests/l-empty.n=4.c=block-in.indent-sp.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
-!$InputFile$: line 1: column 4: Unexpected ' '
+# B: 4, C: 4, L: 1, c: 4
+!Unexpected ' '
diff --git a/tests/l-empty.n=4.c=block-in.indent.output b/tests/l-empty.n=4.c=block-in.indent.output
--- a/tests/l-empty.n=4.c=block-in.indent.output
+++ b/tests/l-empty.n=4.c=block-in.indent.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 4, C: 4, L: 1, c: 4
 L\x0a
diff --git a/tests/l-empty.n=4.c=flow-in.indent-lt.output b/tests/l-empty.n=4.c=flow-in.indent-lt.output
--- a/tests/l-empty.n=4.c=flow-in.indent-lt.output
+++ b/tests/l-empty.n=4.c=flow-in.indent-lt.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i   
+# B: 3, C: 3, L: 1, c: 3
 L\x0a
diff --git a/tests/l-empty.n=4.c=flow-in.indent-sp.output b/tests/l-empty.n=4.c=flow-in.indent-sp.output
--- a/tests/l-empty.n=4.c=flow-in.indent-sp.output
+++ b/tests/l-empty.n=4.c=flow-in.indent-sp.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 L\x0a
diff --git a/tests/l-empty.n=4.c=flow-in.indent.output b/tests/l-empty.n=4.c=flow-in.indent.output
--- a/tests/l-empty.n=4.c=flow-in.indent.output
+++ b/tests/l-empty.n=4.c=flow-in.indent.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 4, C: 4, L: 1, c: 4
 L\x0a
diff --git a/tests/l-explicit-document.invalid.output b/tests/l-explicit-document.invalid.output
--- a/tests/l-explicit-document.invalid.output
+++ b/tests/l-explicit-document.invalid.output
@@ -1,10 +1,16 @@
-O
+# B: 0, C: 0, L: 1, c: 0
 K---
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'doc' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
-o
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 4, C: 4, L: 2, c: 0
+!Unexpected '.'
diff --git a/tests/l-explicit-document.literal.output b/tests/l-explicit-document.literal.output
--- a/tests/l-explicit-document.literal.output
+++ b/tests/l-explicit-document.literal.output
@@ -1,15 +1,22 @@
-O
+# B: 0, C: 0, L: 1, c: 0
 K---
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'doc' was made outside it
-O
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 I|
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 Ta
+# B: 7, C: 7, L: 2, c: 1
 L\x0a
+# B: 8, C: 8, L: 3, c: 0
 s
+# B: 8, C: 8, L: 3, c: 0
 n
-o
-o
diff --git a/tests/l-explicit-document.plain.input b/tests/l-explicit-document.plain.input
deleted file mode 100644
--- a/tests/l-explicit-document.plain.input
+++ /dev/null
@@ -1,2 +0,0 @@
-%YAML 1.1
---- a
diff --git a/tests/l-explicit-document.plain.output b/tests/l-explicit-document.plain.output
deleted file mode 100644
--- a/tests/l-explicit-document.plain.output
+++ /dev/null
@@ -1,21 +0,0 @@
-O
-D
-I%
-tYAML
-w 
-t1.1
-d
-b\x0a
-!Commit to 'doc' was made outside it
-K---
-!Commit to 'doc' was made outside it
-O
-w 
-N
-S
-Ta
-s
-n
-b\x0a
-o
-o
diff --git a/tests/l-folded-content.n=4.t=strip.invalid.output b/tests/l-folded-content.n=4.t=strip.invalid.output
--- a/tests/l-folded-content.n=4.t=strip.invalid.output
+++ b/tests/l-folded-content.n=4.t=strip.invalid.output
@@ -1,3 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 3, C: 3, L: 2, c: 0
+!Unexpected ' '
diff --git a/tests/l-folded-content.n=4.t=strip.output b/tests/l-folded-content.n=4.t=strip.output
--- a/tests/l-folded-content.n=4.t=strip.output
+++ b/tests/l-folded-content.n=4.t=strip.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
-? a
+# B: 4, C: 4, L: 1, c: 4
+- a
+# B: 6, C: 6, L: 1, c: 6
 L\x0a
+# B: 7, C: 7, L: 2, c: 0
 i    
-?b
+# B: 11, C: 11, L: 2, c: 4
+-b
+# B: 12, C: 12, L: 2, c: 5
 L\x0a
+# B: 13, C: 13, L: 3, c: 0
 L\x0a
+# B: 14, C: 14, L: 4, c: 0
 i    
-? c
+# B: 18, C: 18, L: 4, c: 4
+- c
+# B: 20, C: 20, L: 4, c: 6
 s
+# B: 20, C: 20, L: 4, c: 6
 b\x0a
+# B: 21, C: 21, L: 5, c: 0
 b\x0a
+# B: 22, C: 22, L: 6, c: 0
 i  
+# B: 24, C: 24, L: 6, c: 2
 C
+# B: 24, C: 24, L: 6, c: 2
 I#
+# B: 25, C: 25, L: 6, c: 3
 c
+# B: 25, C: 25, L: 6, c: 3
 b\x0a
diff --git a/tests/l-following-document.empty.input b/tests/l-following-document.empty.input
deleted file mode 100644
--- a/tests/l-following-document.empty.input
+++ /dev/null
diff --git a/tests/l-following-document.empty.output b/tests/l-following-document.empty.output
deleted file mode 100644
--- a/tests/l-following-document.empty.output
+++ /dev/null
diff --git a/tests/l-following-document.explicit.input b/tests/l-following-document.explicit.input
deleted file mode 100644
--- a/tests/l-following-document.explicit.input
+++ /dev/null
@@ -1,2 +0,0 @@
-%YAML 1.1
---- a
diff --git a/tests/l-following-document.explicit.output b/tests/l-following-document.explicit.output
deleted file mode 100644
--- a/tests/l-following-document.explicit.output
+++ /dev/null
@@ -1,19 +0,0 @@
-O
-D
-I%
-tYAML
-w 
-t1.1
-d
-b\x0a
-K---
-O
-w 
-N
-S
-Ta
-s
-n
-b\x0a
-o
-o
diff --git a/tests/l-following-document.invalid.input b/tests/l-following-document.invalid.input
deleted file mode 100644
--- a/tests/l-following-document.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/l-following-document.invalid.output b/tests/l-following-document.invalid.output
deleted file mode 100644
--- a/tests/l-following-document.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 0: Expected end of input
diff --git a/tests/l-implicit-document.invalid.input b/tests/l-implicit-document.invalid.input
deleted file mode 100644
--- a/tests/l-implicit-document.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
----
diff --git a/tests/l-implicit-document.invalid.output b/tests/l-implicit-document.invalid.output
deleted file mode 100644
--- a/tests/l-implicit-document.invalid.output
+++ /dev/null
@@ -1,5 +0,0 @@
-O
-N
-P
-A
-!$InputFile$: line 1: column 0: Unexpected forbidden pattern
diff --git a/tests/l-implicit-document.literal.input b/tests/l-implicit-document.literal.input
deleted file mode 100644
--- a/tests/l-implicit-document.literal.input
+++ /dev/null
@@ -1,2 +0,0 @@
-|
-a
diff --git a/tests/l-implicit-document.literal.output b/tests/l-implicit-document.literal.output
deleted file mode 100644
--- a/tests/l-implicit-document.literal.output
+++ /dev/null
@@ -1,10 +0,0 @@
-O
-N
-S
-I|
-b\x0a
-Ta
-L\x0a
-s
-n
-o
diff --git a/tests/l-implicit-document.plain.input b/tests/l-implicit-document.plain.input
deleted file mode 100644
--- a/tests/l-implicit-document.plain.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/l-implicit-document.plain.output b/tests/l-implicit-document.plain.output
deleted file mode 100644
--- a/tests/l-implicit-document.plain.output
+++ /dev/null
@@ -1,9 +0,0 @@
-O
-N
-S
-!Commit to 'node' was made outside it
-Ta
-s
-n
-b\x0a
-o
diff --git a/tests/l-keep-empty.n=4.0.output b/tests/l-keep-empty.n=4.0.output
--- a/tests/l-keep-empty.n=4.0.output
+++ b/tests/l-keep-empty.n=4.0.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 L\x0a
+# B: 5, C: 5, L: 4, c: 0
 s
diff --git a/tests/l-keep-empty.n=4.1.output b/tests/l-keep-empty.n=4.1.output
--- a/tests/l-keep-empty.n=4.1.output
+++ b/tests/l-keep-empty.n=4.1.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 s
+# B: 4, C: 4, L: 3, c: 0
 i  
+# B: 6, C: 6, L: 3, c: 2
 C
+# B: 6, C: 6, L: 3, c: 2
 I#
+# B: 7, C: 7, L: 3, c: 3
 c
+# B: 7, C: 7, L: 3, c: 3
 b\x0a
+# B: 8, C: 8, L: 4, c: 0
 b\x0a
diff --git a/tests/l-leading-document.empty.input b/tests/l-leading-document.empty.input
deleted file mode 100644
--- a/tests/l-leading-document.empty.input
+++ /dev/null
diff --git a/tests/l-leading-document.empty.output b/tests/l-leading-document.empty.output
deleted file mode 100644
--- a/tests/l-leading-document.empty.output
+++ /dev/null
diff --git a/tests/l-leading-document.explicit.input b/tests/l-leading-document.explicit.input
deleted file mode 100644
--- a/tests/l-leading-document.explicit.input
+++ /dev/null
@@ -1,2 +0,0 @@
-%YAML 1.1
---- a
diff --git a/tests/l-leading-document.explicit.output b/tests/l-leading-document.explicit.output
deleted file mode 100644
--- a/tests/l-leading-document.explicit.output
+++ /dev/null
@@ -1,19 +0,0 @@
-O
-D
-I%
-tYAML
-w 
-t1.1
-d
-b\x0a
-K---
-O
-w 
-N
-S
-Ta
-s
-n
-b\x0a
-o
-o
diff --git a/tests/l-leading-document.implicit.input b/tests/l-leading-document.implicit.input
deleted file mode 100644
--- a/tests/l-leading-document.implicit.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/l-leading-document.implicit.output b/tests/l-leading-document.implicit.output
deleted file mode 100644
--- a/tests/l-leading-document.implicit.output
+++ /dev/null
@@ -1,8 +0,0 @@
-O
-N
-S
-Ta
-s
-n
-b\x0a
-o
diff --git a/tests/l-literal-content.n=4.t=strip.invalid.output b/tests/l-literal-content.n=4.t=strip.invalid.output
--- a/tests/l-literal-content.n=4.t=strip.invalid.output
+++ b/tests/l-literal-content.n=4.t=strip.invalid.output
@@ -1,1 +1,4 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/l-literal-content.n=4.t=strip.output b/tests/l-literal-content.n=4.t=strip.output
--- a/tests/l-literal-content.n=4.t=strip.output
+++ b/tests/l-literal-content.n=4.t=strip.output
@@ -1,22 +1,44 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i    
-?# a
+# B: 5, C: 5, L: 2, c: 4
+-# a
+# B: 8, C: 8, L: 2, c: 7
 L\x0a
+# B: 9, C: 9, L: 3, c: 0
 i    
-?b
+# B: 13, C: 13, L: 3, c: 4
+-b
+# B: 14, C: 14, L: 3, c: 5
 L\x0a
+# B: 15, C: 15, L: 4, c: 0
 i  
+# B: 17, C: 17, L: 4, c: 2
 L\x0a
+# B: 18, C: 18, L: 5, c: 0
 i    
-?  # c
+# B: 22, C: 22, L: 5, c: 4
+-  # c
+# B: 27, C: 27, L: 5, c: 9
 s
+# B: 27, C: 27, L: 5, c: 9
 b\x0a
+# B: 28, C: 28, L: 6, c: 0
 b\x0a
+# B: 29, C: 29, L: 7, c: 0
 i  
+# B: 31, C: 31, L: 7, c: 2
 b\x0a
+# B: 32, C: 32, L: 8, c: 0
 i  
+# B: 34, C: 34, L: 8, c: 2
 C
+# B: 34, C: 34, L: 8, c: 2
 I#
+# B: 35, C: 35, L: 8, c: 3
 t d
+# B: 37, C: 37, L: 8, c: 5
 c
+# B: 37, C: 37, L: 8, c: 5
 b\x0a
diff --git a/tests/l-nb-diff-lines.n=3.output b/tests/l-nb-diff-lines.n=3.output
--- a/tests/l-nb-diff-lines.n=3.output
+++ b/tests/l-nb-diff-lines.n=3.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 L\x0a
+# B: 3, C: 3, L: 2, c: 0
 i   
-?a
+# B: 6, C: 6, L: 2, c: 3
+-a
+# B: 7, C: 7, L: 2, c: 4
 b\x0a
+# B: 8, C: 8, L: 3, c: 0
 L\x0a
+# B: 9, C: 9, L: 4, c: 0
 i   
-?b
+# B: 12, C: 12, L: 4, c: 3
+-b
+# B: 13, C: 13, L: 4, c: 4
 L\x0a
+# B: 14, C: 14, L: 5, c: 0
 L\x0a
+# B: 15, C: 15, L: 6, c: 0
 i   
-? c
+# B: 18, C: 18, L: 6, c: 3
+- c
diff --git a/tests/l-nb-folded-lines.n=4.invalid.output b/tests/l-nb-folded-lines.n=4.invalid.output
--- a/tests/l-nb-folded-lines.n=4.invalid.output
+++ b/tests/l-nb-folded-lines.n=4.invalid.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'fold' was made outside it
-?a
-!$InputFile$: line 1: column 5: Expected end of input
+# B: 4, C: 4, L: 1, c: 4
+-a
+# B: 5, C: 5, L: 1, c: 5
+!Unexpected '\x0a'
diff --git a/tests/l-nb-folded-lines.n=4.output b/tests/l-nb-folded-lines.n=4.output
--- a/tests/l-nb-folded-lines.n=4.output
+++ b/tests/l-nb-folded-lines.n=4.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'fold' was made outside it
-?a
+# B: 4, C: 4, L: 1, c: 4
+-a
+# B: 5, C: 5, L: 1, c: 5
 l\x0a
+# B: 6, C: 6, L: 2, c: 0
 i    
+# B: 11, C: 11, L: 2, c: 5
 !Commit to 'fold' was made outside it
-?b
+# B: 10, C: 10, L: 2, c: 4
+-b
+# B: 11, C: 11, L: 2, c: 5
 b\x0a
+# B: 12, C: 12, L: 3, c: 0
 L\x0a
+# B: 13, C: 13, L: 4, c: 0
 i    
+# B: 18, C: 18, L: 4, c: 5
 !Commit to 'fold' was made outside it
-?c
+# B: 17, C: 17, L: 4, c: 4
+-c
diff --git a/tests/l-nb-literal-text.n=4.invalid.output b/tests/l-nb-literal-text.n=4.invalid.output
--- a/tests/l-nb-literal-text.n=4.invalid.output
+++ b/tests/l-nb-literal-text.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 2: Unexpected 'a'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'a'
diff --git a/tests/l-nb-literal-text.n=4.output b/tests/l-nb-literal-text.n=4.output
--- a/tests/l-nb-literal-text.n=4.output
+++ b/tests/l-nb-literal-text.n=4.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 L\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 i    
-?  a  
+# B: 8, C: 8, L: 3, c: 4
+-  a  
diff --git a/tests/l-nb-same-lines.n=3.output b/tests/l-nb-same-lines.n=3.output
--- a/tests/l-nb-same-lines.n=3.output
+++ b/tests/l-nb-same-lines.n=3.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 L\x0a
+# B: 3, C: 3, L: 2, c: 0
 i   
-? a
+# B: 6, C: 6, L: 2, c: 3
+- a
+# B: 8, C: 8, L: 2, c: 5
 L\x0a
+# B: 9, C: 9, L: 3, c: 0
 L\x0a
+# B: 10, C: 10, L: 4, c: 0
 i   
-? b
+# B: 13, C: 13, L: 4, c: 3
+- b
diff --git a/tests/l-nb-same-lines.n=4.output b/tests/l-nb-same-lines.n=4.output
--- a/tests/l-nb-same-lines.n=4.output
+++ b/tests/l-nb-same-lines.n=4.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 L\x0a
+# B: 3, C: 3, L: 2, c: 0
 i    
-?a
+# B: 7, C: 7, L: 2, c: 4
+-a
+# B: 8, C: 8, L: 2, c: 5
 b\x0a
+# B: 9, C: 9, L: 3, c: 0
 L\x0a
+# B: 10, C: 10, L: 4, c: 0
 i    
-?b
+# B: 14, C: 14, L: 4, c: 4
+-b
diff --git a/tests/l-nb-spaced-lines.n=4.invalid.output b/tests/l-nb-spaced-lines.n=4.invalid.output
--- a/tests/l-nb-spaced-lines.n=4.invalid.output
+++ b/tests/l-nb-spaced-lines.n=4.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
-!$InputFile$: line 1: column 4: Unexpected 'a'
+# B: 4, C: 4, L: 1, c: 4
+!Unexpected 'a'
diff --git a/tests/l-nb-spaced-lines.n=4.output b/tests/l-nb-spaced-lines.n=4.output
--- a/tests/l-nb-spaced-lines.n=4.output
+++ b/tests/l-nb-spaced-lines.n=4.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'fold' was made outside it
-? a
+# B: 4, C: 4, L: 1, c: 4
+- a
+# B: 6, C: 6, L: 1, c: 6
 L\x0a
+# B: 7, C: 7, L: 2, c: 0
 i    
+# B: 12, C: 12, L: 2, c: 5
 !Commit to 'fold' was made outside it
-? b
+# B: 11, C: 11, L: 2, c: 4
+- b
+# B: 13, C: 13, L: 2, c: 6
 L\x0a
+# B: 14, C: 14, L: 3, c: 0
 L\x0a
+# B: 15, C: 15, L: 4, c: 0
 i    
+# B: 20, C: 20, L: 4, c: 5
 !Commit to 'fold' was made outside it
-? c
+# B: 19, C: 19, L: 4, c: 4
+- c
diff --git a/tests/l-strip-empty.n=4.0.output b/tests/l-strip-empty.n=4.0.output
--- a/tests/l-strip-empty.n=4.0.output
+++ b/tests/l-strip-empty.n=4.0.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 b\x0a
+# B: 4, C: 4, L: 3, c: 0
 b\x0a
diff --git a/tests/l-strip-empty.n=4.1.output b/tests/l-strip-empty.n=4.1.output
--- a/tests/l-strip-empty.n=4.1.output
+++ b/tests/l-strip-empty.n=4.1.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 b\x0a
+# B: 4, C: 4, L: 3, c: 0
 i  
+# B: 6, C: 6, L: 3, c: 2
 C
+# B: 6, C: 6, L: 3, c: 2
 I#
+# B: 7, C: 7, L: 3, c: 3
 c
+# B: 7, C: 7, L: 3, c: 3
 b\x0a
+# B: 8, C: 8, L: 4, c: 0
 b\x0a
diff --git a/tests/l-trail-comments.n=4.1.output b/tests/l-trail-comments.n=4.1.output
--- a/tests/l-trail-comments.n=4.1.output
+++ b/tests/l-trail-comments.n=4.1.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 C
+# B: 2, C: 2, L: 1, c: 2
 I#
+# B: 3, C: 3, L: 1, c: 3
 c
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
diff --git a/tests/l-trail-comments.n=4.2.output b/tests/l-trail-comments.n=4.2.output
--- a/tests/l-trail-comments.n=4.2.output
+++ b/tests/l-trail-comments.n=4.2.output
@@ -1,9 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 C
+# B: 2, C: 2, L: 1, c: 2
 I#
+# B: 3, C: 3, L: 1, c: 3
 c
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 C
+# B: 4, C: 4, L: 2, c: 0
 I#
+# B: 5, C: 5, L: 2, c: 1
 c
+# B: 5, C: 5, L: 2, c: 1
 b\x0a
diff --git a/tests/l-trail-comments.n=4.3.output b/tests/l-trail-comments.n=4.3.output
--- a/tests/l-trail-comments.n=4.3.output
+++ b/tests/l-trail-comments.n=4.3.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 i  
+# B: 2, C: 2, L: 1, c: 2
 C
+# B: 2, C: 2, L: 1, c: 2
 I#
+# B: 3, C: 3, L: 1, c: 3
 c
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 b\x0a
+# B: 5, C: 5, L: 3, c: 0
 C
+# B: 5, C: 5, L: 3, c: 0
 I#
+# B: 6, C: 6, L: 3, c: 1
 c
+# B: 6, C: 6, L: 3, c: 1
 b\x0a
diff --git a/tests/l-trail-comments.n=4.invalid.output b/tests/l-trail-comments.n=4.invalid.output
--- a/tests/l-trail-comments.n=4.invalid.output
+++ b/tests/l-trail-comments.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 3: Unexpected ' '
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected ' '
diff --git a/tests/l-yaml-stream.bare.input b/tests/l-yaml-stream.bare.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.bare.input
@@ -0,0 +1,3 @@
+a
+...
+b
diff --git a/tests/l-yaml-stream.bare.output b/tests/l-yaml-stream.bare.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.bare.output
@@ -0,0 +1,36 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
+# B: 2, C: 2, L: 2, c: 0
+o
+# B: 2, C: 2, L: 2, c: 0
+k...
+# B: 5, C: 5, L: 2, c: 3
+b\x0a
+# B: 6, C: 6, L: 3, c: 0
+O
+# B: 6, C: 6, L: 3, c: 0
+N
+# B: 6, C: 6, L: 3, c: 0
+S
+# B: 6, C: 6, L: 3, c: 0
+Tb
+# B: 7, C: 7, L: 3, c: 1
+s
+# B: 7, C: 7, L: 3, c: 1
+n
+# B: 7, C: 7, L: 3, c: 1
+b\x0a
+# B: 8, C: 8, L: 4, c: 0
+o
diff --git a/tests/l-yaml-stream.directives.input b/tests/l-yaml-stream.directives.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.directives.input
@@ -0,0 +1,5 @@
+%YAML 1.2
+--- a
+...
+%YAML 1.2
+--- b
diff --git a/tests/l-yaml-stream.directives.invalid.input b/tests/l-yaml-stream.directives.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.directives.invalid.input
@@ -0,0 +1,4 @@
+%YAML 1.2
+--- a
+%YAML 1.2
+--- b
diff --git a/tests/l-yaml-stream.directives.invalid.output b/tests/l-yaml-stream.directives.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.directives.invalid.output
@@ -0,0 +1,58 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+D
+# B: 0, C: 0, L: 1, c: 0
+I%
+# B: 1, C: 1, L: 1, c: 1
+tYAML
+# B: 5, C: 5, L: 1, c: 5
+w 
+# B: 6, C: 6, L: 1, c: 6
+t1.2
+# B: 9, C: 9, L: 1, c: 9
+d
+# B: 9, C: 9, L: 1, c: 9
+b\x0a
+# B: 10, C: 10, L: 2, c: 0
+K---
+# B: 13, C: 13, L: 2, c: 3
+w 
+# B: 14, C: 14, L: 2, c: 4
+N
+# B: 14, C: 14, L: 2, c: 4
+S
+# B: 14, C: 14, L: 2, c: 4
+Ta
+# B: 15, C: 15, L: 2, c: 5
+l\x0a
+# B: 16, C: 16, L: 3, c: 0
+T%YAML 1.2
+# B: 25, C: 25, L: 3, c: 9
+s
+# B: 25, C: 25, L: 3, c: 9
+n
+# B: 25, C: 25, L: 3, c: 9
+b\x0a
+# B: 26, C: 26, L: 4, c: 0
+o
+# B: 26, C: 26, L: 4, c: 0
+O
+# B: 26, C: 26, L: 4, c: 0
+K---
+# B: 29, C: 29, L: 4, c: 3
+w 
+# B: 30, C: 30, L: 4, c: 4
+N
+# B: 30, C: 30, L: 4, c: 4
+S
+# B: 30, C: 30, L: 4, c: 4
+Tb
+# B: 31, C: 31, L: 4, c: 5
+s
+# B: 31, C: 31, L: 4, c: 5
+n
+# B: 31, C: 31, L: 4, c: 5
+b\x0a
+# B: 32, C: 32, L: 5, c: 0
+o
diff --git a/tests/l-yaml-stream.directives.output b/tests/l-yaml-stream.directives.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.directives.output
@@ -0,0 +1,72 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+D
+# B: 0, C: 0, L: 1, c: 0
+I%
+# B: 1, C: 1, L: 1, c: 1
+tYAML
+# B: 5, C: 5, L: 1, c: 5
+w 
+# B: 6, C: 6, L: 1, c: 6
+t1.2
+# B: 9, C: 9, L: 1, c: 9
+d
+# B: 9, C: 9, L: 1, c: 9
+b\x0a
+# B: 10, C: 10, L: 2, c: 0
+K---
+# B: 13, C: 13, L: 2, c: 3
+w 
+# B: 14, C: 14, L: 2, c: 4
+N
+# B: 14, C: 14, L: 2, c: 4
+S
+# B: 14, C: 14, L: 2, c: 4
+Ta
+# B: 15, C: 15, L: 2, c: 5
+s
+# B: 15, C: 15, L: 2, c: 5
+n
+# B: 15, C: 15, L: 2, c: 5
+b\x0a
+# B: 16, C: 16, L: 3, c: 0
+o
+# B: 16, C: 16, L: 3, c: 0
+k...
+# B: 19, C: 19, L: 3, c: 3
+b\x0a
+# B: 20, C: 20, L: 4, c: 0
+O
+# B: 20, C: 20, L: 4, c: 0
+D
+# B: 20, C: 20, L: 4, c: 0
+I%
+# B: 21, C: 21, L: 4, c: 1
+tYAML
+# B: 25, C: 25, L: 4, c: 5
+w 
+# B: 26, C: 26, L: 4, c: 6
+t1.2
+# B: 29, C: 29, L: 4, c: 9
+d
+# B: 29, C: 29, L: 4, c: 9
+b\x0a
+# B: 30, C: 30, L: 5, c: 0
+K---
+# B: 33, C: 33, L: 5, c: 3
+w 
+# B: 34, C: 34, L: 5, c: 4
+N
+# B: 34, C: 34, L: 5, c: 4
+S
+# B: 34, C: 34, L: 5, c: 4
+Tb
+# B: 35, C: 35, L: 5, c: 5
+s
+# B: 35, C: 35, L: 5, c: 5
+n
+# B: 35, C: 35, L: 5, c: 5
+b\x0a
+# B: 36, C: 36, L: 6, c: 0
+o
diff --git a/tests/l-yaml-stream.empty.output b/tests/l-yaml-stream.empty.output
--- a/tests/l-yaml-stream.empty.output
+++ b/tests/l-yaml-stream.empty.output
@@ -1,6 +1,8 @@
-Y
+# B: 0, C: 0, L: 1, c: 0
 k...
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 k...
+# B: 7, C: 7, L: 2, c: 3
 b\x0a
-y
diff --git a/tests/l-yaml-stream.explicit.input b/tests/l-yaml-stream.explicit.input
--- a/tests/l-yaml-stream.explicit.input
+++ b/tests/l-yaml-stream.explicit.input
@@ -1,3 +1,2 @@
 --- a
-...
 --- b
diff --git a/tests/l-yaml-stream.explicit.output b/tests/l-yaml-stream.explicit.output
--- a/tests/l-yaml-stream.explicit.output
+++ b/tests/l-yaml-stream.explicit.output
@@ -1,28 +1,40 @@
-Y
+# B: 0, C: 0, L: 1, c: 0
 O
+# B: 0, C: 0, L: 1, c: 0
 K---
-O
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 Ta
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
-o
+# B: 6, C: 6, L: 2, c: 0
 o
-k...
-b\x0a
+# B: 6, C: 6, L: 2, c: 0
 O
+# B: 6, C: 6, L: 2, c: 0
 K---
-O
+# B: 9, C: 9, L: 2, c: 3
 w 
+# B: 10, C: 10, L: 2, c: 4
 N
+# B: 10, C: 10, L: 2, c: 4
 S
+# B: 10, C: 10, L: 2, c: 4
 Tb
+# B: 11, C: 11, L: 2, c: 5
 s
+# B: 11, C: 11, L: 2, c: 5
 n
+# B: 11, C: 11, L: 2, c: 5
 b\x0a
-o
+# B: 12, C: 12, L: 3, c: 0
 o
-y
diff --git a/tests/l-yaml-stream.implicit.input b/tests/l-yaml-stream.implicit.input
deleted file mode 100644
--- a/tests/l-yaml-stream.implicit.input
+++ /dev/null
@@ -1,3 +0,0 @@
-a
-...
-b
diff --git a/tests/l-yaml-stream.implicit.output b/tests/l-yaml-stream.implicit.output
deleted file mode 100644
--- a/tests/l-yaml-stream.implicit.output
+++ /dev/null
@@ -1,20 +0,0 @@
-Y
-O
-N
-S
-Ta
-s
-n
-b\x0a
-o
-k...
-b\x0a
-O
-N
-S
-Tb
-s
-n
-b\x0a
-o
-y
diff --git a/tests/l-yaml-stream.map-no-eof.input b/tests/l-yaml-stream.map-no-eof.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.map-no-eof.input
@@ -0,0 +1,2 @@
+a:
+ b:
diff --git a/tests/l-yaml-stream.map-no-eof.output b/tests/l-yaml-stream.map-no-eof.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.map-no-eof.output
@@ -0,0 +1,64 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+M
+# B: 0, C: 0, L: 1, c: 0
+X
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+I:
+# B: 2, C: 2, L: 1, c: 2
+N
+# B: 2, C: 2, L: 1, c: 2
+b\x0a
+# B: 3, C: 3, L: 2, c: 0
+M
+# B: 3, C: 3, L: 2, c: 0
+i 
+# B: 4, C: 4, L: 2, c: 1
+X
+# B: 4, C: 4, L: 2, c: 1
+N
+# B: 4, C: 4, L: 2, c: 1
+S
+# B: 4, C: 4, L: 2, c: 1
+Tb
+# B: 5, C: 5, L: 2, c: 2
+s
+# B: 5, C: 5, L: 2, c: 2
+n
+# B: 5, C: 5, L: 2, c: 2
+I:
+# B: 6, C: 6, L: 2, c: 3
+N
+# B: 6, C: 6, L: 2, c: 3
+S
+# B: 6, C: 6, L: 2, c: 3
+s
+# B: 6, C: 6, L: 2, c: 3
+n
+# B: 6, C: 6, L: 2, c: 3
+x
+# B: 6, C: 6, L: 2, c: 3
+m
+# B: 6, C: 6, L: 2, c: 3
+n
+# B: 6, C: 6, L: 2, c: 3
+x
+# B: 6, C: 6, L: 2, c: 3
+m
+# B: 6, C: 6, L: 2, c: 3
+n
+# B: 6, C: 6, L: 2, c: 3
+o
diff --git a/tests/l-yaml-stream.plain-no-eof.input b/tests/l-yaml-stream.plain-no-eof.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.plain-no-eof.input
@@ -0,0 +1,1 @@
+a  
diff --git a/tests/l-yaml-stream.plain-no-eof.output b/tests/l-yaml-stream.plain-no-eof.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.plain-no-eof.output
@@ -0,0 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+w  
+# B: 3, C: 3, L: 1, c: 3
+o
diff --git a/tests/l-yaml-stream.unparsed-docs.input b/tests/l-yaml-stream.unparsed-docs.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-docs.input
@@ -0,0 +1,5 @@
+{ a
+---
+{ b
+...
+{ c
diff --git a/tests/l-yaml-stream.unparsed-docs.output b/tests/l-yaml-stream.unparsed-docs.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-docs.output
@@ -0,0 +1,108 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+M
+# B: 0, C: 0, L: 1, c: 0
+I{
+# B: 1, C: 1, L: 1, c: 1
+w 
+# B: 2, C: 2, L: 1, c: 2
+X
+# B: 2, C: 2, L: 1, c: 2
+N
+# B: 2, C: 2, L: 1, c: 2
+S
+# B: 2, C: 2, L: 1, c: 2
+Ta
+# B: 3, C: 3, L: 1, c: 3
+s
+# B: 3, C: 3, L: 1, c: 3
+n
+# B: 3, C: 3, L: 1, c: 3
+N
+# B: 3, C: 3, L: 1, c: 3
+S
+# B: 3, C: 3, L: 1, c: 3
+s
+# B: 3, C: 3, L: 1, c: 3
+n
+# B: 3, C: 3, L: 1, c: 3
+x
+# B: 3, C: 3, L: 1, c: 3
+b\x0a
+# B: 4, C: 4, L: 2, c: 0
+m
+# B: 4, C: 4, L: 2, c: 0
+n
+# B: 4, C: 4, L: 2, c: 0
+!Unexpected forbidden pattern
+# B: 4, C: 4, L: 2, c: 0
+o
+# B: 4, C: 4, L: 2, c: 0
+O
+# B: 4, C: 4, L: 2, c: 0
+K---
+# B: 7, C: 7, L: 2, c: 3
+N
+# B: 7, C: 7, L: 2, c: 3
+S
+# B: 7, C: 7, L: 2, c: 3
+s
+# B: 7, C: 7, L: 2, c: 3
+n
+# B: 7, C: 7, L: 2, c: 3
+b\x0a
+# B: 8, C: 8, L: 3, c: 0
+-{ b
+# B: 11, C: 11, L: 3, c: 3
+-\x0a
+# B: 12, C: 12, L: 4, c: 0
+o
+# B: 12, C: 12, L: 4, c: 0
+k...
+# B: 15, C: 15, L: 4, c: 3
+b\x0a
+# B: 16, C: 16, L: 5, c: 0
+O
+# B: 16, C: 16, L: 5, c: 0
+N
+# B: 16, C: 16, L: 5, c: 0
+M
+# B: 16, C: 16, L: 5, c: 0
+I{
+# B: 17, C: 17, L: 5, c: 1
+w 
+# B: 18, C: 18, L: 5, c: 2
+X
+# B: 18, C: 18, L: 5, c: 2
+N
+# B: 18, C: 18, L: 5, c: 2
+S
+# B: 18, C: 18, L: 5, c: 2
+Tc
+# B: 19, C: 19, L: 5, c: 3
+s
+# B: 19, C: 19, L: 5, c: 3
+n
+# B: 19, C: 19, L: 5, c: 3
+N
+# B: 19, C: 19, L: 5, c: 3
+S
+# B: 19, C: 19, L: 5, c: 3
+s
+# B: 19, C: 19, L: 5, c: 3
+n
+# B: 19, C: 19, L: 5, c: 3
+x
+# B: 19, C: 19, L: 5, c: 3
+b\x0a
+# B: 20, C: 20, L: 6, c: 0
+m
+# B: 20, C: 20, L: 6, c: 0
+n
+# B: 20, C: 20, L: 6, c: 0
+!Unexpected end of input
+# B: 20, C: 20, L: 6, c: 0
+o
diff --git a/tests/l-yaml-stream.unparsed-map.input b/tests/l-yaml-stream.unparsed-map.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-map.input
@@ -0,0 +1,4 @@
+a:
+  { b
+c:
+  { d }
diff --git a/tests/l-yaml-stream.unparsed-map.output b/tests/l-yaml-stream.unparsed-map.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-map.output
@@ -0,0 +1,134 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+M
+# B: 0, C: 0, L: 1, c: 0
+X
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+I:
+# B: 2, C: 2, L: 1, c: 2
+b\x0a
+# B: 3, C: 3, L: 2, c: 0
+i 
+# B: 4, C: 4, L: 2, c: 1
+w 
+# B: 5, C: 5, L: 2, c: 2
+N
+# B: 5, C: 5, L: 2, c: 2
+M
+# B: 5, C: 5, L: 2, c: 2
+I{
+# B: 6, C: 6, L: 2, c: 3
+w 
+# B: 7, C: 7, L: 2, c: 4
+X
+# B: 7, C: 7, L: 2, c: 4
+N
+# B: 7, C: 7, L: 2, c: 4
+S
+# B: 7, C: 7, L: 2, c: 4
+Tb
+# B: 8, C: 8, L: 2, c: 5
+s
+# B: 8, C: 8, L: 2, c: 5
+n
+# B: 8, C: 8, L: 2, c: 5
+N
+# B: 8, C: 8, L: 2, c: 5
+S
+# B: 8, C: 8, L: 2, c: 5
+s
+# B: 8, C: 8, L: 2, c: 5
+n
+# B: 8, C: 8, L: 2, c: 5
+x
+# B: 8, C: 8, L: 2, c: 5
+m
+# B: 8, C: 8, L: 2, c: 5
+n
+# B: 8, C: 8, L: 2, c: 5
+!Unexpected '\x0a'
+# B: 8, C: 8, L: 2, c: 5
+-\x0a
+# B: 9, C: 9, L: 3, c: 0
+x
+# B: 9, C: 9, L: 3, c: 0
+X
+# B: 9, C: 9, L: 3, c: 0
+N
+# B: 9, C: 9, L: 3, c: 0
+S
+# B: 9, C: 9, L: 3, c: 0
+Tc
+# B: 10, C: 10, L: 3, c: 1
+s
+# B: 10, C: 10, L: 3, c: 1
+n
+# B: 10, C: 10, L: 3, c: 1
+I:
+# B: 11, C: 11, L: 3, c: 2
+b\x0a
+# B: 12, C: 12, L: 4, c: 0
+i 
+# B: 13, C: 13, L: 4, c: 1
+w 
+# B: 14, C: 14, L: 4, c: 2
+N
+# B: 14, C: 14, L: 4, c: 2
+M
+# B: 14, C: 14, L: 4, c: 2
+I{
+# B: 15, C: 15, L: 4, c: 3
+w 
+# B: 16, C: 16, L: 4, c: 4
+X
+# B: 16, C: 16, L: 4, c: 4
+N
+# B: 16, C: 16, L: 4, c: 4
+S
+# B: 16, C: 16, L: 4, c: 4
+Td
+# B: 17, C: 17, L: 4, c: 5
+s
+# B: 17, C: 17, L: 4, c: 5
+n
+# B: 17, C: 17, L: 4, c: 5
+N
+# B: 17, C: 17, L: 4, c: 5
+S
+# B: 17, C: 17, L: 4, c: 5
+s
+# B: 17, C: 17, L: 4, c: 5
+n
+# B: 17, C: 17, L: 4, c: 5
+x
+# B: 17, C: 17, L: 4, c: 5
+w 
+# B: 18, C: 18, L: 4, c: 6
+I}
+# B: 19, C: 19, L: 4, c: 7
+m
+# B: 19, C: 19, L: 4, c: 7
+n
+# B: 19, C: 19, L: 4, c: 7
+b\x0a
+# B: 20, C: 20, L: 5, c: 0
+x
+# B: 20, C: 20, L: 5, c: 0
+m
+# B: 20, C: 20, L: 5, c: 0
+n
+# B: 20, C: 20, L: 5, c: 0
+o
diff --git a/tests/l-yaml-stream.unparsed-seq.input b/tests/l-yaml-stream.unparsed-seq.input
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-seq.input
@@ -0,0 +1,3 @@
+- a
+- { b
+- c
diff --git a/tests/l-yaml-stream.unparsed-seq.output b/tests/l-yaml-stream.unparsed-seq.output
new file mode 100644
--- /dev/null
+++ b/tests/l-yaml-stream.unparsed-seq.output
@@ -0,0 +1,86 @@
+# B: 0, C: 0, L: 1, c: 0
+O
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+Q
+# B: 0, C: 0, L: 1, c: 0
+I-
+# B: 1, C: 1, L: 1, c: 1
+w 
+# B: 2, C: 2, L: 1, c: 2
+N
+# B: 2, C: 2, L: 1, c: 2
+S
+# B: 2, C: 2, L: 1, c: 2
+Ta
+# B: 3, C: 3, L: 1, c: 3
+s
+# B: 3, C: 3, L: 1, c: 3
+n
+# B: 3, C: 3, L: 1, c: 3
+b\x0a
+# B: 4, C: 4, L: 2, c: 0
+I-
+# B: 5, C: 5, L: 2, c: 1
+w 
+# B: 6, C: 6, L: 2, c: 2
+N
+# B: 6, C: 6, L: 2, c: 2
+M
+# B: 6, C: 6, L: 2, c: 2
+I{
+# B: 7, C: 7, L: 2, c: 3
+w 
+# B: 8, C: 8, L: 2, c: 4
+X
+# B: 8, C: 8, L: 2, c: 4
+N
+# B: 8, C: 8, L: 2, c: 4
+S
+# B: 8, C: 8, L: 2, c: 4
+Tb
+# B: 9, C: 9, L: 2, c: 5
+s
+# B: 9, C: 9, L: 2, c: 5
+n
+# B: 9, C: 9, L: 2, c: 5
+N
+# B: 9, C: 9, L: 2, c: 5
+S
+# B: 9, C: 9, L: 2, c: 5
+s
+# B: 9, C: 9, L: 2, c: 5
+n
+# B: 9, C: 9, L: 2, c: 5
+x
+# B: 9, C: 9, L: 2, c: 5
+m
+# B: 9, C: 9, L: 2, c: 5
+n
+# B: 9, C: 9, L: 2, c: 5
+!Unexpected '\x0a'
+# B: 9, C: 9, L: 2, c: 5
+-\x0a
+# B: 10, C: 10, L: 3, c: 0
+I-
+# B: 11, C: 11, L: 3, c: 1
+w 
+# B: 12, C: 12, L: 3, c: 2
+N
+# B: 12, C: 12, L: 3, c: 2
+S
+# B: 12, C: 12, L: 3, c: 2
+Tc
+# B: 13, C: 13, L: 3, c: 3
+s
+# B: 13, C: 13, L: 3, c: 3
+n
+# B: 13, C: 13, L: 3, c: 3
+b\x0a
+# B: 14, C: 14, L: 4, c: 0
+q
+# B: 14, C: 14, L: 4, c: 0
+n
+# B: 14, C: 14, L: 4, c: 0
+o
diff --git a/tests/nb-char.invalid.output b/tests/nb-char.invalid.output
--- a/tests/nb-char.invalid.output
+++ b/tests/nb-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '\x0a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x0a'
diff --git a/tests/nb-char.output b/tests/nb-char.output
--- a/tests/nb-char.output
+++ b/tests/nb-char.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/nb-double-char.a.output b/tests/nb-double-char.a.output
--- a/tests/nb-double-char.a.output
+++ b/tests/nb-double-char.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/nb-double-char.backslash.invalid.output b/tests/nb-double-char.backslash.invalid.output
--- a/tests/nb-double-char.backslash.invalid.output
+++ b/tests/nb-double-char.backslash.invalid.output
@@ -1,3 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
-!$InputFile$: line 1: column 1: Unexpected end of input
+# B: 1, C: 1, L: 1, c: 1
+e
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected end of input
diff --git a/tests/nb-double-char.double-quote.invalid.output b/tests/nb-double-char.double-quote.invalid.output
--- a/tests/nb-double-char.double-quote.invalid.output
+++ b/tests/nb-double-char.double-quote.invalid.output
@@ -1,2 +1,2 @@
-E
-!$InputFile$: line 1: column 0: Unexpected '"'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '"'
diff --git a/tests/nb-double-char.escaped.output b/tests/nb-double-char.escaped.output
--- a/tests/nb-double-char.escaped.output
+++ b/tests/nb-double-char.escaped.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I\x5c
+# B: 1, C: 1, L: 1, c: 1
 t\x5c
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/nb-double-multi-line.n=4.invalid.output b/tests/nb-double-multi-line.n=4.invalid.output
--- a/tests/nb-double-multi-line.n=4.invalid.output
+++ b/tests/nb-double-multi-line.n=4.invalid.output
@@ -1,2 +1,4 @@
-?a
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+-a
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '\x0a'
diff --git a/tests/nb-double-multi-line.n=4.output b/tests/nb-double-multi-line.n=4.output
--- a/tests/nb-double-multi-line.n=4.output
+++ b/tests/nb-double-multi-line.n=4.output
@@ -1,6 +1,12 @@
-? a
+# B: 0, C: 0, L: 1, c: 0
+- a
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 l\x0a
+# B: 4, C: 4, L: 2, c: 0
 i    
+# B: 8, C: 8, L: 2, c: 4
 w\x09
-?a b\x09c 
+# B: 9, C: 9, L: 2, c: 5
+-a b\x09c 
diff --git a/tests/nb-double-one-line.output b/tests/nb-double-one-line.output
--- a/tests/nb-double-one-line.output
+++ b/tests/nb-double-one-line.output
@@ -1,1 +1,2 @@
-? a b 
+# B: 0, C: 0, L: 1, c: 0
+- a b 
diff --git a/tests/nb-double-text.n=4.c=flow-key.invalid.output b/tests/nb-double-text.n=4.c=flow-key.invalid.output
--- a/tests/nb-double-text.n=4.c=flow-key.invalid.output
+++ b/tests/nb-double-text.n=4.c=flow-key.invalid.output
@@ -1,2 +1,4 @@
-?a
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+-a
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '\x0a'
diff --git a/tests/nb-double-text.n=4.c=flow-key.output b/tests/nb-double-text.n=4.c=flow-key.output
--- a/tests/nb-double-text.n=4.c=flow-key.output
+++ b/tests/nb-double-text.n=4.c=flow-key.output
@@ -1,1 +1,2 @@
-? a\x09
+# B: 0, C: 0, L: 1, c: 0
+- a\x09
diff --git a/tests/nb-double-text.n=4.c=flow-out.output b/tests/nb-double-text.n=4.c=flow-out.output
--- a/tests/nb-double-text.n=4.c=flow-out.output
+++ b/tests/nb-double-text.n=4.c=flow-out.output
@@ -1,6 +1,12 @@
-? a
+# B: 0, C: 0, L: 1, c: 0
+- a
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 l\x0a
+# B: 4, C: 4, L: 2, c: 0
 i    
+# B: 8, C: 8, L: 2, c: 4
 w\x09
-?a b\x09c 
+# B: 9, C: 9, L: 2, c: 5
+-a b\x09c 
diff --git a/tests/nb-json.10000.input b/tests/nb-json.10000.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.10000.input
@@ -0,0 +1,1 @@
+𐀀
diff --git a/tests/nb-json.10000.output b/tests/nb-json.10000.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.10000.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\U00010000
diff --git a/tests/nb-json.10ffff.input b/tests/nb-json.10ffff.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.10ffff.input
@@ -0,0 +1,1 @@
+􏿿
diff --git a/tests/nb-json.10ffff.output b/tests/nb-json.10ffff.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.10ffff.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\U0010ffff
diff --git a/tests/nb-json.d7ff.input b/tests/nb-json.d7ff.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.d7ff.input
@@ -0,0 +1,1 @@
+퟿
diff --git a/tests/nb-json.d7ff.output b/tests/nb-json.d7ff.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.d7ff.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\ud7ff
diff --git a/tests/nb-json.e000.input b/tests/nb-json.e000.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.e000.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/nb-json.e000.output b/tests/nb-json.e000.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.e000.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\ue000
diff --git a/tests/nb-json.ff.input b/tests/nb-json.ff.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.ff.input
@@ -0,0 +1,1 @@
+ÿ
diff --git a/tests/nb-json.ff.output b/tests/nb-json.ff.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.ff.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\xff
diff --git a/tests/nb-json.fffd.input b/tests/nb-json.fffd.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.fffd.input
@@ -0,0 +1,1 @@
+�
diff --git a/tests/nb-json.fffd.output b/tests/nb-json.fffd.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.fffd.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\ufffd
diff --git a/tests/nb-json.invalid.output b/tests/nb-json.invalid.output
--- a/tests/nb-json.invalid.output
+++ b/tests/nb-json.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '\x0a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x0a'
diff --git a/tests/nb-json.nbsp.input b/tests/nb-json.nbsp.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.nbsp.input
@@ -0,0 +1,1 @@
+ 
diff --git a/tests/nb-json.nbsp.output b/tests/nb-json.nbsp.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.nbsp.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\xa0
diff --git a/tests/nb-json.nel.input b/tests/nb-json.nel.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.nel.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/nb-json.nel.output b/tests/nb-json.nel.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.nel.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\x85
diff --git a/tests/nb-json.output b/tests/nb-json.output
--- a/tests/nb-json.output
+++ b/tests/nb-json.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/nb-json.sp.input b/tests/nb-json.sp.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.sp.input
@@ -0,0 +1,1 @@
+ 
diff --git a/tests/nb-json.sp.output b/tests/nb-json.sp.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.sp.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+- 
diff --git a/tests/nb-json.tab.input b/tests/nb-json.tab.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.tab.input
@@ -0,0 +1,1 @@
+	
diff --git a/tests/nb-json.tab.output b/tests/nb-json.tab.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.tab.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-\x09
diff --git a/tests/nb-json.tilde.input b/tests/nb-json.tilde.input
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.tilde.input
@@ -0,0 +1,1 @@
+~
diff --git a/tests/nb-json.tilde.output b/tests/nb-json.tilde.output
new file mode 100644
--- /dev/null
+++ b/tests/nb-json.tilde.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+-~
diff --git a/tests/nb-ns-double-in-line.invalid.output b/tests/nb-ns-double-in-line.invalid.output
--- a/tests/nb-ns-double-in-line.invalid.output
+++ b/tests/nb-ns-double-in-line.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x5c'
diff --git a/tests/nb-ns-double-in-line.output b/tests/nb-ns-double-in-line.output
--- a/tests/nb-ns-double-in-line.output
+++ b/tests/nb-ns-double-in-line.output
@@ -1,1 +1,2 @@
-? \x09a
+# B: 0, C: 0, L: 1, c: 0
+- \x09a
diff --git a/tests/nb-ns-plain-in-line.c=flow-in.invalid.output b/tests/nb-ns-plain-in-line.c=flow-in.invalid.output
--- a/tests/nb-ns-plain-in-line.c=flow-in.invalid.output
+++ b/tests/nb-ns-plain-in-line.c=flow-in.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/nb-ns-plain-in-line.c=flow-in.output b/tests/nb-ns-plain-in-line.c=flow-in.output
--- a/tests/nb-ns-plain-in-line.c=flow-in.output
+++ b/tests/nb-ns-plain-in-line.c=flow-in.output
@@ -1,1 +1,2 @@
-? \x09a
+# B: 0, C: 0, L: 1, c: 0
+- \x09a
diff --git a/tests/nb-ns-plain-in-line.c=flow-out.invalid.output b/tests/nb-ns-plain-in-line.c=flow-out.invalid.output
--- a/tests/nb-ns-plain-in-line.c=flow-out.invalid.output
+++ b/tests/nb-ns-plain-in-line.c=flow-out.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/nb-ns-single-in-line.invalid.output b/tests/nb-ns-single-in-line.invalid.output
--- a/tests/nb-ns-single-in-line.invalid.output
+++ b/tests/nb-ns-single-in-line.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/nb-ns-single-in-line.output b/tests/nb-ns-single-in-line.output
--- a/tests/nb-ns-single-in-line.output
+++ b/tests/nb-ns-single-in-line.output
@@ -1,1 +1,2 @@
-? \x09a
+# B: 0, C: 0, L: 1, c: 0
+- \x09a
diff --git a/tests/nb-plain-char.c=flow-in.invalid.input b/tests/nb-plain-char.c=flow-in.invalid.input
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-in.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-,
diff --git a/tests/nb-plain-char.c=flow-in.invalid.output b/tests/nb-plain-char.c=flow-in.invalid.output
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-in.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 0: Unexpected ','
diff --git a/tests/nb-plain-char.c=flow-in.space.input b/tests/nb-plain-char.c=flow-in.space.input
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-in.space.input
+++ /dev/null
@@ -1,1 +0,0 @@
- 
diff --git a/tests/nb-plain-char.c=flow-in.space.output b/tests/nb-plain-char.c=flow-in.space.output
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-in.space.output
+++ /dev/null
@@ -1,1 +0,0 @@
-? 
diff --git a/tests/nb-plain-char.c=flow-out.a.input b/tests/nb-plain-char.c=flow-out.a.input
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-out.a.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/nb-plain-char.c=flow-out.a.output b/tests/nb-plain-char.c=flow-out.a.output
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-out.a.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?a
diff --git a/tests/nb-plain-char.c=flow-out.comma.input b/tests/nb-plain-char.c=flow-out.comma.input
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-out.comma.input
+++ /dev/null
@@ -1,1 +0,0 @@
-,
diff --git a/tests/nb-plain-char.c=flow-out.comma.output b/tests/nb-plain-char.c=flow-out.comma.output
deleted file mode 100644
--- a/tests/nb-plain-char.c=flow-out.comma.output
+++ /dev/null
@@ -1,1 +0,0 @@
-?,
diff --git a/tests/nb-single-char.escaped.output b/tests/nb-single-char.escaped.output
--- a/tests/nb-single-char.escaped.output
+++ b/tests/nb-single-char.escaped.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I'
+# B: 1, C: 1, L: 1, c: 1
 t'
+# B: 2, C: 2, L: 1, c: 2
 e
diff --git a/tests/nb-single-char.invalid.output b/tests/nb-single-char.invalid.output
--- a/tests/nb-single-char.invalid.output
+++ b/tests/nb-single-char.invalid.output
@@ -1,3 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 E
+# B: 0, C: 0, L: 1, c: 0
 I'
-!$InputFile$: line 1: column 1: Unexpected end of input
+# B: 1, C: 1, L: 1, c: 1
+e
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected end of input
diff --git a/tests/nb-single-multi-line.n=4.invalid.output b/tests/nb-single-multi-line.n=4.invalid.output
--- a/tests/nb-single-multi-line.n=4.invalid.output
+++ b/tests/nb-single-multi-line.n=4.invalid.output
@@ -1,2 +1,4 @@
-? a
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+- a
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '\x0a'
diff --git a/tests/nb-single-multi-line.n=4.output b/tests/nb-single-multi-line.n=4.output
--- a/tests/nb-single-multi-line.n=4.output
+++ b/tests/nb-single-multi-line.n=4.output
@@ -1,6 +1,12 @@
-? a
+# B: 0, C: 0, L: 1, c: 0
+- a
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 l\x0a
+# B: 4, C: 4, L: 2, c: 0
 i    
+# B: 8, C: 8, L: 2, c: 4
 w\x09
-?a b\x09c 
+# B: 9, C: 9, L: 2, c: 5
+-a b\x09c 
diff --git a/tests/nb-single-one-line.output b/tests/nb-single-one-line.output
--- a/tests/nb-single-one-line.output
+++ b/tests/nb-single-one-line.output
@@ -1,6 +1,12 @@
-? s
+# B: 0, C: 0, L: 1, c: 0
+- s
+# B: 2, C: 2, L: 1, c: 2
 E
+# B: 2, C: 2, L: 1, c: 2
 I'
+# B: 3, C: 3, L: 1, c: 3
 t'
+# B: 4, C: 4, L: 1, c: 4
 e
-?q 
+# B: 4, C: 4, L: 1, c: 4
+-q 
diff --git a/tests/nb-single-text.n=4.c=flow-key.output b/tests/nb-single-text.n=4.c=flow-key.output
--- a/tests/nb-single-text.n=4.c=flow-key.output
+++ b/tests/nb-single-text.n=4.c=flow-key.output
@@ -1,1 +1,2 @@
-? a\x09
+# B: 0, C: 0, L: 1, c: 0
+- a\x09
diff --git a/tests/nb-single-text.n=4.c=flow-out.invalid.output b/tests/nb-single-text.n=4.c=flow-out.invalid.output
--- a/tests/nb-single-text.n=4.c=flow-out.invalid.output
+++ b/tests/nb-single-text.n=4.c=flow-out.invalid.output
@@ -1,2 +1,4 @@
-?a
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+-a
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '\x0a'
diff --git a/tests/nb-single-text.n=4.c=flow-out.output b/tests/nb-single-text.n=4.c=flow-out.output
--- a/tests/nb-single-text.n=4.c=flow-out.output
+++ b/tests/nb-single-text.n=4.c=flow-out.output
@@ -1,6 +1,12 @@
-? a
+# B: 0, C: 0, L: 1, c: 0
+- a
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 l\x0a
+# B: 4, C: 4, L: 2, c: 0
 i    
+# B: 8, C: 8, L: 2, c: 4
 w\x09
-?a b\x09c 
+# B: 9, C: 9, L: 2, c: 5
+-a b\x09c 
diff --git a/tests/ns-anchor-char.invalid.output b/tests/ns-anchor-char.invalid.output
--- a/tests/ns-anchor-char.invalid.output
+++ b/tests/ns-anchor-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ','
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ','
diff --git a/tests/ns-anchor-char.output b/tests/ns-anchor-char.output
--- a/tests/ns-anchor-char.output
+++ b/tests/ns-anchor-char.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-anchor-name.invalid.output b/tests/ns-anchor-name.invalid.output
--- a/tests/ns-anchor-name.invalid.output
+++ b/tests/ns-anchor-name.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ','
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ','
diff --git a/tests/ns-anchor-name.output b/tests/ns-anchor-name.output
--- a/tests/ns-anchor-name.output
+++ b/tests/ns-anchor-name.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t!*&name
diff --git a/tests/ns-ascii-letter.Z.output b/tests/ns-ascii-letter.Z.output
--- a/tests/ns-ascii-letter.Z.output
+++ b/tests/ns-ascii-letter.Z.output
@@ -1,1 +1,2 @@
-?Z
+# B: 0, C: 0, L: 1, c: 0
+-Z
diff --git a/tests/ns-ascii-letter.a.output b/tests/ns-ascii-letter.a.output
--- a/tests/ns-ascii-letter.a.output
+++ b/tests/ns-ascii-letter.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-ascii-letter.invalid.output b/tests/ns-ascii-letter.invalid.output
--- a/tests/ns-ascii-letter.invalid.output
+++ b/tests/ns-ascii-letter.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '_'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '_'
diff --git a/tests/ns-char.invalid.output b/tests/ns-char.invalid.output
--- a/tests/ns-char.invalid.output
+++ b/tests/ns-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-char.output b/tests/ns-char.output
--- a/tests/ns-char.output
+++ b/tests/ns-char.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-dec-digit.0.output b/tests/ns-dec-digit.0.output
--- a/tests/ns-dec-digit.0.output
+++ b/tests/ns-dec-digit.0.output
@@ -1,1 +1,2 @@
-?0
+# B: 0, C: 0, L: 1, c: 0
+-0
diff --git a/tests/ns-dec-digit.1.output b/tests/ns-dec-digit.1.output
--- a/tests/ns-dec-digit.1.output
+++ b/tests/ns-dec-digit.1.output
@@ -1,1 +1,2 @@
-?1
+# B: 0, C: 0, L: 1, c: 0
+-1
diff --git a/tests/ns-dec-digit.2.output b/tests/ns-dec-digit.2.output
--- a/tests/ns-dec-digit.2.output
+++ b/tests/ns-dec-digit.2.output
@@ -1,1 +1,2 @@
-?2
+# B: 0, C: 0, L: 1, c: 0
+-2
diff --git a/tests/ns-dec-digit.3.output b/tests/ns-dec-digit.3.output
--- a/tests/ns-dec-digit.3.output
+++ b/tests/ns-dec-digit.3.output
@@ -1,1 +1,2 @@
-?3
+# B: 0, C: 0, L: 1, c: 0
+-3
diff --git a/tests/ns-dec-digit.4.output b/tests/ns-dec-digit.4.output
--- a/tests/ns-dec-digit.4.output
+++ b/tests/ns-dec-digit.4.output
@@ -1,1 +1,2 @@
-?4
+# B: 0, C: 0, L: 1, c: 0
+-4
diff --git a/tests/ns-dec-digit.5.output b/tests/ns-dec-digit.5.output
--- a/tests/ns-dec-digit.5.output
+++ b/tests/ns-dec-digit.5.output
@@ -1,1 +1,2 @@
-?5
+# B: 0, C: 0, L: 1, c: 0
+-5
diff --git a/tests/ns-dec-digit.6.output b/tests/ns-dec-digit.6.output
--- a/tests/ns-dec-digit.6.output
+++ b/tests/ns-dec-digit.6.output
@@ -1,1 +1,2 @@
-?6
+# B: 0, C: 0, L: 1, c: 0
+-6
diff --git a/tests/ns-dec-digit.7.output b/tests/ns-dec-digit.7.output
--- a/tests/ns-dec-digit.7.output
+++ b/tests/ns-dec-digit.7.output
@@ -1,1 +1,2 @@
-?7
+# B: 0, C: 0, L: 1, c: 0
+-7
diff --git a/tests/ns-dec-digit.8.output b/tests/ns-dec-digit.8.output
--- a/tests/ns-dec-digit.8.output
+++ b/tests/ns-dec-digit.8.output
@@ -1,1 +1,2 @@
-?8
+# B: 0, C: 0, L: 1, c: 0
+-8
diff --git a/tests/ns-dec-digit.9.output b/tests/ns-dec-digit.9.output
--- a/tests/ns-dec-digit.9.output
+++ b/tests/ns-dec-digit.9.output
@@ -1,1 +1,2 @@
-?9
+# B: 0, C: 0, L: 1, c: 0
+-9
diff --git a/tests/ns-dec-digit.invalid.output b/tests/ns-dec-digit.invalid.output
--- a/tests/ns-dec-digit.invalid.output
+++ b/tests/ns-dec-digit.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/ns-directive-name.invalid.output b/tests/ns-directive-name.invalid.output
--- a/tests/ns-directive-name.invalid.output
+++ b/tests/ns-directive-name.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-directive-name.output b/tests/ns-directive-name.output
--- a/tests/ns-directive-name.output
+++ b/tests/ns-directive-name.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tname
diff --git a/tests/ns-directive-parameter.invalid.output b/tests/ns-directive-parameter.invalid.output
--- a/tests/ns-directive-parameter.invalid.output
+++ b/tests/ns-directive-parameter.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-directive-parameter.output b/tests/ns-directive-parameter.output
--- a/tests/ns-directive-parameter.output
+++ b/tests/ns-directive-parameter.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tvalue
diff --git a/tests/ns-double-char.invalid.output b/tests/ns-double-char.invalid.output
--- a/tests/ns-double-char.invalid.output
+++ b/tests/ns-double-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-double-char.output b/tests/ns-double-char.output
--- a/tests/ns-double-char.output
+++ b/tests/ns-double-char.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-esc-16-bit.output b/tests/ns-esc-16-bit.output
--- a/tests/ns-esc-16-bit.output
+++ b/tests/ns-esc-16-bit.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 Iu
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escaped' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tFEDC
diff --git a/tests/ns-esc-32-bit.output b/tests/ns-esc-32-bit.output
--- a/tests/ns-esc-32-bit.output
+++ b/tests/ns-esc-32-bit.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 IU
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escaped' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 t0010FEDC
diff --git a/tests/ns-esc-8-bit.output b/tests/ns-esc-8-bit.output
--- a/tests/ns-esc-8-bit.output
+++ b/tests/ns-esc-8-bit.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 Ix
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'escaped' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 tFF
diff --git a/tests/ns-esc-backslash.output b/tests/ns-esc-backslash.output
--- a/tests/ns-esc-backslash.output
+++ b/tests/ns-esc-backslash.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t\x5c
diff --git a/tests/ns-esc-backspace.output b/tests/ns-esc-backspace.output
--- a/tests/ns-esc-backspace.output
+++ b/tests/ns-esc-backspace.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tb
diff --git a/tests/ns-esc-bell.output b/tests/ns-esc-bell.output
--- a/tests/ns-esc-bell.output
+++ b/tests/ns-esc-bell.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 ta
diff --git a/tests/ns-esc-carriage-return.output b/tests/ns-esc-carriage-return.output
--- a/tests/ns-esc-carriage-return.output
+++ b/tests/ns-esc-carriage-return.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tr
diff --git a/tests/ns-esc-double-quote.output b/tests/ns-esc-double-quote.output
--- a/tests/ns-esc-double-quote.output
+++ b/tests/ns-esc-double-quote.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t"
diff --git a/tests/ns-esc-escape.output b/tests/ns-esc-escape.output
--- a/tests/ns-esc-escape.output
+++ b/tests/ns-esc-escape.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 te
diff --git a/tests/ns-esc-form-feed.output b/tests/ns-esc-form-feed.output
--- a/tests/ns-esc-form-feed.output
+++ b/tests/ns-esc-form-feed.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tf
diff --git a/tests/ns-esc-horizontal-tab.t.output b/tests/ns-esc-horizontal-tab.t.output
--- a/tests/ns-esc-horizontal-tab.t.output
+++ b/tests/ns-esc-horizontal-tab.t.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tt
diff --git a/tests/ns-esc-horizontal-tab.tab.output b/tests/ns-esc-horizontal-tab.tab.output
--- a/tests/ns-esc-horizontal-tab.tab.output
+++ b/tests/ns-esc-horizontal-tab.tab.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t\x09
diff --git a/tests/ns-esc-line-feed.output b/tests/ns-esc-line-feed.output
--- a/tests/ns-esc-line-feed.output
+++ b/tests/ns-esc-line-feed.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tn
diff --git a/tests/ns-esc-line-separator.output b/tests/ns-esc-line-separator.output
--- a/tests/ns-esc-line-separator.output
+++ b/tests/ns-esc-line-separator.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tL
diff --git a/tests/ns-esc-next-line.output b/tests/ns-esc-next-line.output
--- a/tests/ns-esc-next-line.output
+++ b/tests/ns-esc-next-line.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tN
diff --git a/tests/ns-esc-non-breaking-space.output b/tests/ns-esc-non-breaking-space.output
--- a/tests/ns-esc-non-breaking-space.output
+++ b/tests/ns-esc-non-breaking-space.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t_
diff --git a/tests/ns-esc-null.output b/tests/ns-esc-null.output
--- a/tests/ns-esc-null.output
+++ b/tests/ns-esc-null.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t0
diff --git a/tests/ns-esc-paragraph-separator.output b/tests/ns-esc-paragraph-separator.output
--- a/tests/ns-esc-paragraph-separator.output
+++ b/tests/ns-esc-paragraph-separator.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tP
diff --git a/tests/ns-esc-slash.output b/tests/ns-esc-slash.output
--- a/tests/ns-esc-slash.output
+++ b/tests/ns-esc-slash.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t/
diff --git a/tests/ns-esc-space.output b/tests/ns-esc-space.output
--- a/tests/ns-esc-space.output
+++ b/tests/ns-esc-space.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t 
diff --git a/tests/ns-esc-vertical-tab.output b/tests/ns-esc-vertical-tab.output
--- a/tests/ns-esc-vertical-tab.output
+++ b/tests/ns-esc-vertical-tab.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tv
diff --git a/tests/ns-flow-content.n=4.c=flow-in.invalid.output b/tests/ns-flow-content.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-content.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-content.n=4.c=flow-in.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '|'
diff --git a/tests/ns-flow-content.n=4.c=flow-in.json.output b/tests/ns-flow-content.n=4.c=flow-in.json.output
--- a/tests/ns-flow-content.n=4.c=flow-in.json.output
+++ b/tests/ns-flow-content.n=4.c=flow-in.json.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
diff --git a/tests/ns-flow-content.n=4.c=flow-in.yaml.output b/tests/ns-flow-content.n=4.c=flow-in.yaml.output
--- a/tests/ns-flow-content.n=4.c=flow-in.yaml.output
+++ b/tests/ns-flow-content.n=4.c=flow-in.yaml.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
diff --git a/tests/ns-flow-map-entry.n=4.c=flow-in.explicit.output b/tests/ns-flow-map-entry.n=4.c=flow-in.explicit.output
--- a/tests/ns-flow-map-entry.n=4.c=flow-in.explicit.output
+++ b/tests/ns-flow-map-entry.n=4.c=flow-in.explicit.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 I?
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 N
+# B: 5, C: 5, L: 1, c: 5
 S
+# B: 6, C: 6, L: 1, c: 6
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 Tb
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
+# B: 6, C: 6, L: 1, c: 6
 x
diff --git a/tests/ns-flow-map-entry.n=4.c=flow-in.implicit.output b/tests/ns-flow-map-entry.n=4.c=flow-in.implicit.output
--- a/tests/ns-flow-map-entry.n=4.c=flow-in.implicit.output
+++ b/tests/ns-flow-map-entry.n=4.c=flow-in.implicit.output
@@ -1,11 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 x
diff --git a/tests/ns-flow-map-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-map-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-map-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-map-entry.n=4.c=flow-in.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected end of input
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+x
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected end of input
diff --git a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.empty.output b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.empty.output
--- a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.empty.output
+++ b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.empty.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
diff --git a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.json.output b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.json.output
--- a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.json.output
+++ b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.json.output
@@ -1,14 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
diff --git a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.value.output b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.value.output
--- a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.value.output
+++ b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.value.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.yaml.output b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.yaml.output
--- a/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.yaml.output
+++ b/tests/ns-flow-map-explicit-entry.n=4.c=flow-in.yaml.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
diff --git a/tests/ns-flow-map-implicit-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-map-implicit-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-map-implicit-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-map-implicit-entry.n=4.c=flow-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '?'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '?'
diff --git a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.compact.output b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.compact.output
--- a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.compact.output
+++ b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.compact.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'pair' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
diff --git a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.empty.output b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.empty.output
--- a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.empty.output
+++ b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.empty.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.invalid.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta:b
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'pair' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.spaced.output b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.spaced.output
--- a/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.spaced.output
+++ b/tests/ns-flow-map-yaml-key-entry.n=4.c=flow-in.spaced.output
@@ -1,16 +1,32 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 I:
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'pair' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
diff --git a/tests/ns-flow-node.n=4.c=flow-in.alias.output b/tests/ns-flow-node.n=4.c=flow-in.alias.output
--- a/tests/ns-flow-node.n=4.c=flow-in.alias.output
+++ b/tests/ns-flow-node.n=4.c=flow-in.alias.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 R
+# B: 0, C: 0, L: 1, c: 0
 I*
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 r
+# B: 2, C: 2, L: 1, c: 2
 n
diff --git a/tests/ns-flow-node.n=4.c=flow-in.invalid.output b/tests/ns-flow-node.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-node.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-node.n=4.c=flow-in.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '|'
diff --git a/tests/ns-flow-node.n=4.c=flow-in.tag.output b/tests/ns-flow-node.n=4.c=flow-in.tag.output
--- a/tests/ns-flow-node.n=4.c=flow-in.tag.output
+++ b/tests/ns-flow-node.n=4.c=flow-in.tag.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
diff --git a/tests/ns-flow-node.n=4.c=flow-in.tagged.output b/tests/ns-flow-node.n=4.c=flow-in.tagged.output
--- a/tests/ns-flow-node.n=4.c=flow-in.tagged.output
+++ b/tests/ns-flow-node.n=4.c=flow-in.tagged.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 I"
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Ta
+# B: 5, C: 5, L: 1, c: 5
 I"
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
diff --git a/tests/ns-flow-node.n=4.c=flow-in.untagged.output b/tests/ns-flow-node.n=4.c=flow-in.untagged.output
--- a/tests/ns-flow-node.n=4.c=flow-in.untagged.output
+++ b/tests/ns-flow-node.n=4.c=flow-in.untagged.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/ns-flow-pair-entry.n=4.c=flow-in.empty.output b/tests/ns-flow-pair-entry.n=4.c=flow-in.empty.output
--- a/tests/ns-flow-pair-entry.n=4.c=flow-in.empty.output
+++ b/tests/ns-flow-pair-entry.n=4.c=flow-in.empty.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Tb
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
diff --git a/tests/ns-flow-pair-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-pair-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-pair-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-pair-entry.n=4.c=flow-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/ns-flow-pair-entry.n=4.c=flow-in.json.output b/tests/ns-flow-pair-entry.n=4.c=flow-in.json.output
--- a/tests/ns-flow-pair-entry.n=4.c=flow-in.json.output
+++ b/tests/ns-flow-pair-entry.n=4.c=flow-in.json.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'pair' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
diff --git a/tests/ns-flow-pair-entry.n=4.c=flow-in.yaml.output b/tests/ns-flow-pair-entry.n=4.c=flow-in.yaml.output
--- a/tests/ns-flow-pair-entry.n=4.c=flow-in.yaml.output
+++ b/tests/ns-flow-pair-entry.n=4.c=flow-in.yaml.output
@@ -1,14 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'pair' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
diff --git a/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.invalid.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta:b
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.output b/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.output
--- a/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.output
+++ b/tests/ns-flow-pair-yaml-key-entry.n=4.c=flow-in.output
@@ -1,14 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'pair' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
diff --git a/tests/ns-flow-pair.n=4.c=flow-in.explicit.output b/tests/ns-flow-pair.n=4.c=flow-in.explicit.output
--- a/tests/ns-flow-pair.n=4.c=flow-in.explicit.output
+++ b/tests/ns-flow-pair.n=4.c=flow-in.explicit.output
@@ -1,20 +1,40 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 I?
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'pair' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 I:
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 N
+# B: 5, C: 5, L: 1, c: 5
 S
+# B: 6, C: 6, L: 1, c: 6
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 Tb
+# B: 6, C: 6, L: 1, c: 6
 s
+# B: 6, C: 6, L: 1, c: 6
 n
+# B: 6, C: 6, L: 1, c: 6
 x
+# B: 6, C: 6, L: 1, c: 6
 m
diff --git a/tests/ns-flow-pair.n=4.c=flow-in.implicit.output b/tests/ns-flow-pair.n=4.c=flow-in.implicit.output
--- a/tests/ns-flow-pair.n=4.c=flow-in.implicit.output
+++ b/tests/ns-flow-pair.n=4.c=flow-in.implicit.output
@@ -1,18 +1,36 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'pair' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 x
+# B: 4, C: 4, L: 1, c: 4
 m
diff --git a/tests/ns-flow-pair.n=4.c=flow-in.invalid.output b/tests/ns-flow-pair.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-pair.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-pair.n=4.c=flow-in.invalid.output
@@ -1,5 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+x
+# B: 0, C: 0, L: 1, c: 0
+m
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/ns-flow-seq-entry.n=4.c=flow-in.invalid.output b/tests/ns-flow-seq-entry.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-seq-entry.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-seq-entry.n=4.c=flow-in.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/ns-flow-seq-entry.n=4.c=flow-in.node.output b/tests/ns-flow-seq-entry.n=4.c=flow-in.node.output
--- a/tests/ns-flow-seq-entry.n=4.c=flow-in.node.output
+++ b/tests/ns-flow-seq-entry.n=4.c=flow-in.node.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/ns-flow-seq-entry.n=4.c=flow-in.pair.output b/tests/ns-flow-seq-entry.n=4.c=flow-in.pair.output
--- a/tests/ns-flow-seq-entry.n=4.c=flow-in.pair.output
+++ b/tests/ns-flow-seq-entry.n=4.c=flow-in.pair.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 x
+# B: 4, C: 4, L: 1, c: 4
 m
diff --git a/tests/ns-flow-yaml-content.n=4.c=flow-in.invalid.output b/tests/ns-flow-yaml-content.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-yaml-content.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-yaml-content.n=4.c=flow-in.invalid.output
@@ -1,2 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+s
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '|'
diff --git a/tests/ns-flow-yaml-content.n=4.c=flow-in.output b/tests/ns-flow-yaml-content.n=4.c=flow-in.output
--- a/tests/ns-flow-yaml-content.n=4.c=flow-in.output
+++ b/tests/ns-flow-yaml-content.n=4.c=flow-in.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
diff --git a/tests/ns-flow-yaml-node.n=4.c=flow-in.alias.output b/tests/ns-flow-yaml-node.n=4.c=flow-in.alias.output
--- a/tests/ns-flow-yaml-node.n=4.c=flow-in.alias.output
+++ b/tests/ns-flow-yaml-node.n=4.c=flow-in.alias.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 R
+# B: 0, C: 0, L: 1, c: 0
 I*
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 r
+# B: 2, C: 2, L: 1, c: 2
 n
diff --git a/tests/ns-flow-yaml-node.n=4.c=flow-in.invalid.output b/tests/ns-flow-yaml-node.n=4.c=flow-in.invalid.output
--- a/tests/ns-flow-yaml-node.n=4.c=flow-in.invalid.output
+++ b/tests/ns-flow-yaml-node.n=4.c=flow-in.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '''
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '''
diff --git a/tests/ns-flow-yaml-node.n=4.c=flow-in.tag.output b/tests/ns-flow-yaml-node.n=4.c=flow-in.tag.output
--- a/tests/ns-flow-yaml-node.n=4.c=flow-in.tag.output
+++ b/tests/ns-flow-yaml-node.n=4.c=flow-in.tag.output
@@ -1,12 +1,24 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 S
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
diff --git a/tests/ns-flow-yaml-node.n=4.c=flow-in.tagged.output b/tests/ns-flow-yaml-node.n=4.c=flow-in.tagged.output
--- a/tests/ns-flow-yaml-node.n=4.c=flow-in.tagged.output
+++ b/tests/ns-flow-yaml-node.n=4.c=flow-in.tagged.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tt
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Ta
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
diff --git a/tests/ns-flow-yaml-node.n=4.c=flow-in.untagged.output b/tests/ns-flow-yaml-node.n=4.c=flow-in.untagged.output
--- a/tests/ns-flow-yaml-node.n=4.c=flow-in.untagged.output
+++ b/tests/ns-flow-yaml-node.n=4.c=flow-in.untagged.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/ns-global-tag-prefix.invalid.output b/tests/ns-global-tag-prefix.invalid.output
--- a/tests/ns-global-tag-prefix.invalid.output
+++ b/tests/ns-global-tag-prefix.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 ta
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '^'
diff --git a/tests/ns-global-tag-prefix.output b/tests/ns-global-tag-prefix.output
--- a/tests/ns-global-tag-prefix.output
+++ b/tests/ns-global-tag-prefix.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 tprefix
diff --git a/tests/ns-hex-digit.6.output b/tests/ns-hex-digit.6.output
--- a/tests/ns-hex-digit.6.output
+++ b/tests/ns-hex-digit.6.output
@@ -1,1 +1,2 @@
-?6
+# B: 0, C: 0, L: 1, c: 0
+-6
diff --git a/tests/ns-hex-digit.B.output b/tests/ns-hex-digit.B.output
--- a/tests/ns-hex-digit.B.output
+++ b/tests/ns-hex-digit.B.output
@@ -1,1 +1,2 @@
-?B
+# B: 0, C: 0, L: 1, c: 0
+-B
diff --git a/tests/ns-hex-digit.D.output b/tests/ns-hex-digit.D.output
--- a/tests/ns-hex-digit.D.output
+++ b/tests/ns-hex-digit.D.output
@@ -1,1 +1,2 @@
-?D
+# B: 0, C: 0, L: 1, c: 0
+-D
diff --git a/tests/ns-hex-digit.F.output b/tests/ns-hex-digit.F.output
--- a/tests/ns-hex-digit.F.output
+++ b/tests/ns-hex-digit.F.output
@@ -1,1 +1,2 @@
-?F
+# B: 0, C: 0, L: 1, c: 0
+-F
diff --git a/tests/ns-hex-digit.a.output b/tests/ns-hex-digit.a.output
--- a/tests/ns-hex-digit.a.output
+++ b/tests/ns-hex-digit.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-hex-digit.c.output b/tests/ns-hex-digit.c.output
--- a/tests/ns-hex-digit.c.output
+++ b/tests/ns-hex-digit.c.output
@@ -1,1 +1,2 @@
-?c
+# B: 0, C: 0, L: 1, c: 0
+-c
diff --git a/tests/ns-hex-digit.e.output b/tests/ns-hex-digit.e.output
--- a/tests/ns-hex-digit.e.output
+++ b/tests/ns-hex-digit.e.output
@@ -1,1 +1,2 @@
-?e
+# B: 0, C: 0, L: 1, c: 0
+-e
diff --git a/tests/ns-hex-digit.invalid.output b/tests/ns-hex-digit.invalid.output
--- a/tests/ns-hex-digit.invalid.output
+++ b/tests/ns-hex-digit.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'g'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'g'
diff --git a/tests/ns-l-block-map-entry.n=2.explicit.output b/tests/ns-l-block-map-entry.n=2.explicit.output
--- a/tests/ns-l-block-map-entry.n=2.explicit.output
+++ b/tests/ns-l-block-map-entry.n=2.explicit.output
@@ -1,23 +1,42 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 I?
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 i  
+# B: 6, C: 6, L: 2, c: 2
 I:
+# B: 7, C: 7, L: 2, c: 3
 w 
+# B: 8, C: 8, L: 2, c: 4
 N
+# B: 8, C: 8, L: 2, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 8, C: 8, L: 2, c: 4
 Tb
+# B: 9, C: 9, L: 2, c: 5
 s
+# B: 9, C: 9, L: 2, c: 5
 n
+# B: 9, C: 9, L: 2, c: 5
 b\x0a
+# B: 10, C: 10, L: 3, c: 0
 b\x0a
+# B: 11, C: 11, L: 4, c: 0
 x
diff --git a/tests/ns-l-block-map-entry.n=2.implicit.output b/tests/ns-l-block-map-entry.n=2.implicit.output
--- a/tests/ns-l-block-map-entry.n=2.implicit.output
+++ b/tests/ns-l-block-map-entry.n=2.implicit.output
@@ -1,17 +1,34 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 x
diff --git a/tests/ns-l-block-map-entry.n=2.invalid.output b/tests/ns-l-block-map-entry.n=2.invalid.output
--- a/tests/ns-l-block-map-entry.n=2.invalid.output
+++ b/tests/ns-l-block-map-entry.n=2.invalid.output
@@ -1,7 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
-!$InputFile$: line 1: column 1: Unexpected '\x0a'
+# B: 1, C: 1, L: 1, c: 1
+x
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '\x0a'
diff --git a/tests/ns-l-block-map-implicit-entry.n=2.empty.output b/tests/ns-l-block-map-implicit-entry.n=2.empty.output
--- a/tests/ns-l-block-map-implicit-entry.n=2.empty.output
+++ b/tests/ns-l-block-map-implicit-entry.n=2.empty.output
@@ -1,11 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
+# B: 0, C: 0, L: 1, c: 0
 I:
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/ns-l-block-map-implicit-entry.n=2.invalid.output b/tests/ns-l-block-map-implicit-entry.n=2.invalid.output
--- a/tests/ns-l-block-map-implicit-entry.n=2.invalid.output
+++ b/tests/ns-l-block-map-implicit-entry.n=2.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
-!$InputFile$: line 1: column 0: Unexpected '?'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '?'
diff --git a/tests/ns-l-block-map-implicit-entry.n=2.non-empty.output b/tests/ns-l-block-map-implicit-entry.n=2.non-empty.output
--- a/tests/ns-l-block-map-implicit-entry.n=2.non-empty.output
+++ b/tests/ns-l-block-map-implicit-entry.n=2.non-empty.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
diff --git a/tests/ns-l-in-line-mapping.n=2.invalid.output b/tests/ns-l-in-line-mapping.n=2.invalid.output
--- a/tests/ns-l-in-line-mapping.n=2.invalid.output
+++ b/tests/ns-l-in-line-mapping.n=2.invalid.output
@@ -1,8 +1,22 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+x
+# B: 0, C: 0, L: 1, c: 0
+m
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-l-in-line-mapping.n=2.output b/tests/ns-l-in-line-mapping.n=2.output
--- a/tests/ns-l-in-line-mapping.n=2.output
+++ b/tests/ns-l-in-line-mapping.n=2.output
@@ -1,39 +1,78 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 x
+# B: 5, C: 5, L: 2, c: 0
 i  
+# B: 7, C: 7, L: 2, c: 2
 X
+# B: 7, C: 7, L: 2, c: 2
 N
+# B: 7, C: 7, L: 2, c: 2
 S
+# B: 7, C: 7, L: 2, c: 2
 Tc
+# B: 8, C: 8, L: 2, c: 3
 s
+# B: 8, C: 8, L: 2, c: 3
 n
+# B: 8, C: 8, L: 2, c: 3
 I:
+# B: 9, C: 9, L: 2, c: 4
 !Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 4
 w 
+# B: 10, C: 10, L: 2, c: 5
 N
+# B: 10, C: 10, L: 2, c: 5
 S
+# B: 11, C: 11, L: 2, c: 6
 !Commit to 'node' was made outside it
+# B: 10, C: 10, L: 2, c: 5
 Td
+# B: 11, C: 11, L: 2, c: 6
 s
+# B: 11, C: 11, L: 2, c: 6
 n
+# B: 11, C: 11, L: 2, c: 6
 b\x0a
+# B: 12, C: 12, L: 3, c: 0
 x
+# B: 12, C: 12, L: 3, c: 0
 m
+# B: 12, C: 12, L: 3, c: 0
 n
diff --git a/tests/ns-l-in-line-sequence.n=3.invalid.output b/tests/ns-l-in-line-sequence.n=3.invalid.output
--- a/tests/ns-l-in-line-sequence.n=3.invalid.output
+++ b/tests/ns-l-in-line-sequence.n=3.invalid.output
@@ -1,15 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 q
+# B: 4, C: 4, L: 2, c: 0
 n
-!$InputFile$: line 2: column 0: Expected end of input
+# B: 4, C: 4, L: 2, c: 0
+!Unexpected ' '
diff --git a/tests/ns-l-in-line-sequence.n=3.output b/tests/ns-l-in-line-sequence.n=3.output
--- a/tests/ns-l-in-line-sequence.n=3.output
+++ b/tests/ns-l-in-line-sequence.n=3.output
@@ -1,25 +1,46 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 Q
+# B: 0, C: 0, L: 1, c: 0
 I-
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 N
+# B: 2, C: 2, L: 1, c: 2
 S
-!Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 Ta
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 b\x0a
+# B: 4, C: 4, L: 2, c: 0
 i   
+# B: 7, C: 7, L: 2, c: 3
 I-
+# B: 8, C: 8, L: 2, c: 4
 !Commit to 'node' was made outside it
+# B: 8, C: 8, L: 2, c: 4
 w 
+# B: 9, C: 9, L: 2, c: 5
 N
+# B: 9, C: 9, L: 2, c: 5
 S
-!Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 5
 Tb
+# B: 10, C: 10, L: 2, c: 6
 s
+# B: 10, C: 10, L: 2, c: 6
 n
+# B: 10, C: 10, L: 2, c: 6
 b\x0a
+# B: 11, C: 11, L: 3, c: 0
 q
+# B: 11, C: 11, L: 3, c: 0
 n
diff --git a/tests/ns-plain-char.c=flow-in.a.output b/tests/ns-plain-char.c=flow-in.a.output
--- a/tests/ns-plain-char.c=flow-in.a.output
+++ b/tests/ns-plain-char.c=flow-in.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-plain-char.c=flow-in.s.output b/tests/ns-plain-char.c=flow-in.s.output
--- a/tests/ns-plain-char.c=flow-in.s.output
+++ b/tests/ns-plain-char.c=flow-in.s.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-plain-first.c=flow-in.a.output b/tests/ns-plain-first.c=flow-in.a.output
--- a/tests/ns-plain-first.c=flow-in.a.output
+++ b/tests/ns-plain-first.c=flow-in.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-plain-first.c=flow-in.c.output b/tests/ns-plain-first.c=flow-in.c.output
--- a/tests/ns-plain-first.c=flow-in.c.output
+++ b/tests/ns-plain-first.c=flow-in.c.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/ns-plain-first.c=flow-in.d.output b/tests/ns-plain-first.c=flow-in.d.output
--- a/tests/ns-plain-first.c=flow-in.d.output
+++ b/tests/ns-plain-first.c=flow-in.d.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 1: Unexpected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected end of input
diff --git a/tests/ns-plain-first.c=flow-in.i.output b/tests/ns-plain-first.c=flow-in.i.output
--- a/tests/ns-plain-first.c=flow-in.i.output
+++ b/tests/ns-plain-first.c=flow-in.i.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '%'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '%'
diff --git a/tests/ns-plain-first.c=flow-in.ia.output b/tests/ns-plain-first.c=flow-in.ia.output
--- a/tests/ns-plain-first.c=flow-in.ia.output
+++ b/tests/ns-plain-first.c=flow-in.ia.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '%'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '%'
diff --git a/tests/ns-plain-first.c=flow-in.k.output b/tests/ns-plain-first.c=flow-in.k.output
--- a/tests/ns-plain-first.c=flow-in.k.output
+++ b/tests/ns-plain-first.c=flow-in.k.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 1: Unexpected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected end of input
diff --git a/tests/ns-plain-first.c=flow-in.m.output b/tests/ns-plain-first.c=flow-in.m.output
--- a/tests/ns-plain-first.c=flow-in.m.output
+++ b/tests/ns-plain-first.c=flow-in.m.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '{'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '{'
diff --git a/tests/ns-plain-first.c=flow-in.s.output b/tests/ns-plain-first.c=flow-in.s.output
--- a/tests/ns-plain-first.c=flow-in.s.output
+++ b/tests/ns-plain-first.c=flow-in.s.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-plain-first.c=flow-in.v.output b/tests/ns-plain-first.c=flow-in.v.output
--- a/tests/ns-plain-first.c=flow-in.v.output
+++ b/tests/ns-plain-first.c=flow-in.v.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 1: Unexpected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected end of input
diff --git a/tests/ns-plain-first.c=flow-out.m.output b/tests/ns-plain-first.c=flow-out.m.output
--- a/tests/ns-plain-first.c=flow-out.m.output
+++ b/tests/ns-plain-first.c=flow-out.m.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '{'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '{'
diff --git a/tests/ns-plain-multi-line.n=4.c=flow-in.invalid.output b/tests/ns-plain-multi-line.n=4.c=flow-in.invalid.output
--- a/tests/ns-plain-multi-line.n=4.c=flow-in.invalid.output
+++ b/tests/ns-plain-multi-line.n=4.c=flow-in.invalid.output
@@ -1,6 +1,12 @@
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
+# B: 1, C: 1, L: 1, c: 1
 l\x0a
+# B: 2, C: 2, L: 2, c: 0
 i    
-?12
-!$InputFile$: line 2: column 6: Expected end of input
+# B: 6, C: 6, L: 2, c: 4
+-12
+# B: 8, C: 8, L: 2, c: 6
+!Unexpected ','
diff --git a/tests/ns-plain-multi-line.n=4.c=flow-in.output b/tests/ns-plain-multi-line.n=4.c=flow-in.output
--- a/tests/ns-plain-multi-line.n=4.c=flow-in.output
+++ b/tests/ns-plain-multi-line.n=4.c=flow-in.output
@@ -1,13 +1,26 @@
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
+# B: 1, C: 1, L: 1, c: 1
 w\x09
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 i    
+# B: 8, C: 8, L: 3, c: 4
 w      
-?b
+# B: 14, C: 14, L: 3, c: 10
+-b
+# B: 15, C: 15, L: 3, c: 11
 w  
+# B: 17, C: 17, L: 3, c: 13
 l\x0a
+# B: 18, C: 18, L: 4, c: 0
 i    
+# B: 22, C: 22, L: 4, c: 4
 w  
-?c
+# B: 24, C: 24, L: 4, c: 6
+-c
diff --git a/tests/ns-plain-one-line.c=flow-key.invalid.output b/tests/ns-plain-one-line.c=flow-key.invalid.output
--- a/tests/ns-plain-one-line.c=flow-key.invalid.output
+++ b/tests/ns-plain-one-line.c=flow-key.invalid.output
@@ -1,3 +1,6 @@
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
-?12
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+-12
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected ','
diff --git a/tests/ns-plain-one-line.c=flow-out.output b/tests/ns-plain-one-line.c=flow-out.output
--- a/tests/ns-plain-one-line.c=flow-out.output
+++ b/tests/ns-plain-one-line.c=flow-out.output
@@ -1,2 +1,4 @@
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
-?a \x09" :# {} b
+# B: 0, C: 0, L: 1, c: 0
+-a \x09" :# {} b
diff --git a/tests/ns-plain-safe-in.a.output b/tests/ns-plain-safe-in.a.output
--- a/tests/ns-plain-safe-in.a.output
+++ b/tests/ns-plain-safe-in.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-plain-safe-in.c.output b/tests/ns-plain-safe-in.c.output
--- a/tests/ns-plain-safe-in.c.output
+++ b/tests/ns-plain-safe-in.c.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/ns-plain-safe-in.mapping-start.output b/tests/ns-plain-safe-in.mapping-start.output
--- a/tests/ns-plain-safe-in.mapping-start.output
+++ b/tests/ns-plain-safe-in.mapping-start.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '{'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '{'
diff --git a/tests/ns-plain-safe-in.v.output b/tests/ns-plain-safe-in.v.output
--- a/tests/ns-plain-safe-in.v.output
+++ b/tests/ns-plain-safe-in.v.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ':'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ':'
diff --git a/tests/ns-plain-safe-out.a.output b/tests/ns-plain-safe-out.a.output
--- a/tests/ns-plain-safe-out.a.output
+++ b/tests/ns-plain-safe-out.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-plain-safe-out.c.output b/tests/ns-plain-safe-out.c.output
--- a/tests/ns-plain-safe-out.c.output
+++ b/tests/ns-plain-safe-out.c.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/ns-plain-safe-out.mapping-start.output b/tests/ns-plain-safe-out.mapping-start.output
--- a/tests/ns-plain-safe-out.mapping-start.output
+++ b/tests/ns-plain-safe-out.mapping-start.output
@@ -1,1 +1,2 @@
-?{
+# B: 0, C: 0, L: 1, c: 0
+-{
diff --git a/tests/ns-plain-safe-out.v.output b/tests/ns-plain-safe-out.v.output
--- a/tests/ns-plain-safe-out.v.output
+++ b/tests/ns-plain-safe-out.v.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ':'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ':'
diff --git a/tests/ns-plain-safe.c=flow-in.mapping-start.output b/tests/ns-plain-safe.c=flow-in.mapping-start.output
--- a/tests/ns-plain-safe.c=flow-in.mapping-start.output
+++ b/tests/ns-plain-safe.c=flow-in.mapping-start.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '{'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '{'
diff --git a/tests/ns-plain-safe.c=flow-in.v.output b/tests/ns-plain-safe.c=flow-in.v.output
--- a/tests/ns-plain-safe.c=flow-in.v.output
+++ b/tests/ns-plain-safe.c=flow-in.v.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ':'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ':'
diff --git a/tests/ns-plain-safe.c=flow-out.a.output b/tests/ns-plain-safe.c=flow-out.a.output
--- a/tests/ns-plain-safe.c=flow-out.a.output
+++ b/tests/ns-plain-safe.c=flow-out.a.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-plain-safe.c=flow-out.c.output b/tests/ns-plain-safe.c=flow-out.c.output
--- a/tests/ns-plain-safe.c=flow-out.c.output
+++ b/tests/ns-plain-safe.c=flow-out.c.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '#'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '#'
diff --git a/tests/ns-plain-safe.c=flow-out.mapping-start.output b/tests/ns-plain-safe.c=flow-out.mapping-start.output
--- a/tests/ns-plain-safe.c=flow-out.mapping-start.output
+++ b/tests/ns-plain-safe.c=flow-out.mapping-start.output
@@ -1,1 +1,2 @@
-?{
+# B: 0, C: 0, L: 1, c: 0
+-{
diff --git a/tests/ns-plain.n=1.c=flow-key.::.input b/tests/ns-plain.n=1.c=flow-key.::.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-plain.n=1.c=flow-key.::.input
@@ -0,0 +1,1 @@
+::std::vector
diff --git a/tests/ns-plain.n=1.c=flow-key.::.output b/tests/ns-plain.n=1.c=flow-key.::.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-plain.n=1.c=flow-key.::.output
@@ -0,0 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
+T::std::vector
+# B: 13, C: 13, L: 1, c: 13
+s
diff --git a/tests/ns-plain.n=1.c=flow-key.da.output b/tests/ns-plain.n=1.c=flow-key.da.output
--- a/tests/ns-plain.n=1.c=flow-key.da.output
+++ b/tests/ns-plain.n=1.c=flow-key.da.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T-a
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.dc.output b/tests/ns-plain.n=1.c=flow-key.dc.output
--- a/tests/ns-plain.n=1.c=flow-key.dc.output
+++ b/tests/ns-plain.n=1.c=flow-key.dc.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T-#
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.ds.output b/tests/ns-plain.n=1.c=flow-key.ds.output
--- a/tests/ns-plain.n=1.c=flow-key.ds.output
+++ b/tests/ns-plain.n=1.c=flow-key.ds.output
@@ -1,2 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 1: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+--
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected ' '
diff --git a/tests/ns-plain.n=1.c=flow-key.ka.output b/tests/ns-plain.n=1.c=flow-key.ka.output
--- a/tests/ns-plain.n=1.c=flow-key.ka.output
+++ b/tests/ns-plain.n=1.c=flow-key.ka.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T?a
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.kc.output b/tests/ns-plain.n=1.c=flow-key.kc.output
--- a/tests/ns-plain.n=1.c=flow-key.kc.output
+++ b/tests/ns-plain.n=1.c=flow-key.kc.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T?#
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.ks.output b/tests/ns-plain.n=1.c=flow-key.ks.output
--- a/tests/ns-plain.n=1.c=flow-key.ks.output
+++ b/tests/ns-plain.n=1.c=flow-key.ks.output
@@ -1,2 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 1: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+-?
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected ' '
diff --git a/tests/ns-plain.n=1.c=flow-key.va.output b/tests/ns-plain.n=1.c=flow-key.va.output
--- a/tests/ns-plain.n=1.c=flow-key.va.output
+++ b/tests/ns-plain.n=1.c=flow-key.va.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T:a
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.vc.output b/tests/ns-plain.n=1.c=flow-key.vc.output
--- a/tests/ns-plain.n=1.c=flow-key.vc.output
+++ b/tests/ns-plain.n=1.c=flow-key.vc.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T:#
+# B: 2, C: 2, L: 1, c: 2
 s
diff --git a/tests/ns-plain.n=1.c=flow-key.vs.output b/tests/ns-plain.n=1.c=flow-key.vs.output
--- a/tests/ns-plain.n=1.c=flow-key.vs.output
+++ b/tests/ns-plain.n=1.c=flow-key.vs.output
@@ -1,2 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 1: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+-:
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected ' '
diff --git a/tests/ns-plain.n=4.c=flow-in.output b/tests/ns-plain.n=4.c=flow-in.output
--- a/tests/ns-plain.n=4.c=flow-in.output
+++ b/tests/ns-plain.n=4.c=flow-in.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 w\x09
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 L\x0a
+# B: 4, C: 4, L: 3, c: 0
 i    
+# B: 8, C: 8, L: 3, c: 4
 w      
+# B: 14, C: 14, L: 3, c: 10
 Tb
+# B: 15, C: 15, L: 3, c: 11
 w  
+# B: 17, C: 17, L: 3, c: 13
 l\x0a
+# B: 18, C: 18, L: 4, c: 0
 i    
+# B: 22, C: 22, L: 4, c: 4
 w  
+# B: 24, C: 24, L: 4, c: 6
 Tc
+# B: 25, C: 25, L: 4, c: 7
 s
diff --git a/tests/ns-plain.n=4.c=flow-key.invalid.output b/tests/ns-plain.n=4.c=flow-key.invalid.output
--- a/tests/ns-plain.n=4.c=flow-key.invalid.output
+++ b/tests/ns-plain.n=4.c=flow-key.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 T12
+# B: 2, C: 2, L: 1, c: 2
 s
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected ','
diff --git a/tests/ns-plain.n=4.c=flow-key.output b/tests/ns-plain.n=4.c=flow-key.output
--- a/tests/ns-plain.n=4.c=flow-key.output
+++ b/tests/ns-plain.n=4.c=flow-key.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta \x09" :# () b
+# B: 12, C: 12, L: 1, c: 12
 s
diff --git a/tests/ns-reserved-directive.invalid.output b/tests/ns-reserved-directive.invalid.output
--- a/tests/ns-reserved-directive.invalid.output
+++ b/tests/ns-reserved-directive.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-reserved-directive.output b/tests/ns-reserved-directive.output
--- a/tests/ns-reserved-directive.output
+++ b/tests/ns-reserved-directive.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 tname
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 tvalue1
+# B: 11, C: 11, L: 1, c: 11
 w 
+# B: 12, C: 12, L: 1, c: 12
 tvalue2
diff --git a/tests/ns-s-block-map-implicit-key.invalid.output b/tests/ns-s-block-map-implicit-key.invalid.output
--- a/tests/ns-s-block-map-implicit-key.invalid.output
+++ b/tests/ns-s-block-map-implicit-key.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '?'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '?'
diff --git a/tests/ns-s-block-map-implicit-key.json.output b/tests/ns-s-block-map-implicit-key.json.output
--- a/tests/ns-s-block-map-implicit-key.json.output
+++ b/tests/ns-s-block-map-implicit-key.json.output
@@ -1,8 +1,16 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I"
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 I"
+# B: 3, C: 3, L: 1, c: 3
 s
+# B: 3, C: 3, L: 1, c: 3
 n
+# B: 3, C: 3, L: 1, c: 3
 w 
diff --git a/tests/ns-s-block-map-implicit-key.yaml.output b/tests/ns-s-block-map-implicit-key.yaml.output
--- a/tests/ns-s-block-map-implicit-key.yaml.output
+++ b/tests/ns-s-block-map-implicit-key.yaml.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 w 
diff --git a/tests/ns-s-flow-map-entries.n=4.c=flow-in.invalid.output b/tests/ns-s-flow-map-entries.n=4.c=flow-in.invalid.output
--- a/tests/ns-s-flow-map-entries.n=4.c=flow-in.invalid.output
+++ b/tests/ns-s-flow-map-entries.n=4.c=flow-in.invalid.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 x
+# B: 1, C: 1, L: 1, c: 1
 I,
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected ','
diff --git a/tests/ns-s-flow-map-entries.n=4.c=flow-in.lines.output b/tests/ns-s-flow-map-entries.n=4.c=flow-in.lines.output
--- a/tests/ns-s-flow-map-entries.n=4.c=flow-in.lines.output
+++ b/tests/ns-s-flow-map-entries.n=4.c=flow-in.lines.output
@@ -1,45 +1,90 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 x
+# B: 4, C: 4, L: 1, c: 4
 I,
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 X
+# B: 6, C: 6, L: 1, c: 6
 I?
+# B: 7, C: 7, L: 1, c: 7
 w 
+# B: 8, C: 8, L: 1, c: 8
 N
+# B: 8, C: 8, L: 1, c: 8
 S
+# B: 8, C: 8, L: 1, c: 8
 Tc
+# B: 9, C: 9, L: 1, c: 9
 s
+# B: 9, C: 9, L: 1, c: 9
 n
+# B: 9, C: 9, L: 1, c: 9
 N
+# B: 9, C: 9, L: 1, c: 9
 S
+# B: 9, C: 9, L: 1, c: 9
 s
+# B: 9, C: 9, L: 1, c: 9
 n
+# B: 9, C: 9, L: 1, c: 9
 x
+# B: 9, C: 9, L: 1, c: 9
 I,
+# B: 10, C: 10, L: 1, c: 10
 w 
+# B: 11, C: 11, L: 1, c: 11
 X
+# B: 11, C: 11, L: 1, c: 11
 N
+# B: 11, C: 11, L: 1, c: 11
 S
+# B: 11, C: 11, L: 1, c: 11
 Td
+# B: 12, C: 12, L: 1, c: 12
 s
+# B: 12, C: 12, L: 1, c: 12
 n
+# B: 12, C: 12, L: 1, c: 12
 N
+# B: 12, C: 12, L: 1, c: 12
 S
+# B: 12, C: 12, L: 1, c: 12
 s
+# B: 12, C: 12, L: 1, c: 12
 n
+# B: 12, C: 12, L: 1, c: 12
 x
+# B: 12, C: 12, L: 1, c: 12
 I,
+# B: 13, C: 13, L: 1, c: 13
 w 
diff --git a/tests/ns-s-flow-map-entries.n=4.c=flow-in.multi.output b/tests/ns-s-flow-map-entries.n=4.c=flow-in.multi.output
--- a/tests/ns-s-flow-map-entries.n=4.c=flow-in.multi.output
+++ b/tests/ns-s-flow-map-entries.n=4.c=flow-in.multi.output
@@ -1,45 +1,90 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 x
+# B: 4, C: 4, L: 1, c: 4
 I,
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 X
+# B: 6, C: 6, L: 1, c: 6
 I?
+# B: 7, C: 7, L: 1, c: 7
 w 
+# B: 8, C: 8, L: 1, c: 8
 N
+# B: 8, C: 8, L: 1, c: 8
 S
+# B: 8, C: 8, L: 1, c: 8
 Tc
+# B: 9, C: 9, L: 1, c: 9
 s
+# B: 9, C: 9, L: 1, c: 9
 n
+# B: 9, C: 9, L: 1, c: 9
 N
+# B: 9, C: 9, L: 1, c: 9
 S
+# B: 9, C: 9, L: 1, c: 9
 s
+# B: 9, C: 9, L: 1, c: 9
 n
+# B: 9, C: 9, L: 1, c: 9
 x
+# B: 9, C: 9, L: 1, c: 9
 I,
+# B: 10, C: 10, L: 1, c: 10
 w 
+# B: 11, C: 11, L: 1, c: 11
 X
+# B: 11, C: 11, L: 1, c: 11
 N
+# B: 11, C: 11, L: 1, c: 11
 S
+# B: 11, C: 11, L: 1, c: 11
 Td
+# B: 12, C: 12, L: 1, c: 12
 s
+# B: 12, C: 12, L: 1, c: 12
 n
+# B: 12, C: 12, L: 1, c: 12
 N
+# B: 12, C: 12, L: 1, c: 12
 S
+# B: 12, C: 12, L: 1, c: 12
 s
+# B: 12, C: 12, L: 1, c: 12
 n
+# B: 12, C: 12, L: 1, c: 12
 x
+# B: 12, C: 12, L: 1, c: 12
 I,
+# B: 13, C: 13, L: 1, c: 13
 w 
diff --git a/tests/ns-s-flow-map-entries.n=4.c=flow-in.single.output b/tests/ns-s-flow-map-entries.n=4.c=flow-in.single.output
--- a/tests/ns-s-flow-map-entries.n=4.c=flow-in.single.output
+++ b/tests/ns-s-flow-map-entries.n=4.c=flow-in.single.output
@@ -1,15 +1,30 @@
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 x
diff --git a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.invalid.output b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.invalid.output
--- a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.invalid.output
+++ b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.invalid.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I,
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected ','
diff --git a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.lines.output b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.lines.output
--- a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.lines.output
+++ b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.lines.output
@@ -1,26 +1,52 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 I,
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 M
+# B: 4, C: 4, L: 1, c: 4
 X
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 Tc
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 I:
+# B: 6, C: 6, L: 1, c: 6
 w 
+# B: 7, C: 7, L: 1, c: 7
 N
+# B: 7, C: 7, L: 1, c: 7
 S
+# B: 8, C: 8, L: 1, c: 8
 !Commit to 'node' was made outside it
+# B: 7, C: 7, L: 1, c: 7
 Td
+# B: 8, C: 8, L: 1, c: 8
 s
+# B: 8, C: 8, L: 1, c: 8
 n
+# B: 8, C: 8, L: 1, c: 8
 x
+# B: 8, C: 8, L: 1, c: 8
 m
+# B: 8, C: 8, L: 1, c: 8
 w 
diff --git a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.multi.output b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.multi.output
--- a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.multi.output
+++ b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.multi.output
@@ -1,26 +1,52 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 w 
+# B: 2, C: 2, L: 1, c: 2
 I,
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 M
+# B: 4, C: 4, L: 1, c: 4
 X
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 Tc
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 I:
+# B: 6, C: 6, L: 1, c: 6
 w 
+# B: 7, C: 7, L: 1, c: 7
 N
+# B: 7, C: 7, L: 1, c: 7
 S
+# B: 8, C: 8, L: 1, c: 8
 !Commit to 'node' was made outside it
+# B: 7, C: 7, L: 1, c: 7
 Td
+# B: 8, C: 8, L: 1, c: 8
 s
+# B: 8, C: 8, L: 1, c: 8
 n
+# B: 8, C: 8, L: 1, c: 8
 x
+# B: 8, C: 8, L: 1, c: 8
 m
+# B: 8, C: 8, L: 1, c: 8
 w 
diff --git a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.output b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.output
--- a/tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.output
+++ b/tests/ns-s-flow-seq-entries.n=4.c=flow-in.single.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
diff --git a/tests/ns-s-implicit-yaml-key.c=block-key.short.input b/tests/ns-s-implicit-yaml-key.c=block-key.short.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=block-key.short.input
@@ -0,0 +1,1 @@
+a, b 
diff --git a/tests/ns-s-implicit-yaml-key.c=block-key.short.output b/tests/ns-s-implicit-yaml-key.c=block-key.short.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=block-key.short.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta, b
+# B: 4, C: 4, L: 1, c: 4
+s
+# B: 4, C: 4, L: 1, c: 4
+n
+# B: 4, C: 4, L: 1, c: 4
+w 
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.input b/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.input
@@ -0,0 +1,1 @@
+a, b 
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.output b/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.invalid.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected ','
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.just.input b/tests/ns-s-implicit-yaml-key.c=flow-key.just.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.just.input
@@ -0,0 +1,1 @@
+123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.just.output b/tests/ns-s-implicit-yaml-key.c=flow-key.just.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.just.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
+# B: 1023, C: 1023, L: 1, c: 1023
+s
+# B: 1023, C: 1023, L: 1, c: 1023
+n
+# B: 1023, C: 1023, L: 1, c: 1023
+w 
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.long.input b/tests/ns-s-implicit-yaml-key.c=flow-key.long.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.long.input
@@ -0,0 +1,1 @@
+123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef X
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.long.output b/tests/ns-s-implicit-yaml-key.c=flow-key.long.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.long.output
@@ -0,0 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
+# B: 1023, C: 1023, L: 1, c: 1023
+s
+# B: 1023, C: 1023, L: 1, c: 1023
+n
+# B: 1023, C: 1023, L: 1, c: 1023
+w 
+# B: 1024, C: 1024, L: 1, c: 1024
+!Unexpected 'X'
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.short.input b/tests/ns-s-implicit-yaml-key.c=flow-key.short.input
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.short.input
@@ -0,0 +1,1 @@
+a 
diff --git a/tests/ns-s-implicit-yaml-key.c=flow-key.short.output b/tests/ns-s-implicit-yaml-key.c=flow-key.short.output
new file mode 100644
--- /dev/null
+++ b/tests/ns-s-implicit-yaml-key.c=flow-key.short.output
@@ -0,0 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
+N
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+Ta
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+w 
diff --git a/tests/ns-s-implicit-yaml-key.just.input b/tests/ns-s-implicit-yaml-key.just.input
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.just.input
+++ /dev/null
@@ -1,1 +0,0 @@
-123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 
diff --git a/tests/ns-s-implicit-yaml-key.just.output b/tests/ns-s-implicit-yaml-key.just.output
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.just.output
+++ /dev/null
@@ -1,6 +0,0 @@
-N
-S
-T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
-s
-n
-w 
diff --git a/tests/ns-s-implicit-yaml-key.long.input b/tests/ns-s-implicit-yaml-key.long.input
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.long.input
+++ /dev/null
@@ -1,1 +0,0 @@
-123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef X
diff --git a/tests/ns-s-implicit-yaml-key.long.output b/tests/ns-s-implicit-yaml-key.long.output
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.long.output
+++ /dev/null
@@ -1,7 +0,0 @@
-N
-S
-T123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
-s
-n
-w 
-!$InputFile$: line 1: column 1024: Expected end of input
diff --git a/tests/ns-s-implicit-yaml-key.short.input b/tests/ns-s-implicit-yaml-key.short.input
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.short.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a 
diff --git a/tests/ns-s-implicit-yaml-key.short.output b/tests/ns-s-implicit-yaml-key.short.output
deleted file mode 100644
--- a/tests/ns-s-implicit-yaml-key.short.output
+++ /dev/null
@@ -1,6 +0,0 @@
-N
-S
-Ta
-s
-n
-w 
diff --git a/tests/ns-single-char.invalid.output b/tests/ns-single-char.invalid.output
--- a/tests/ns-single-char.invalid.output
+++ b/tests/ns-single-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/ns-single-char.output b/tests/ns-single-char.output
--- a/tests/ns-single-char.output
+++ b/tests/ns-single-char.output
@@ -1,1 +1,2 @@
-?a
+# B: 0, C: 0, L: 1, c: 0
+-a
diff --git a/tests/ns-tag-char.invalid.output b/tests/ns-tag-char.invalid.output
--- a/tests/ns-tag-char.invalid.output
+++ b/tests/ns-tag-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '!'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '!'
diff --git a/tests/ns-tag-char.output b/tests/ns-tag-char.output
--- a/tests/ns-tag-char.output
+++ b/tests/ns-tag-char.output
@@ -1,1 +1,2 @@
-?@
+# B: 0, C: 0, L: 1, c: 0
+-@
diff --git a/tests/ns-tag-directive.invalid.output b/tests/ns-tag-directive.invalid.output
--- a/tests/ns-tag-directive.invalid.output
+++ b/tests/ns-tag-directive.invalid.output
@@ -1,5 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 tTAG
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'directive' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 H
-!$InputFile$: line 1: column 4: Unexpected 'a'
+# B: 4, C: 4, L: 1, c: 4
+h
+# B: 4, C: 4, L: 1, c: 4
+!Unexpected 'a'
diff --git a/tests/ns-tag-directive.output b/tests/ns-tag-directive.output
--- a/tests/ns-tag-directive.output
+++ b/tests/ns-tag-directive.output
@@ -1,13 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 tTAG
+# B: 3, C: 3, L: 1, c: 3
 !Commit to 'directive' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 H
+# B: 4, C: 4, L: 1, c: 4
 I!
+# B: 5, C: 5, L: 1, c: 5
 tname
+# B: 9, C: 9, L: 1, c: 9
 I!
+# B: 10, C: 10, L: 1, c: 10
 h
+# B: 10, C: 10, L: 1, c: 10
 w 
+# B: 11, C: 11, L: 1, c: 11
 G
+# B: 11, C: 11, L: 1, c: 11
 I!
+# B: 12, C: 12, L: 1, c: 12
 tprefix
+# B: 18, C: 18, L: 1, c: 18
 g
diff --git a/tests/ns-tag-prefix.global.output b/tests/ns-tag-prefix.global.output
--- a/tests/ns-tag-prefix.global.output
+++ b/tests/ns-tag-prefix.global.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 tprefix
+# B: 6, C: 6, L: 1, c: 6
 g
diff --git a/tests/ns-tag-prefix.invalid.output b/tests/ns-tag-prefix.invalid.output
--- a/tests/ns-tag-prefix.invalid.output
+++ b/tests/ns-tag-prefix.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '^'
diff --git a/tests/ns-tag-prefix.local.output b/tests/ns-tag-prefix.local.output
--- a/tests/ns-tag-prefix.local.output
+++ b/tests/ns-tag-prefix.local.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 tprefix
+# B: 7, C: 7, L: 1, c: 7
 g
diff --git a/tests/ns-uri-char.6.output b/tests/ns-uri-char.6.output
--- a/tests/ns-uri-char.6.output
+++ b/tests/ns-uri-char.6.output
@@ -1,1 +1,2 @@
-?6
+# B: 0, C: 0, L: 1, c: 0
+-6
diff --git a/tests/ns-uri-char.ampersand.output b/tests/ns-uri-char.ampersand.output
--- a/tests/ns-uri-char.ampersand.output
+++ b/tests/ns-uri-char.ampersand.output
@@ -1,1 +1,2 @@
-?&
+# B: 0, C: 0, L: 1, c: 0
+-&
diff --git a/tests/ns-uri-char.asterisk.output b/tests/ns-uri-char.asterisk.output
--- a/tests/ns-uri-char.asterisk.output
+++ b/tests/ns-uri-char.asterisk.output
@@ -1,1 +1,2 @@
-?*
+# B: 0, C: 0, L: 1, c: 0
+-*
diff --git a/tests/ns-uri-char.at.output b/tests/ns-uri-char.at.output
--- a/tests/ns-uri-char.at.output
+++ b/tests/ns-uri-char.at.output
@@ -1,1 +1,2 @@
-?@
+# B: 0, C: 0, L: 1, c: 0
+-@
diff --git a/tests/ns-uri-char.colon.output b/tests/ns-uri-char.colon.output
--- a/tests/ns-uri-char.colon.output
+++ b/tests/ns-uri-char.colon.output
@@ -1,1 +1,2 @@
-?:
+# B: 0, C: 0, L: 1, c: 0
+-:
diff --git a/tests/ns-uri-char.comma.output b/tests/ns-uri-char.comma.output
--- a/tests/ns-uri-char.comma.output
+++ b/tests/ns-uri-char.comma.output
@@ -1,1 +1,2 @@
-?,
+# B: 0, C: 0, L: 1, c: 0
+-,
diff --git a/tests/ns-uri-char.dollar.output b/tests/ns-uri-char.dollar.output
--- a/tests/ns-uri-char.dollar.output
+++ b/tests/ns-uri-char.dollar.output
@@ -1,1 +1,2 @@
-?$
+# B: 0, C: 0, L: 1, c: 0
+-$
diff --git a/tests/ns-uri-char.equal.output b/tests/ns-uri-char.equal.output
--- a/tests/ns-uri-char.equal.output
+++ b/tests/ns-uri-char.equal.output
@@ -1,1 +1,2 @@
-?=
+# B: 0, C: 0, L: 1, c: 0
+-=
diff --git a/tests/ns-uri-char.escaped.output b/tests/ns-uri-char.escaped.output
--- a/tests/ns-uri-char.escaped.output
+++ b/tests/ns-uri-char.escaped.output
@@ -1,1 +1,2 @@
-?%0a
+# B: 0, C: 0, L: 1, c: 0
+-%0a
diff --git a/tests/ns-uri-char.exclamation.output b/tests/ns-uri-char.exclamation.output
--- a/tests/ns-uri-char.exclamation.output
+++ b/tests/ns-uri-char.exclamation.output
@@ -1,1 +1,2 @@
-?!
+# B: 0, C: 0, L: 1, c: 0
+-!
diff --git a/tests/ns-uri-char.hyphen.output b/tests/ns-uri-char.hyphen.output
--- a/tests/ns-uri-char.hyphen.output
+++ b/tests/ns-uri-char.hyphen.output
@@ -1,1 +1,2 @@
-?-
+# B: 0, C: 0, L: 1, c: 0
+--
diff --git a/tests/ns-uri-char.invalid.output b/tests/ns-uri-char.invalid.output
--- a/tests/ns-uri-char.invalid.output
+++ b/tests/ns-uri-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 2: Unexpected 'q'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'q'
diff --git a/tests/ns-uri-char.left-round.output b/tests/ns-uri-char.left-round.output
--- a/tests/ns-uri-char.left-round.output
+++ b/tests/ns-uri-char.left-round.output
@@ -1,1 +1,2 @@
-?(
+# B: 0, C: 0, L: 1, c: 0
+-(
diff --git a/tests/ns-uri-char.left-square.output b/tests/ns-uri-char.left-square.output
--- a/tests/ns-uri-char.left-square.output
+++ b/tests/ns-uri-char.left-square.output
@@ -1,1 +1,2 @@
-?[
+# B: 0, C: 0, L: 1, c: 0
+-[
diff --git a/tests/ns-uri-char.n.output b/tests/ns-uri-char.n.output
--- a/tests/ns-uri-char.n.output
+++ b/tests/ns-uri-char.n.output
@@ -1,1 +1,2 @@
-?n
+# B: 0, C: 0, L: 1, c: 0
+-n
diff --git a/tests/ns-uri-char.period.output b/tests/ns-uri-char.period.output
--- a/tests/ns-uri-char.period.output
+++ b/tests/ns-uri-char.period.output
@@ -1,1 +1,2 @@
-?.
+# B: 0, C: 0, L: 1, c: 0
+-.
diff --git a/tests/ns-uri-char.plus.output b/tests/ns-uri-char.plus.output
--- a/tests/ns-uri-char.plus.output
+++ b/tests/ns-uri-char.plus.output
@@ -1,1 +1,2 @@
-?+
+# B: 0, C: 0, L: 1, c: 0
+-+
diff --git a/tests/ns-uri-char.question.output b/tests/ns-uri-char.question.output
--- a/tests/ns-uri-char.question.output
+++ b/tests/ns-uri-char.question.output
@@ -1,1 +1,2 @@
-??
+# B: 0, C: 0, L: 1, c: 0
+-?
diff --git a/tests/ns-uri-char.right-round.output b/tests/ns-uri-char.right-round.output
--- a/tests/ns-uri-char.right-round.output
+++ b/tests/ns-uri-char.right-round.output
@@ -1,1 +1,2 @@
-?)
+# B: 0, C: 0, L: 1, c: 0
+-)
diff --git a/tests/ns-uri-char.right-square.output b/tests/ns-uri-char.right-square.output
--- a/tests/ns-uri-char.right-square.output
+++ b/tests/ns-uri-char.right-square.output
@@ -1,1 +1,2 @@
-?]
+# B: 0, C: 0, L: 1, c: 0
+-]
diff --git a/tests/ns-uri-char.semicolon.output b/tests/ns-uri-char.semicolon.output
--- a/tests/ns-uri-char.semicolon.output
+++ b/tests/ns-uri-char.semicolon.output
@@ -1,1 +1,2 @@
-?;
+# B: 0, C: 0, L: 1, c: 0
+-;
diff --git a/tests/ns-uri-char.single-quote.output b/tests/ns-uri-char.single-quote.output
--- a/tests/ns-uri-char.single-quote.output
+++ b/tests/ns-uri-char.single-quote.output
@@ -1,1 +1,2 @@
-?'
+# B: 0, C: 0, L: 1, c: 0
+-'
diff --git a/tests/ns-uri-char.slash.output b/tests/ns-uri-char.slash.output
--- a/tests/ns-uri-char.slash.output
+++ b/tests/ns-uri-char.slash.output
@@ -1,1 +1,2 @@
-?/
+# B: 0, C: 0, L: 1, c: 0
+-/
diff --git a/tests/ns-uri-char.tilde.output b/tests/ns-uri-char.tilde.output
--- a/tests/ns-uri-char.tilde.output
+++ b/tests/ns-uri-char.tilde.output
@@ -1,1 +1,2 @@
-?~
+# B: 0, C: 0, L: 1, c: 0
+-~
diff --git a/tests/ns-uri-char.underscore.output b/tests/ns-uri-char.underscore.output
--- a/tests/ns-uri-char.underscore.output
+++ b/tests/ns-uri-char.underscore.output
@@ -1,1 +1,2 @@
-?_
+# B: 0, C: 0, L: 1, c: 0
+-_
diff --git a/tests/ns-word-char.0.output b/tests/ns-word-char.0.output
--- a/tests/ns-word-char.0.output
+++ b/tests/ns-word-char.0.output
@@ -1,1 +1,2 @@
-?0
+# B: 0, C: 0, L: 1, c: 0
+-0
diff --git a/tests/ns-word-char.hyphen.output b/tests/ns-word-char.hyphen.output
--- a/tests/ns-word-char.hyphen.output
+++ b/tests/ns-word-char.hyphen.output
@@ -1,1 +1,2 @@
-?-
+# B: 0, C: 0, L: 1, c: 0
+--
diff --git a/tests/ns-word-char.invalid.output b/tests/ns-word-char.invalid.output
--- a/tests/ns-word-char.invalid.output
+++ b/tests/ns-word-char.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '_'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '_'
diff --git a/tests/ns-word-char.n.output b/tests/ns-word-char.n.output
--- a/tests/ns-word-char.n.output
+++ b/tests/ns-word-char.n.output
@@ -1,1 +1,2 @@
-?n
+# B: 0, C: 0, L: 1, c: 0
+-n
diff --git a/tests/ns-yaml-directive.invalid.output b/tests/ns-yaml-directive.invalid.output
--- a/tests/ns-yaml-directive.invalid.output
+++ b/tests/ns-yaml-directive.invalid.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 tYAML
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'directive' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 w 
-!$InputFile$: line 1: column 5: Unexpected 'a'
+# B: 5, C: 5, L: 1, c: 5
+!Unexpected 'a'
diff --git a/tests/ns-yaml-directive.output b/tests/ns-yaml-directive.output
--- a/tests/ns-yaml-directive.output
+++ b/tests/ns-yaml-directive.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 tYAML
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'directive' was made outside it
+# B: 4, C: 4, L: 1, c: 4
 w 
+# B: 5, C: 5, L: 1, c: 5
 t0.1
diff --git a/tests/ns-yaml-version.invalid.output b/tests/ns-yaml-version.invalid.output
--- a/tests/ns-yaml-version.invalid.output
+++ b/tests/ns-yaml-version.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 1: Unexpected 'a'
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected 'a'
diff --git a/tests/ns-yaml-version.output b/tests/ns-yaml-version.output
--- a/tests/ns-yaml-version.output
+++ b/tests/ns-yaml-version.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 t0.1
diff --git a/tests/s-b-comment.break.input b/tests/s-b-comment.break.input
new file mode 100644
--- /dev/null
+++ b/tests/s-b-comment.break.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/s-b-comment.break.output b/tests/s-b-comment.break.output
new file mode 100644
--- /dev/null
+++ b/tests/s-b-comment.break.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+b\x0a
diff --git a/tests/s-b-comment.empty.output b/tests/s-b-comment.empty.output
--- a/tests/s-b-comment.empty.output
+++ b/tests/s-b-comment.empty.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
diff --git a/tests/s-b-comment.invalid.output b/tests/s-b-comment.invalid.output
--- a/tests/s-b-comment.invalid.output
+++ b/tests/s-b-comment.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-b-comment.sol-text.output b/tests/s-b-comment.sol-text.output
--- a/tests/s-b-comment.sol-text.output
+++ b/tests/s-b-comment.sol-text.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 C
+# B: 0, C: 0, L: 1, c: 0
 I#
+# B: 1, C: 1, L: 1, c: 1
 ttext
+# B: 5, C: 5, L: 1, c: 5
 c
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
diff --git a/tests/s-b-comment.spaces-text.output b/tests/s-b-comment.spaces-text.output
--- a/tests/s-b-comment.spaces-text.output
+++ b/tests/s-b-comment.spaces-text.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 C
+# B: 1, C: 1, L: 1, c: 1
 I#
+# B: 2, C: 2, L: 1, c: 2
 ttext
+# B: 6, C: 6, L: 1, c: 6
 c
+# B: 6, C: 6, L: 1, c: 6
 b\x0a
diff --git a/tests/s-b-comment.spaces.output b/tests/s-b-comment.spaces.output
--- a/tests/s-b-comment.spaces.output
+++ b/tests/s-b-comment.spaces.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/s-block-line-prefix.n=4.invalid.output b/tests/s-block-line-prefix.n=4.invalid.output
--- a/tests/s-block-line-prefix.n=4.invalid.output
+++ b/tests/s-block-line-prefix.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/s-block-line-prefix.n=4.output b/tests/s-block-line-prefix.n=4.output
--- a/tests/s-block-line-prefix.n=4.output
+++ b/tests/s-block-line-prefix.n=4.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-double-break.n=4.escaped.input b/tests/s-double-break.n=4.escaped.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.escaped.input
@@ -0,0 +1,2 @@
+ \
+     
diff --git a/tests/s-double-break.n=4.escaped.output b/tests/s-double-break.n=4.escaped.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.escaped.output
@@ -0,0 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
+- 
+# B: 1, C: 1, L: 1, c: 1
+E
+# B: 1, C: 1, L: 1, c: 1
+I\x5c
+# B: 2, C: 2, L: 1, c: 2
+b\x0a
+# B: 3, C: 3, L: 2, c: 0
+e
+# B: 3, C: 3, L: 2, c: 0
+i    
+# B: 7, C: 7, L: 2, c: 4
+w 
diff --git a/tests/s-double-break.n=4.folded.input b/tests/s-double-break.n=4.folded.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.folded.input
@@ -0,0 +1,3 @@
+ 
+
+     
diff --git a/tests/s-double-break.n=4.folded.output b/tests/s-double-break.n=4.folded.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.folded.output
@@ -0,0 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
+w 
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
+# B: 2, C: 2, L: 2, c: 0
+L\x0a
+# B: 3, C: 3, L: 3, c: 0
+i    
+# B: 7, C: 7, L: 3, c: 4
+w 
diff --git a/tests/s-double-break.n=4.invalid.input b/tests/s-double-break.n=4.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.invalid.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/s-double-break.n=4.invalid.output b/tests/s-double-break.n=4.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-break.n=4.invalid.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-double-escaped.n=2.input b/tests/s-double-escaped.n=2.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-escaped.n=2.input
@@ -0,0 +1,3 @@
+ \
+
+   
diff --git a/tests/s-double-escaped.n=2.invalid.input b/tests/s-double-escaped.n=2.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-escaped.n=2.invalid.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/s-double-escaped.n=2.invalid.output b/tests/s-double-escaped.n=2.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-escaped.n=2.invalid.output
@@ -0,0 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
+E
+# B: 0, C: 0, L: 1, c: 0
+e
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-double-escaped.n=2.output b/tests/s-double-escaped.n=2.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-escaped.n=2.output
@@ -0,0 +1,18 @@
+# B: 0, C: 0, L: 1, c: 0
+- 
+# B: 1, C: 1, L: 1, c: 1
+E
+# B: 1, C: 1, L: 1, c: 1
+I\x5c
+# B: 2, C: 2, L: 1, c: 2
+!Commit to 'escape' was made outside it
+# B: 2, C: 2, L: 1, c: 2
+b\x0a
+# B: 3, C: 3, L: 2, c: 0
+e
+# B: 3, C: 3, L: 2, c: 0
+L\x0a
+# B: 4, C: 4, L: 3, c: 0
+i  
+# B: 6, C: 6, L: 3, c: 2
+w 
diff --git a/tests/s-double-next-line.n=4.input b/tests/s-double-next-line.n=4.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-next-line.n=4.input
@@ -0,0 +1,2 @@
+
+    	a b	c
diff --git a/tests/s-double-next-line.n=4.invalid.input b/tests/s-double-next-line.n=4.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/s-double-next-line.n=4.invalid.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/s-double-next-line.n=4.invalid.output b/tests/s-double-next-line.n=4.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-next-line.n=4.invalid.output
@@ -0,0 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
+l\x0a
+# B: 1, C: 1, L: 2, c: 0
+!Unexpected end of input
diff --git a/tests/s-double-next-line.n=4.output b/tests/s-double-next-line.n=4.output
new file mode 100644
--- /dev/null
+++ b/tests/s-double-next-line.n=4.output
@@ -0,0 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
+l\x0a
+# B: 1, C: 1, L: 2, c: 0
+i    
+# B: 5, C: 5, L: 2, c: 4
+w\x09
+# B: 6, C: 6, L: 2, c: 5
+-a b\x09c
diff --git a/tests/s-flow-folded.n=2.input b/tests/s-flow-folded.n=2.input
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=2.input
@@ -0,0 +1,2 @@
+  
+  	
diff --git a/tests/s-flow-folded.n=2.output b/tests/s-flow-folded.n=2.output
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=2.output
@@ -0,0 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
+w  
+# B: 2, C: 2, L: 1, c: 2
+l\x0a
+# B: 3, C: 3, L: 2, c: 0
+i  
+# B: 5, C: 5, L: 2, c: 2
+w\x09
diff --git a/tests/s-flow-folded.n=4.invalid.input b/tests/s-flow-folded.n=4.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.invalid.input
@@ -0,0 +1,1 @@
+a
diff --git a/tests/s-flow-folded.n=4.invalid.output b/tests/s-flow-folded.n=4.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.invalid.output
@@ -0,0 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-flow-folded.n=4.lf.input b/tests/s-flow-folded.n=4.lf.input
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.lf.input
@@ -0,0 +1,2 @@
+
+    	
diff --git a/tests/s-flow-folded.n=4.lf.output b/tests/s-flow-folded.n=4.lf.output
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.lf.output
@@ -0,0 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
+l\x0a
+# B: 1, C: 1, L: 2, c: 0
+i    
+# B: 5, C: 5, L: 2, c: 4
+w\x09
diff --git a/tests/s-flow-folded.n=4.sp-lf-lf.input b/tests/s-flow-folded.n=4.sp-lf-lf.input
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.sp-lf-lf.input
@@ -0,0 +1,3 @@
+ 
+
+    	
diff --git a/tests/s-flow-folded.n=4.sp-lf-lf.output b/tests/s-flow-folded.n=4.sp-lf-lf.output
new file mode 100644
--- /dev/null
+++ b/tests/s-flow-folded.n=4.sp-lf-lf.output
@@ -0,0 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
+w 
+# B: 1, C: 1, L: 1, c: 1
+b\x0a
+# B: 2, C: 2, L: 2, c: 0
+L\x0a
+# B: 3, C: 3, L: 3, c: 0
+i    
+# B: 7, C: 7, L: 3, c: 4
+w\x09
diff --git a/tests/s-flow-line-prefix.n=4.indent.output b/tests/s-flow-line-prefix.n=4.indent.output
--- a/tests/s-flow-line-prefix.n=4.indent.output
+++ b/tests/s-flow-line-prefix.n=4.indent.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-flow-line-prefix.n=4.invalid.output b/tests/s-flow-line-prefix.n=4.invalid.output
--- a/tests/s-flow-line-prefix.n=4.invalid.output
+++ b/tests/s-flow-line-prefix.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/s-flow-line-prefix.n=4.tab.output b/tests/s-flow-line-prefix.n=4.tab.output
--- a/tests/s-flow-line-prefix.n=4.tab.output
+++ b/tests/s-flow-line-prefix.n=4.tab.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 4, C: 4, L: 1, c: 4
 w\x09
diff --git a/tests/s-indent-le.n=-1.invalid.output b/tests/s-indent-le.n=-1.invalid.output
--- a/tests/s-indent-le.n=-1.invalid.output
+++ b/tests/s-indent-le.n=-1.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Fewer than 0 repetitions
+# B: 0, C: 0, L: 1, c: 0
+!Fewer than 0 repetitions
diff --git a/tests/s-indent-le.n=4.invalid.output b/tests/s-indent-le.n=4.invalid.output
--- a/tests/s-indent-le.n=4.invalid.output
+++ b/tests/s-indent-le.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 4: Unexpected ' '
+# B: 4, C: 4, L: 1, c: 4
+!Unexpected ' '
diff --git a/tests/s-indent-le.n=4.output b/tests/s-indent-le.n=4.output
--- a/tests/s-indent-le.n=4.output
+++ b/tests/s-indent-le.n=4.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-indent-lt.n=-1.invalid.output b/tests/s-indent-lt.n=-1.invalid.output
--- a/tests/s-indent-lt.n=-1.invalid.output
+++ b/tests/s-indent-lt.n=-1.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Fewer than 0 repetitions
+# B: 0, C: 0, L: 1, c: 0
+!Fewer than 0 repetitions
diff --git a/tests/s-indent-lt.n=0.invalid.output b/tests/s-indent-lt.n=0.invalid.output
--- a/tests/s-indent-lt.n=0.invalid.output
+++ b/tests/s-indent-lt.n=0.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Fewer than 0 repetitions
+# B: 0, C: 0, L: 1, c: 0
+!Fewer than 0 repetitions
diff --git a/tests/s-indent-lt.n=4.invalid.output b/tests/s-indent-lt.n=4.invalid.output
--- a/tests/s-indent-lt.n=4.invalid.output
+++ b/tests/s-indent-lt.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 3: Unexpected ' '
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected ' '
diff --git a/tests/s-indent-lt.n=4.output b/tests/s-indent-lt.n=4.output
--- a/tests/s-indent-lt.n=4.output
+++ b/tests/s-indent-lt.n=4.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i   
diff --git a/tests/s-indent.n=4.invalid.output b/tests/s-indent.n=4.invalid.output
--- a/tests/s-indent.n=4.invalid.output
+++ b/tests/s-indent.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 3: Unexpected end of input
+# B: 3, C: 3, L: 1, c: 3
+!Unexpected end of input
diff --git a/tests/s-indent.n=4.output b/tests/s-indent.n=4.output
--- a/tests/s-indent.n=4.output
+++ b/tests/s-indent.n=4.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-l+block-collection.n=2.c=block-in.invalid.output b/tests/s-l+block-collection.n=2.c=block-in.invalid.output
--- a/tests/s-l+block-collection.n=2.c=block-in.invalid.output
+++ b/tests/s-l+block-collection.n=2.c=block-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 M
-!$InputFile$: line 2: column 2: Unexpected '-'
+# B: 1, C: 1, L: 2, c: 0
+-  
+# B: 3, C: 3, L: 2, c: 2
+m
+# B: 3, C: 3, L: 2, c: 2
+!Unexpected '-'
diff --git a/tests/s-l+block-collection.n=2.c=block-in.mapping.output b/tests/s-l+block-collection.n=2.c=block-in.mapping.output
--- a/tests/s-l+block-collection.n=2.c=block-in.mapping.output
+++ b/tests/s-l+block-collection.n=2.c=block-in.mapping.output
@@ -1,21 +1,42 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 M
+# B: 1, C: 1, L: 2, c: 0
 i   
+# B: 4, C: 4, L: 2, c: 3
 X
+# B: 4, C: 4, L: 2, c: 3
 N
+# B: 4, C: 4, L: 2, c: 3
 S
+# B: 4, C: 4, L: 2, c: 3
 Ta
+# B: 5, C: 5, L: 2, c: 4
 s
+# B: 5, C: 5, L: 2, c: 4
 n
+# B: 5, C: 5, L: 2, c: 4
 I:
+# B: 6, C: 6, L: 2, c: 5
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 2, c: 5
 w 
+# B: 7, C: 7, L: 2, c: 6
 N
+# B: 7, C: 7, L: 2, c: 6
 S
+# B: 8, C: 8, L: 2, c: 7
 !Commit to 'node' was made outside it
+# B: 7, C: 7, L: 2, c: 6
 Tb
+# B: 8, C: 8, L: 2, c: 7
 s
+# B: 8, C: 8, L: 2, c: 7
 n
+# B: 8, C: 8, L: 2, c: 7
 b\x0a
+# B: 9, C: 9, L: 3, c: 0
 x
+# B: 9, C: 9, L: 3, c: 0
 m
diff --git a/tests/s-l+block-collection.n=2.c=block-out.mapping.output b/tests/s-l+block-collection.n=2.c=block-out.mapping.output
--- a/tests/s-l+block-collection.n=2.c=block-out.mapping.output
+++ b/tests/s-l+block-collection.n=2.c=block-out.mapping.output
@@ -1,21 +1,42 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 M
+# B: 1, C: 1, L: 2, c: 0
 i   
+# B: 4, C: 4, L: 2, c: 3
 X
+# B: 4, C: 4, L: 2, c: 3
 N
+# B: 4, C: 4, L: 2, c: 3
 S
+# B: 4, C: 4, L: 2, c: 3
 Ta
+# B: 5, C: 5, L: 2, c: 4
 s
+# B: 5, C: 5, L: 2, c: 4
 n
+# B: 5, C: 5, L: 2, c: 4
 I:
+# B: 6, C: 6, L: 2, c: 5
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 2, c: 5
 w 
+# B: 7, C: 7, L: 2, c: 6
 N
+# B: 7, C: 7, L: 2, c: 6
 S
+# B: 8, C: 8, L: 2, c: 7
 !Commit to 'node' was made outside it
+# B: 7, C: 7, L: 2, c: 6
 Tb
+# B: 8, C: 8, L: 2, c: 7
 s
+# B: 8, C: 8, L: 2, c: 7
 n
+# B: 8, C: 8, L: 2, c: 7
 b\x0a
+# B: 9, C: 9, L: 3, c: 0
 x
+# B: 9, C: 9, L: 3, c: 0
 m
diff --git a/tests/s-l+block-collection.n=2.c=block-out.sequence.output b/tests/s-l+block-collection.n=2.c=block-out.sequence.output
--- a/tests/s-l+block-collection.n=2.c=block-out.sequence.output
+++ b/tests/s-l+block-collection.n=2.c=block-out.sequence.output
@@ -1,14 +1,26 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 Q
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 I-
+# B: 4, C: 4, L: 2, c: 3
 !Commit to 'node' was made outside it
+# B: 4, C: 4, L: 2, c: 3
 w 
+# B: 5, C: 5, L: 2, c: 4
 N
+# B: 5, C: 5, L: 2, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 4
 Ta
+# B: 6, C: 6, L: 2, c: 5
 s
+# B: 6, C: 6, L: 2, c: 5
 n
+# B: 6, C: 6, L: 2, c: 5
 b\x0a
+# B: 7, C: 7, L: 3, c: 0
 q
diff --git a/tests/s-l+block-in-block.n=2.c=block-in.invalid.output b/tests/s-l+block-in-block.n=2.c=block-in.invalid.output
--- a/tests/s-l+block-in-block.n=2.c=block-in.invalid.output
+++ b/tests/s-l+block-in-block.n=2.c=block-in.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
-!$InputFile$: line 1: column 0: Unexpected '*'
+# B: 0, C: 0, L: 1, c: 0
+m
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '*'
diff --git a/tests/s-l+block-in-block.n=2.c=block-in.tagged.output b/tests/s-l+block-in-block.n=2.c=block-in.tagged.output
--- a/tests/s-l+block-in-block.n=2.c=block-in.tagged.output
+++ b/tests/s-l+block-in-block.n=2.c=block-in.tagged.output
@@ -1,19 +1,40 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 P
+# B: 1, C: 1, L: 1, c: 1
 G
+# B: 1, C: 1, L: 1, c: 1
 H
+# B: 1, C: 1, L: 1, c: 1
 I!
+# B: 2, C: 2, L: 1, c: 2
 h
+# B: 2, C: 2, L: 1, c: 2
 tt
+# B: 3, C: 3, L: 1, c: 3
 g
+# B: 3, C: 3, L: 1, c: 3
 p
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 I|
+# B: 5, C: 5, L: 1, c: 5
+!Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 i   
+# B: 9, C: 9, L: 2, c: 3
 Ta
+# B: 10, C: 10, L: 2, c: 4
 L\x0a
+# B: 11, C: 11, L: 3, c: 0
 s
+# B: 11, C: 11, L: 3, c: 0
 n
diff --git a/tests/s-l+block-in-block.n=2.c=block-in.untagged.output b/tests/s-l+block-in-block.n=2.c=block-in.untagged.output
--- a/tests/s-l+block-in-block.n=2.c=block-in.untagged.output
+++ b/tests/s-l+block-in-block.n=2.c=block-in.untagged.output
@@ -1,9 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 i   
+# B: 5, C: 5, L: 2, c: 3
 Ta
+# B: 6, C: 6, L: 2, c: 4
 L\x0a
+# B: 7, C: 7, L: 3, c: 0
 s
+# B: 7, C: 7, L: 3, c: 0
 n
diff --git a/tests/s-l+block-in-block.n=2.c=block-out.invalid.output b/tests/s-l+block-in-block.n=2.c=block-out.invalid.output
--- a/tests/s-l+block-in-block.n=2.c=block-out.invalid.output
+++ b/tests/s-l+block-in-block.n=2.c=block-out.invalid.output
@@ -1,3 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
-!$InputFile$: line 1: column 0: Unexpected '*'
+# B: 0, C: 0, L: 1, c: 0
+m
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '*'
diff --git a/tests/s-l+block-indented.n=2.c=block-in.in-line-map.output b/tests/s-l+block-indented.n=2.c=block-in.in-line-map.output
--- a/tests/s-l+block-indented.n=2.c=block-in.in-line-map.output
+++ b/tests/s-l+block-indented.n=2.c=block-in.in-line-map.output
@@ -1,36 +1,72 @@
+# B: 0, C: 0, L: 1, c: 0
 i 
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 M
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I:
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 x
+# B: 6, C: 6, L: 2, c: 0
 i    
+# B: 10, C: 10, L: 2, c: 4
 X
+# B: 10, C: 10, L: 2, c: 4
 N
+# B: 10, C: 10, L: 2, c: 4
 S
+# B: 10, C: 10, L: 2, c: 4
 Tc
+# B: 11, C: 11, L: 2, c: 5
 s
+# B: 11, C: 11, L: 2, c: 5
 n
+# B: 11, C: 11, L: 2, c: 5
 I:
+# B: 12, C: 12, L: 2, c: 6
 w 
+# B: 13, C: 13, L: 2, c: 7
 N
+# B: 13, C: 13, L: 2, c: 7
 S
+# B: 13, C: 13, L: 2, c: 7
 Td
+# B: 14, C: 14, L: 2, c: 8
 s
+# B: 14, C: 14, L: 2, c: 8
 n
+# B: 14, C: 14, L: 2, c: 8
 b\x0a
+# B: 15, C: 15, L: 3, c: 0
 x
+# B: 15, C: 15, L: 3, c: 0
 m
+# B: 15, C: 15, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-in.in-line-seq.output b/tests/s-l+block-indented.n=2.c=block-in.in-line-seq.output
--- a/tests/s-l+block-indented.n=2.c=block-in.in-line-seq.output
+++ b/tests/s-l+block-indented.n=2.c=block-in.in-line-seq.output
@@ -1,22 +1,44 @@
+# B: 0, C: 0, L: 1, c: 0
 i 
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 Q
+# B: 1, C: 1, L: 1, c: 1
 I-
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 Ta
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 i    
+# B: 9, C: 9, L: 2, c: 4
 I-
+# B: 10, C: 10, L: 2, c: 5
 w 
+# B: 11, C: 11, L: 2, c: 6
 N
+# B: 11, C: 11, L: 2, c: 6
 S
+# B: 11, C: 11, L: 2, c: 6
 Tb
+# B: 12, C: 12, L: 2, c: 7
 s
+# B: 12, C: 12, L: 2, c: 7
 n
+# B: 12, C: 12, L: 2, c: 7
 b\x0a
+# B: 13, C: 13, L: 3, c: 0
 q
+# B: 13, C: 13, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-in.invalid.output b/tests/s-l+block-indented.n=2.c=block-in.invalid.output
--- a/tests/s-l+block-indented.n=2.c=block-in.invalid.output
+++ b/tests/s-l+block-indented.n=2.c=block-in.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '-'
diff --git a/tests/s-l+block-indented.n=2.c=block-in.literal.output b/tests/s-l+block-indented.n=2.c=block-in.literal.output
--- a/tests/s-l+block-indented.n=2.c=block-in.literal.output
+++ b/tests/s-l+block-indented.n=2.c=block-in.literal.output
@@ -1,10 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 I|
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 i   
+# B: 6, C: 6, L: 2, c: 3
 Ta
+# B: 7, C: 7, L: 2, c: 4
 L\x0a
+# B: 8, C: 8, L: 3, c: 0
 s
+# B: 8, C: 8, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-in.sequence.output b/tests/s-l+block-indented.n=2.c=block-in.sequence.output
--- a/tests/s-l+block-indented.n=2.c=block-in.sequence.output
+++ b/tests/s-l+block-indented.n=2.c=block-in.sequence.output
@@ -1,16 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 Q
+# B: 1, C: 1, L: 2, c: 0
 i   
+# B: 4, C: 4, L: 2, c: 3
 I-
-!Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 4
 w 
+# B: 6, C: 6, L: 2, c: 5
 N
+# B: 6, C: 6, L: 2, c: 5
 S
-!Commit to 'node' was made outside it
+# B: 6, C: 6, L: 2, c: 5
 Ta
+# B: 7, C: 7, L: 2, c: 6
 s
+# B: 7, C: 7, L: 2, c: 6
 n
+# B: 7, C: 7, L: 2, c: 6
 b\x0a
+# B: 8, C: 8, L: 3, c: 0
 q
+# B: 8, C: 8, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-out.in-line-map.output b/tests/s-l+block-indented.n=2.c=block-out.in-line-map.output
--- a/tests/s-l+block-indented.n=2.c=block-out.in-line-map.output
+++ b/tests/s-l+block-indented.n=2.c=block-out.in-line-map.output
@@ -1,36 +1,72 @@
+# B: 0, C: 0, L: 1, c: 0
 i 
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 M
+# B: 1, C: 1, L: 1, c: 1
 X
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 S
+# B: 1, C: 1, L: 1, c: 1
 Ta
+# B: 2, C: 2, L: 1, c: 2
 s
+# B: 2, C: 2, L: 1, c: 2
 n
+# B: 2, C: 2, L: 1, c: 2
 I:
+# B: 3, C: 3, L: 1, c: 3
 w 
+# B: 4, C: 4, L: 1, c: 4
 N
+# B: 4, C: 4, L: 1, c: 4
 S
+# B: 4, C: 4, L: 1, c: 4
 Tb
+# B: 5, C: 5, L: 1, c: 5
 s
+# B: 5, C: 5, L: 1, c: 5
 n
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 x
+# B: 6, C: 6, L: 2, c: 0
 i    
+# B: 10, C: 10, L: 2, c: 4
 X
+# B: 10, C: 10, L: 2, c: 4
 N
+# B: 10, C: 10, L: 2, c: 4
 S
+# B: 10, C: 10, L: 2, c: 4
 Tc
+# B: 11, C: 11, L: 2, c: 5
 s
+# B: 11, C: 11, L: 2, c: 5
 n
+# B: 11, C: 11, L: 2, c: 5
 I:
+# B: 12, C: 12, L: 2, c: 6
 w 
+# B: 13, C: 13, L: 2, c: 7
 N
+# B: 13, C: 13, L: 2, c: 7
 S
+# B: 13, C: 13, L: 2, c: 7
 Td
+# B: 14, C: 14, L: 2, c: 8
 s
+# B: 14, C: 14, L: 2, c: 8
 n
+# B: 14, C: 14, L: 2, c: 8
 b\x0a
+# B: 15, C: 15, L: 3, c: 0
 x
+# B: 15, C: 15, L: 3, c: 0
 m
+# B: 15, C: 15, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-out.in-line-seq.output b/tests/s-l+block-indented.n=2.c=block-out.in-line-seq.output
--- a/tests/s-l+block-indented.n=2.c=block-out.in-line-seq.output
+++ b/tests/s-l+block-indented.n=2.c=block-out.in-line-seq.output
@@ -1,22 +1,44 @@
+# B: 0, C: 0, L: 1, c: 0
 i 
+# B: 1, C: 1, L: 1, c: 1
 N
+# B: 1, C: 1, L: 1, c: 1
 Q
+# B: 1, C: 1, L: 1, c: 1
 I-
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 Ta
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 i    
+# B: 9, C: 9, L: 2, c: 4
 I-
+# B: 10, C: 10, L: 2, c: 5
 w 
+# B: 11, C: 11, L: 2, c: 6
 N
+# B: 11, C: 11, L: 2, c: 6
 S
+# B: 11, C: 11, L: 2, c: 6
 Tb
+# B: 12, C: 12, L: 2, c: 7
 s
+# B: 12, C: 12, L: 2, c: 7
 n
+# B: 12, C: 12, L: 2, c: 7
 b\x0a
+# B: 13, C: 13, L: 3, c: 0
 q
+# B: 13, C: 13, L: 3, c: 0
 n
diff --git a/tests/s-l+block-indented.n=2.c=block-out.invalid.output b/tests/s-l+block-indented.n=2.c=block-out.invalid.output
--- a/tests/s-l+block-indented.n=2.c=block-out.invalid.output
+++ b/tests/s-l+block-indented.n=2.c=block-out.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 s
+# B: 0, C: 0, L: 1, c: 0
 n
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '-'
diff --git a/tests/s-l+block-indented.n=2.c=block-out.sequence.output b/tests/s-l+block-indented.n=2.c=block-out.sequence.output
--- a/tests/s-l+block-indented.n=2.c=block-out.sequence.output
+++ b/tests/s-l+block-indented.n=2.c=block-out.sequence.output
@@ -1,16 +1,28 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 Q
+# B: 1, C: 1, L: 2, c: 0
 i  
+# B: 3, C: 3, L: 2, c: 2
 I-
-!Commit to 'node' was made outside it
+# B: 4, C: 4, L: 2, c: 3
 w 
+# B: 5, C: 5, L: 2, c: 4
 N
+# B: 5, C: 5, L: 2, c: 4
 S
-!Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 4
 Ta
+# B: 6, C: 6, L: 2, c: 5
 s
+# B: 6, C: 6, L: 2, c: 5
 n
+# B: 6, C: 6, L: 2, c: 5
 b\x0a
+# B: 7, C: 7, L: 3, c: 0
 q
+# B: 7, C: 7, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-in.1.output b/tests/s-l+block-node.n=-1.c=block-in.1.output
--- a/tests/s-l+block-node.n=-1.c=block-in.1.output
+++ b/tests/s-l+block-node.n=-1.c=block-in.1.output
@@ -1,30 +1,60 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 I:
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 N
+# B: 6, C: 6, L: 1, c: 6
 S
+# B: 7, C: 7, L: 1, c: 7
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 1, c: 6
 Tc
+# B: 7, C: 7, L: 1, c: 7
 s
+# B: 7, C: 7, L: 1, c: 7
 n
+# B: 7, C: 7, L: 1, c: 7
 b\x0a
+# B: 8, C: 8, L: 2, c: 0
 x
+# B: 8, C: 8, L: 2, c: 0
 m
+# B: 8, C: 8, L: 2, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-in.2.output b/tests/s-l+block-node.n=-1.c=block-in.2.output
--- a/tests/s-l+block-node.n=-1.c=block-in.2.output
+++ b/tests/s-l+block-node.n=-1.c=block-in.2.output
@@ -1,30 +1,60 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 M
+# B: 3, C: 3, L: 2, c: 0
 X
+# B: 3, C: 3, L: 2, c: 0
 N
+# B: 3, C: 3, L: 2, c: 0
 S
+# B: 3, C: 3, L: 2, c: 0
 Tb
+# B: 4, C: 4, L: 2, c: 1
 s
+# B: 4, C: 4, L: 2, c: 1
 n
+# B: 4, C: 4, L: 2, c: 1
 I:
+# B: 5, C: 5, L: 2, c: 2
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 2
 w 
+# B: 6, C: 6, L: 2, c: 3
 N
+# B: 6, C: 6, L: 2, c: 3
 S
+# B: 7, C: 7, L: 2, c: 4
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 2, c: 3
 Tc
+# B: 7, C: 7, L: 2, c: 4
 s
+# B: 7, C: 7, L: 2, c: 4
 n
+# B: 7, C: 7, L: 2, c: 4
 b\x0a
+# B: 8, C: 8, L: 3, c: 0
 x
+# B: 8, C: 8, L: 3, c: 0
 m
+# B: 8, C: 8, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-in.3.output b/tests/s-l+block-node.n=-1.c=block-in.3.output
--- a/tests/s-l+block-node.n=-1.c=block-in.3.output
+++ b/tests/s-l+block-node.n=-1.c=block-in.3.output
@@ -1,39 +1,78 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 M
+# B: 3, C: 3, L: 2, c: 0
 X
+# B: 3, C: 3, L: 2, c: 0
 N
+# B: 3, C: 3, L: 2, c: 0
 P
+# B: 3, C: 3, L: 2, c: 0
 G
+# B: 3, C: 3, L: 2, c: 0
 H
+# B: 3, C: 3, L: 2, c: 0
 I!
+# B: 4, C: 4, L: 2, c: 1
 h
+# B: 4, C: 4, L: 2, c: 1
 tb
+# B: 5, C: 5, L: 2, c: 2
 g
+# B: 5, C: 5, L: 2, c: 2
 p
+# B: 5, C: 5, L: 2, c: 2
 w 
+# B: 6, C: 6, L: 2, c: 3
 S
+# B: 6, C: 6, L: 2, c: 3
 Tc
+# B: 7, C: 7, L: 2, c: 4
 s
+# B: 7, C: 7, L: 2, c: 4
 n
+# B: 7, C: 7, L: 2, c: 4
 I:
+# B: 8, C: 8, L: 2, c: 5
 !Commit to 'node' was made outside it
+# B: 8, C: 8, L: 2, c: 5
 w 
+# B: 9, C: 9, L: 2, c: 6
 N
+# B: 9, C: 9, L: 2, c: 6
 S
+# B: 10, C: 10, L: 2, c: 7
 !Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 6
 Td
+# B: 10, C: 10, L: 2, c: 7
 s
+# B: 10, C: 10, L: 2, c: 7
 n
+# B: 10, C: 10, L: 2, c: 7
 b\x0a
+# B: 11, C: 11, L: 3, c: 0
 x
+# B: 11, C: 11, L: 3, c: 0
 m
+# B: 11, C: 11, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-in.invalid.output b/tests/s-l+block-node.n=-1.c=block-in.invalid.output
--- a/tests/s-l+block-node.n=-1.c=block-in.invalid.output
+++ b/tests/s-l+block-node.n=-1.c=block-in.invalid.output
@@ -1,18 +1,52 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
-!$InputFile$: line 1: column 4: Expected start of line
+# B: 4, C: 4, L: 1, c: 4
+!Expected start of line
+# B: 4, C: 4, L: 1, c: 4
+-:
+# B: 5, C: 5, L: 1, c: 5
+-\x0a
+# B: 6, C: 6, L: 2, c: 0
+- 
+# B: 7, C: 7, L: 2, c: 1
+- c:
+# B: 10, C: 10, L: 2, c: 4
+-\x0a
+# B: 11, C: 11, L: 3, c: 0
+x
+# B: 11, C: 11, L: 3, c: 0
+m
+# B: 11, C: 11, L: 3, c: 0
+n
diff --git a/tests/s-l+block-node.n=-1.c=block-in.output b/tests/s-l+block-node.n=-1.c=block-in.output
--- a/tests/s-l+block-node.n=-1.c=block-in.output
+++ b/tests/s-l+block-node.n=-1.c=block-in.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/s-l+block-node.n=-1.c=block-out.1.output b/tests/s-l+block-node.n=-1.c=block-out.1.output
--- a/tests/s-l+block-node.n=-1.c=block-out.1.output
+++ b/tests/s-l+block-node.n=-1.c=block-out.1.output
@@ -1,30 +1,60 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
+# B: 4, C: 4, L: 1, c: 4
 I:
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 1, c: 5
 w 
+# B: 6, C: 6, L: 1, c: 6
 N
+# B: 6, C: 6, L: 1, c: 6
 S
+# B: 7, C: 7, L: 1, c: 7
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 1, c: 6
 Tc
+# B: 7, C: 7, L: 1, c: 7
 s
+# B: 7, C: 7, L: 1, c: 7
 n
+# B: 7, C: 7, L: 1, c: 7
 b\x0a
+# B: 8, C: 8, L: 2, c: 0
 x
+# B: 8, C: 8, L: 2, c: 0
 m
+# B: 8, C: 8, L: 2, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-out.2.output b/tests/s-l+block-node.n=-1.c=block-out.2.output
--- a/tests/s-l+block-node.n=-1.c=block-out.2.output
+++ b/tests/s-l+block-node.n=-1.c=block-out.2.output
@@ -1,30 +1,60 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 M
+# B: 3, C: 3, L: 2, c: 0
 X
+# B: 3, C: 3, L: 2, c: 0
 N
+# B: 3, C: 3, L: 2, c: 0
 S
+# B: 3, C: 3, L: 2, c: 0
 Tb
+# B: 4, C: 4, L: 2, c: 1
 s
+# B: 4, C: 4, L: 2, c: 1
 n
+# B: 4, C: 4, L: 2, c: 1
 I:
+# B: 5, C: 5, L: 2, c: 2
 !Commit to 'node' was made outside it
+# B: 5, C: 5, L: 2, c: 2
 w 
+# B: 6, C: 6, L: 2, c: 3
 N
+# B: 6, C: 6, L: 2, c: 3
 S
+# B: 7, C: 7, L: 2, c: 4
 !Commit to 'node' was made outside it
+# B: 6, C: 6, L: 2, c: 3
 Tc
+# B: 7, C: 7, L: 2, c: 4
 s
+# B: 7, C: 7, L: 2, c: 4
 n
+# B: 7, C: 7, L: 2, c: 4
 b\x0a
+# B: 8, C: 8, L: 3, c: 0
 x
+# B: 8, C: 8, L: 3, c: 0
 m
+# B: 8, C: 8, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-out.3.output b/tests/s-l+block-node.n=-1.c=block-out.3.output
--- a/tests/s-l+block-node.n=-1.c=block-out.3.output
+++ b/tests/s-l+block-node.n=-1.c=block-out.3.output
@@ -1,39 +1,78 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 ta
+# B: 2, C: 2, L: 1, c: 2
 g
+# B: 2, C: 2, L: 1, c: 2
 p
+# B: 2, C: 2, L: 1, c: 2
 b\x0a
+# B: 3, C: 3, L: 2, c: 0
 M
+# B: 3, C: 3, L: 2, c: 0
 X
+# B: 3, C: 3, L: 2, c: 0
 N
+# B: 3, C: 3, L: 2, c: 0
 P
+# B: 3, C: 3, L: 2, c: 0
 G
+# B: 3, C: 3, L: 2, c: 0
 H
+# B: 3, C: 3, L: 2, c: 0
 I!
+# B: 4, C: 4, L: 2, c: 1
 h
+# B: 4, C: 4, L: 2, c: 1
 tb
+# B: 5, C: 5, L: 2, c: 2
 g
+# B: 5, C: 5, L: 2, c: 2
 p
+# B: 5, C: 5, L: 2, c: 2
 w 
+# B: 6, C: 6, L: 2, c: 3
 S
+# B: 6, C: 6, L: 2, c: 3
 Tc
+# B: 7, C: 7, L: 2, c: 4
 s
+# B: 7, C: 7, L: 2, c: 4
 n
+# B: 7, C: 7, L: 2, c: 4
 I:
+# B: 8, C: 8, L: 2, c: 5
 !Commit to 'node' was made outside it
+# B: 8, C: 8, L: 2, c: 5
 w 
+# B: 9, C: 9, L: 2, c: 6
 N
+# B: 9, C: 9, L: 2, c: 6
 S
+# B: 10, C: 10, L: 2, c: 7
 !Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 6
 Td
+# B: 10, C: 10, L: 2, c: 7
 s
+# B: 10, C: 10, L: 2, c: 7
 n
+# B: 10, C: 10, L: 2, c: 7
 b\x0a
+# B: 11, C: 11, L: 3, c: 0
 x
+# B: 11, C: 11, L: 3, c: 0
 m
+# B: 11, C: 11, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=-1.c=block-out.invalid.output b/tests/s-l+block-node.n=-1.c=block-out.invalid.output
--- a/tests/s-l+block-node.n=-1.c=block-out.invalid.output
+++ b/tests/s-l+block-node.n=-1.c=block-out.invalid.output
@@ -1,18 +1,52 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 M
+# B: 0, C: 0, L: 1, c: 0
 X
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 I:
+# B: 2, C: 2, L: 1, c: 2
 !Commit to 'node' was made outside it
+# B: 2, C: 2, L: 1, c: 2
 w 
+# B: 3, C: 3, L: 1, c: 3
 N
+# B: 3, C: 3, L: 1, c: 3
 S
+# B: 4, C: 4, L: 1, c: 4
 !Commit to 'node' was made outside it
+# B: 3, C: 3, L: 1, c: 3
 Tb
+# B: 4, C: 4, L: 1, c: 4
 s
+# B: 4, C: 4, L: 1, c: 4
 n
-!$InputFile$: line 1: column 4: Expected start of line
+# B: 4, C: 4, L: 1, c: 4
+!Expected start of line
+# B: 4, C: 4, L: 1, c: 4
+-:
+# B: 5, C: 5, L: 1, c: 5
+-\x0a
+# B: 6, C: 6, L: 2, c: 0
+- 
+# B: 7, C: 7, L: 2, c: 1
+- c:
+# B: 10, C: 10, L: 2, c: 4
+-\x0a
+# B: 11, C: 11, L: 3, c: 0
+x
+# B: 11, C: 11, L: 3, c: 0
+m
+# B: 11, C: 11, L: 3, c: 0
+n
diff --git a/tests/s-l+block-node.n=-1.c=block-out.output b/tests/s-l+block-node.n=-1.c=block-out.output
--- a/tests/s-l+block-node.n=-1.c=block-out.output
+++ b/tests/s-l+block-node.n=-1.c=block-out.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/s-l+block-node.n=0.c=block-out.invalid.output b/tests/s-l+block-node.n=0.c=block-out.invalid.output
--- a/tests/s-l+block-node.n=0.c=block-out.invalid.output
+++ b/tests/s-l+block-node.n=0.c=block-out.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '\x0a'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x0a'
diff --git a/tests/s-l+block-node.n=2.c=block-in.block.output b/tests/s-l+block-node.n=2.c=block-in.block.output
--- a/tests/s-l+block-node.n=2.c=block-in.block.output
+++ b/tests/s-l+block-node.n=2.c=block-in.block.output
@@ -1,9 +1,20 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 0, C: 0, L: 1, c: 0
 I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
+# B: 2, C: 2, L: 2, c: 0
 i   
+# B: 5, C: 5, L: 2, c: 3
 Ta
+# B: 6, C: 6, L: 2, c: 4
 L\x0a
+# B: 7, C: 7, L: 3, c: 0
 s
+# B: 7, C: 7, L: 3, c: 0
 n
diff --git a/tests/s-l+block-node.n=2.c=block-in.flow.output b/tests/s-l+block-node.n=2.c=block-in.flow.output
--- a/tests/s-l+block-node.n=2.c=block-in.flow.output
+++ b/tests/s-l+block-node.n=2.c=block-in.flow.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/s-l+block-node.n=2.c=block-in.invalid.output b/tests/s-l+block-node.n=2.c=block-in.invalid.output
--- a/tests/s-l+block-node.n=2.c=block-in.invalid.output
+++ b/tests/s-l+block-node.n=2.c=block-in.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
-P
-A
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+S
+# B: 0, C: 0, L: 1, c: 0
+I|
+# B: 1, C: 1, L: 1, c: 1
+!Commit to 'node' was made outside it
+# B: 1, C: 1, L: 1, c: 1
+s
+# B: 1, C: 1, L: 1, c: 1
+n
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '!'
diff --git a/tests/s-l+block-node.n=2.c=block-out.flow.output b/tests/s-l+block-node.n=2.c=block-out.flow.output
--- a/tests/s-l+block-node.n=2.c=block-out.flow.output
+++ b/tests/s-l+block-node.n=2.c=block-out.flow.output
@@ -1,7 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 S
+# B: 1, C: 1, L: 1, c: 1
 !Commit to 'node' was made outside it
+# B: 0, C: 0, L: 1, c: 0
 Ta
+# B: 1, C: 1, L: 1, c: 1
 s
+# B: 1, C: 1, L: 1, c: 1
 n
+# B: 1, C: 1, L: 1, c: 1
 b\x0a
diff --git a/tests/s-l+block-scalar.n=2.c=block-in.folded.invalid.output b/tests/s-l+block-scalar.n=2.c=block-in.folded.invalid.output
--- a/tests/s-l+block-scalar.n=2.c=block-in.folded.invalid.output
+++ b/tests/s-l+block-scalar.n=2.c=block-in.folded.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '!'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '!'
diff --git a/tests/s-l+block-scalar.n=2.c=block-in.folded.output b/tests/s-l+block-scalar.n=2.c=block-in.folded.output
--- a/tests/s-l+block-scalar.n=2.c=block-in.folded.output
+++ b/tests/s-l+block-scalar.n=2.c=block-in.folded.output
@@ -1,17 +1,36 @@
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 G
+# B: 0, C: 0, L: 1, c: 0
 H
+# B: 0, C: 0, L: 1, c: 0
 I!
+# B: 1, C: 1, L: 1, c: 1
 h
+# B: 1, C: 1, L: 1, c: 1
 tfoo
+# B: 4, C: 4, L: 1, c: 4
 g
+# B: 4, C: 4, L: 1, c: 4
 p
+# B: 4, C: 4, L: 1, c: 4
 b\x0a
+# B: 5, C: 5, L: 2, c: 0
 i   
+# B: 8, C: 8, L: 2, c: 3
 S
+# B: 8, C: 8, L: 2, c: 3
 I>
+# B: 9, C: 9, L: 2, c: 4
+!Commit to 'node' was made outside it
+# B: 9, C: 9, L: 2, c: 4
 b\x0a
+# B: 10, C: 10, L: 3, c: 0
 i   
+# B: 13, C: 13, L: 3, c: 3
 Ta
+# B: 14, C: 14, L: 3, c: 4
 L\x0a
+# B: 15, C: 15, L: 4, c: 0
 s
diff --git a/tests/s-l+block-scalar.n=2.c=block-in.literal.invalid.output b/tests/s-l+block-scalar.n=2.c=block-in.literal.invalid.output
--- a/tests/s-l+block-scalar.n=2.c=block-in.literal.invalid.output
+++ b/tests/s-l+block-scalar.n=2.c=block-in.literal.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 S
-!$InputFile$: line 1: column 0: Unexpected '!'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '!'
diff --git a/tests/s-l+block-scalar.n=2.c=block-in.literal.output b/tests/s-l+block-scalar.n=2.c=block-in.literal.output
--- a/tests/s-l+block-scalar.n=2.c=block-in.literal.output
+++ b/tests/s-l+block-scalar.n=2.c=block-in.literal.output
@@ -1,18 +1,38 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
+# B: 1, C: 1, L: 1, c: 1
 P
+# B: 1, C: 1, L: 1, c: 1
 G
+# B: 1, C: 1, L: 1, c: 1
 H
+# B: 1, C: 1, L: 1, c: 1
 I!
+# B: 2, C: 2, L: 1, c: 2
 h
+# B: 2, C: 2, L: 1, c: 2
 tfoo
+# B: 5, C: 5, L: 1, c: 5
 g
+# B: 5, C: 5, L: 1, c: 5
 p
+# B: 5, C: 5, L: 1, c: 5
 b\x0a
+# B: 6, C: 6, L: 2, c: 0
 i   
+# B: 9, C: 9, L: 2, c: 3
 S
+# B: 9, C: 9, L: 2, c: 3
 I|
+# B: 10, C: 10, L: 2, c: 4
+!Commit to 'node' was made outside it
+# B: 10, C: 10, L: 2, c: 4
 b\x0a
+# B: 11, C: 11, L: 3, c: 0
 i   
+# B: 14, C: 14, L: 3, c: 3
 Ta
+# B: 15, C: 15, L: 3, c: 4
 L\x0a
+# B: 16, C: 16, L: 4, c: 0
 s
diff --git a/tests/s-l+flow-in-block.n=2.invalid.output b/tests/s-l+flow-in-block.n=2.invalid.output
--- a/tests/s-l+flow-in-block.n=2.invalid.output
+++ b/tests/s-l+flow-in-block.n=2.invalid.output
@@ -1,4 +1,14 @@
+# B: 0, C: 0, L: 1, c: 0
 N
+# B: 0, C: 0, L: 1, c: 0
 P
+# B: 0, C: 0, L: 1, c: 0
 A
-!$InputFile$: line 1: column 0: Unexpected '|'
+# B: 0, C: 0, L: 1, c: 0
+a
+# B: 0, C: 0, L: 1, c: 0
+p
+# B: 0, C: 0, L: 1, c: 0
+n
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '|'
diff --git a/tests/s-l+flow-in-block.n=2.output b/tests/s-l+flow-in-block.n=2.output
--- a/tests/s-l+flow-in-block.n=2.output
+++ b/tests/s-l+flow-in-block.n=2.output
@@ -1,19 +1,38 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 i   
+# B: 4, C: 4, L: 2, c: 3
 N
+# B: 4, C: 4, L: 2, c: 3
 P
+# B: 4, C: 4, L: 2, c: 3
 G
+# B: 4, C: 4, L: 2, c: 3
 H
+# B: 4, C: 4, L: 2, c: 3
 I!
+# B: 5, C: 5, L: 2, c: 4
 h
+# B: 5, C: 5, L: 2, c: 4
 ta
+# B: 6, C: 6, L: 2, c: 5
 g
+# B: 6, C: 6, L: 2, c: 5
 p
+# B: 6, C: 6, L: 2, c: 5
 b\x0a
+# B: 7, C: 7, L: 3, c: 0
 i   
+# B: 10, C: 10, L: 3, c: 3
 S
+# B: 11, C: 11, L: 3, c: 4
 !Commit to 'node' was made outside it
+# B: 10, C: 10, L: 3, c: 3
 Tb
+# B: 11, C: 11, L: 3, c: 4
 s
+# B: 11, C: 11, L: 3, c: 4
 n
+# B: 11, C: 11, L: 3, c: 4
 b\x0a
diff --git a/tests/s-l-comments.invalid.output b/tests/s-l-comments.invalid.output
--- a/tests/s-l-comments.invalid.output
+++ b/tests/s-l-comments.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-l-comments.lines.output b/tests/s-l-comments.lines.output
--- a/tests/s-l-comments.lines.output
+++ b/tests/s-l-comments.lines.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 C
+# B: 1, C: 1, L: 2, c: 0
 I#
+# B: 2, C: 2, L: 2, c: 1
 c
+# B: 2, C: 2, L: 2, c: 1
 b\x0a
+# B: 3, C: 3, L: 3, c: 0
 b\x0a
diff --git a/tests/s-l-comments.multi.output b/tests/s-l-comments.multi.output
--- a/tests/s-l-comments.multi.output
+++ b/tests/s-l-comments.multi.output
@@ -1,6 +1,12 @@
+# B: 0, C: 0, L: 1, c: 0
 b\x0a
+# B: 1, C: 1, L: 2, c: 0
 C
+# B: 1, C: 1, L: 2, c: 0
 I#
+# B: 2, C: 2, L: 2, c: 1
 c
+# B: 2, C: 2, L: 2, c: 1
 b\x0a
+# B: 3, C: 3, L: 3, c: 0
 b\x0a
diff --git a/tests/s-line-prefix.n=4.c=block-in.output b/tests/s-line-prefix.n=4.c=block-in.output
--- a/tests/s-line-prefix.n=4.c=block-in.output
+++ b/tests/s-line-prefix.n=4.c=block-in.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-line-prefix.n=4.c=block-out.invalid.output b/tests/s-line-prefix.n=4.c=block-out.invalid.output
--- a/tests/s-line-prefix.n=4.c=block-out.invalid.output
+++ b/tests/s-line-prefix.n=4.c=block-out.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
-!$InputFile$: line 1: column 4: Expected end of input
+# B: 4, C: 4, L: 1, c: 4
+!Unexpected ' '
diff --git a/tests/s-line-prefix.n=4.c=flow-in.output b/tests/s-line-prefix.n=4.c=flow-in.output
--- a/tests/s-line-prefix.n=4.c=flow-in.output
+++ b/tests/s-line-prefix.n=4.c=flow-in.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
diff --git a/tests/s-line-prefix.n=4.c=flow-out.output b/tests/s-line-prefix.n=4.c=flow-out.output
--- a/tests/s-line-prefix.n=4.c=flow-out.output
+++ b/tests/s-line-prefix.n=4.c=flow-out.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 4, C: 4, L: 1, c: 4
 w 
diff --git a/tests/s-nb-folded-text.n=4.invalid.output b/tests/s-nb-folded-text.n=4.invalid.output
--- a/tests/s-nb-folded-text.n=4.invalid.output
+++ b/tests/s-nb-folded-text.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 2: Unexpected 'a'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'a'
diff --git a/tests/s-nb-folded-text.n=4.output b/tests/s-nb-folded-text.n=4.output
--- a/tests/s-nb-folded-text.n=4.output
+++ b/tests/s-nb-folded-text.n=4.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'fold' was made outside it
-?a
+# B: 4, C: 4, L: 1, c: 4
+-a
diff --git a/tests/s-nb-spaced-text.n=4.invalid.output b/tests/s-nb-spaced-text.n=4.invalid.output
--- a/tests/s-nb-spaced-text.n=4.invalid.output
+++ b/tests/s-nb-spaced-text.n=4.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 2: Unexpected 'a'
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected 'a'
diff --git a/tests/s-nb-spaced-text.n=4.output b/tests/s-nb-spaced-text.n=4.output
--- a/tests/s-nb-spaced-text.n=4.output
+++ b/tests/s-nb-spaced-text.n=4.output
@@ -1,3 +1,6 @@
+# B: 0, C: 0, L: 1, c: 0
 i    
+# B: 5, C: 5, L: 1, c: 5
 !Commit to 'fold' was made outside it
-? a
+# B: 4, C: 4, L: 1, c: 4
+- a
diff --git a/tests/s-ns-double-next-line.n=4.input b/tests/s-ns-double-next-line.n=4.input
deleted file mode 100644
--- a/tests/s-ns-double-next-line.n=4.input
+++ /dev/null
@@ -1,2 +0,0 @@
-
-    	a b	c
diff --git a/tests/s-ns-double-next-line.n=4.invalid.input b/tests/s-ns-double-next-line.n=4.invalid.input
deleted file mode 100644
--- a/tests/s-ns-double-next-line.n=4.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/s-ns-double-next-line.n=4.invalid.output b/tests/s-ns-double-next-line.n=4.invalid.output
deleted file mode 100644
--- a/tests/s-ns-double-next-line.n=4.invalid.output
+++ /dev/null
@@ -1,2 +0,0 @@
-l\x0a
-!$InputFile$: line 2: column 0: Unexpected end of input
diff --git a/tests/s-ns-double-next-line.n=4.output b/tests/s-ns-double-next-line.n=4.output
deleted file mode 100644
--- a/tests/s-ns-double-next-line.n=4.output
+++ /dev/null
@@ -1,4 +0,0 @@
-l\x0a
-i    
-w\x09
-?a b\x09c
diff --git a/tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.output b/tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.output
--- a/tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.output
+++ b/tests/s-ns-plain-next-line.n=4.c=flow-in.invalid.output
@@ -1,5 +1,10 @@
+# B: 0, C: 0, L: 1, c: 0
 w  
+# B: 2, C: 2, L: 1, c: 2
 l\x0a
+# B: 3, C: 3, L: 2, c: 0
 i    
-?12
-!$InputFile$: line 2: column 6: Expected end of input
+# B: 7, C: 7, L: 2, c: 4
+-12
+# B: 9, C: 9, L: 2, c: 6
+!Unexpected ','
diff --git a/tests/s-ns-plain-next-line.n=4.c=flow-in.output b/tests/s-ns-plain-next-line.n=4.c=flow-in.output
--- a/tests/s-ns-plain-next-line.n=4.c=flow-in.output
+++ b/tests/s-ns-plain-next-line.n=4.c=flow-in.output
@@ -1,4 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
 l\x0a
+# B: 1, C: 1, L: 2, c: 0
 i    
+# B: 5, C: 5, L: 2, c: 4
 w  
-?a  b
+# B: 7, C: 7, L: 2, c: 6
+-a  b
diff --git a/tests/s-ns-single-next-line.n=4.input b/tests/s-ns-single-next-line.n=4.input
deleted file mode 100644
--- a/tests/s-ns-single-next-line.n=4.input
+++ /dev/null
@@ -1,2 +0,0 @@
-
-    	a b	c
diff --git a/tests/s-ns-single-next-line.n=4.invalid.input b/tests/s-ns-single-next-line.n=4.invalid.input
deleted file mode 100644
--- a/tests/s-ns-single-next-line.n=4.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-
diff --git a/tests/s-ns-single-next-line.n=4.invalid.output b/tests/s-ns-single-next-line.n=4.invalid.output
deleted file mode 100644
--- a/tests/s-ns-single-next-line.n=4.invalid.output
+++ /dev/null
@@ -1,2 +0,0 @@
-l\x0a
-!$InputFile$: line 2: column 0: Unexpected end of input
diff --git a/tests/s-ns-single-next-line.n=4.output b/tests/s-ns-single-next-line.n=4.output
deleted file mode 100644
--- a/tests/s-ns-single-next-line.n=4.output
+++ /dev/null
@@ -1,4 +0,0 @@
-l\x0a
-i    
-w\x09
-?a b\x09c
diff --git a/tests/s-s-double-break.n=4.escaped.input b/tests/s-s-double-break.n=4.escaped.input
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.escaped.input
+++ /dev/null
@@ -1,2 +0,0 @@
- \
-     
diff --git a/tests/s-s-double-break.n=4.escaped.output b/tests/s-s-double-break.n=4.escaped.output
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.escaped.output
+++ /dev/null
@@ -1,7 +0,0 @@
-? 
-E
-I\x5c
-b\x0a
-e
-i    
-w 
diff --git a/tests/s-s-double-break.n=4.folded.input b/tests/s-s-double-break.n=4.folded.input
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.folded.input
+++ /dev/null
@@ -1,3 +0,0 @@
- 
-
-     
diff --git a/tests/s-s-double-break.n=4.folded.output b/tests/s-s-double-break.n=4.folded.output
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.folded.output
+++ /dev/null
@@ -1,5 +0,0 @@
-w 
-b\x0a
-L\x0a
-i    
-w 
diff --git a/tests/s-s-double-break.n=4.invalid.input b/tests/s-s-double-break.n=4.invalid.input
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/s-s-double-break.n=4.invalid.output b/tests/s-s-double-break.n=4.invalid.output
deleted file mode 100644
--- a/tests/s-s-double-break.n=4.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
diff --git a/tests/s-s-double-escaped.n=2.input b/tests/s-s-double-escaped.n=2.input
deleted file mode 100644
--- a/tests/s-s-double-escaped.n=2.input
+++ /dev/null
@@ -1,3 +0,0 @@
- \
-
-   
diff --git a/tests/s-s-double-escaped.n=2.invalid.input b/tests/s-s-double-escaped.n=2.invalid.input
deleted file mode 100644
--- a/tests/s-s-double-escaped.n=2.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/s-s-double-escaped.n=2.invalid.output b/tests/s-s-double-escaped.n=2.invalid.output
deleted file mode 100644
--- a/tests/s-s-double-escaped.n=2.invalid.output
+++ /dev/null
@@ -1,2 +0,0 @@
-E
-!$InputFile$: line 1: column 0: Unexpected 'a'
diff --git a/tests/s-s-double-escaped.n=2.output b/tests/s-s-double-escaped.n=2.output
deleted file mode 100644
--- a/tests/s-s-double-escaped.n=2.output
+++ /dev/null
@@ -1,9 +0,0 @@
-? 
-E
-I\x5c
-!Commit to 'escape' was made outside it
-b\x0a
-e
-L\x0a
-i  
-w 
diff --git a/tests/s-s-flow-folded.n=2.input b/tests/s-s-flow-folded.n=2.input
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=2.input
+++ /dev/null
@@ -1,2 +0,0 @@
-  
-  	
diff --git a/tests/s-s-flow-folded.n=2.output b/tests/s-s-flow-folded.n=2.output
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=2.output
+++ /dev/null
@@ -1,4 +0,0 @@
-w  
-l\x0a
-i  
-w\x09
diff --git a/tests/s-s-flow-folded.n=4.invalid.input b/tests/s-s-flow-folded.n=4.invalid.input
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.invalid.input
+++ /dev/null
@@ -1,1 +0,0 @@
-a
diff --git a/tests/s-s-flow-folded.n=4.invalid.output b/tests/s-s-flow-folded.n=4.invalid.output
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.invalid.output
+++ /dev/null
@@ -1,1 +0,0 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
diff --git a/tests/s-s-flow-folded.n=4.lf.input b/tests/s-s-flow-folded.n=4.lf.input
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.lf.input
+++ /dev/null
@@ -1,2 +0,0 @@
-
-    	
diff --git a/tests/s-s-flow-folded.n=4.lf.output b/tests/s-s-flow-folded.n=4.lf.output
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.lf.output
+++ /dev/null
@@ -1,3 +0,0 @@
-l\x0a
-i    
-w\x09
diff --git a/tests/s-s-flow-folded.n=4.sp-lf-lf.input b/tests/s-s-flow-folded.n=4.sp-lf-lf.input
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.sp-lf-lf.input
+++ /dev/null
@@ -1,3 +0,0 @@
- 
-
-    	
diff --git a/tests/s-s-flow-folded.n=4.sp-lf-lf.output b/tests/s-s-flow-folded.n=4.sp-lf-lf.output
deleted file mode 100644
--- a/tests/s-s-flow-folded.n=4.sp-lf-lf.output
+++ /dev/null
@@ -1,5 +0,0 @@
-w 
-b\x0a
-L\x0a
-i    
-w\x09
diff --git a/tests/s-separate-in-line.invalid.output b/tests/s-separate-in-line.invalid.output
--- a/tests/s-separate-in-line.invalid.output
+++ b/tests/s-separate-in-line.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
-!$InputFile$: line 1: column 1: Expected end of input
+# B: 1, C: 1, L: 1, c: 1
+!Unexpected '#'
diff --git a/tests/s-separate-in-line.sp.output b/tests/s-separate-in-line.sp.output
--- a/tests/s-separate-in-line.sp.output
+++ b/tests/s-separate-in-line.sp.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
diff --git a/tests/s-separate-lines.n=4.invalid.output b/tests/s-separate-lines.n=4.invalid.output
--- a/tests/s-separate-lines.n=4.invalid.output
+++ b/tests/s-separate-lines.n=4.invalid.output
@@ -1,2 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
 w  
-!$InputFile$: line 1: column 2: Expected end of input
+# B: 2, C: 2, L: 1, c: 2
+!Unexpected '\x0a'
diff --git a/tests/s-separate-lines.n=4.lines.input b/tests/s-separate-lines.n=4.lines.input
deleted file mode 100644
--- a/tests/s-separate-lines.n=4.lines.input
+++ /dev/null
@@ -1,2 +0,0 @@
- #
-    	
diff --git a/tests/s-separate-lines.n=4.lines.output b/tests/s-separate-lines.n=4.lines.output
deleted file mode 100644
--- a/tests/s-separate-lines.n=4.lines.output
+++ /dev/null
@@ -1,7 +0,0 @@
-w 
-C
-I#
-c
-b\x0a
-i    
-w\x09
diff --git a/tests/s-separate-lines.n=4.sp.output b/tests/s-separate-lines.n=4.sp.output
--- a/tests/s-separate-lines.n=4.sp.output
+++ b/tests/s-separate-lines.n=4.sp.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
diff --git a/tests/s-separate.n=4.c=flow-key.invalid.output b/tests/s-separate.n=4.c=flow-key.invalid.output
--- a/tests/s-separate.n=4.c=flow-key.invalid.output
+++ b/tests/s-separate.n=4.c=flow-key.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Expected end of input
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x0a'
diff --git a/tests/s-separate.n=4.c=flow-key.sp.output b/tests/s-separate.n=4.c=flow-key.sp.output
--- a/tests/s-separate.n=4.c=flow-key.sp.output
+++ b/tests/s-separate.n=4.c=flow-key.sp.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
diff --git a/tests/s-separate.n=4.c=flow-out.line.input b/tests/s-separate.n=4.c=flow-out.line.input
deleted file mode 100644
--- a/tests/s-separate.n=4.c=flow-out.line.input
+++ /dev/null
@@ -1,2 +0,0 @@
-
-    
diff --git a/tests/s-separate.n=4.c=flow-out.line.output b/tests/s-separate.n=4.c=flow-out.line.output
deleted file mode 100644
--- a/tests/s-separate.n=4.c=flow-out.line.output
+++ /dev/null
@@ -1,2 +0,0 @@
-b\x0a
-i    
diff --git a/tests/s-separate.n=4.c=flow-out.sp.output b/tests/s-separate.n=4.c=flow-out.sp.output
--- a/tests/s-separate.n=4.c=flow-out.sp.output
+++ b/tests/s-separate.n=4.c=flow-out.sp.output
@@ -1,1 +1,2 @@
+# B: 0, C: 0, L: 1, c: 0
 w 
diff --git a/tests/s-single-next-line.n=4.input b/tests/s-single-next-line.n=4.input
new file mode 100644
--- /dev/null
+++ b/tests/s-single-next-line.n=4.input
@@ -0,0 +1,2 @@
+
+    	a b	c
diff --git a/tests/s-single-next-line.n=4.invalid.input b/tests/s-single-next-line.n=4.invalid.input
new file mode 100644
--- /dev/null
+++ b/tests/s-single-next-line.n=4.invalid.input
@@ -0,0 +1,1 @@
+
diff --git a/tests/s-single-next-line.n=4.invalid.output b/tests/s-single-next-line.n=4.invalid.output
new file mode 100644
--- /dev/null
+++ b/tests/s-single-next-line.n=4.invalid.output
@@ -0,0 +1,4 @@
+# B: 0, C: 0, L: 1, c: 0
+l\x0a
+# B: 1, C: 1, L: 2, c: 0
+!Unexpected end of input
diff --git a/tests/s-single-next-line.n=4.output b/tests/s-single-next-line.n=4.output
new file mode 100644
--- /dev/null
+++ b/tests/s-single-next-line.n=4.output
@@ -0,0 +1,8 @@
+# B: 0, C: 0, L: 1, c: 0
+l\x0a
+# B: 1, C: 1, L: 2, c: 0
+i    
+# B: 5, C: 5, L: 2, c: 4
+w\x09
+# B: 6, C: 6, L: 2, c: 5
+-a b\x09c
diff --git a/tests/s-space.invalid.output b/tests/s-space.invalid.output
--- a/tests/s-space.invalid.output
+++ b/tests/s-space.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected '\x09'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected '\x09'
diff --git a/tests/s-space.output b/tests/s-space.output
--- a/tests/s-space.output
+++ b/tests/s-space.output
@@ -1,1 +1,2 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
diff --git a/tests/s-tab.invalid.output b/tests/s-tab.invalid.output
--- a/tests/s-tab.invalid.output
+++ b/tests/s-tab.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected ' '
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected ' '
diff --git a/tests/s-tab.output b/tests/s-tab.output
--- a/tests/s-tab.output
+++ b/tests/s-tab.output
@@ -1,1 +1,2 @@
-?\x09
+# B: 0, C: 0, L: 1, c: 0
+-\x09
diff --git a/tests/s-white.invalid.output b/tests/s-white.invalid.output
--- a/tests/s-white.invalid.output
+++ b/tests/s-white.invalid.output
@@ -1,1 +1,2 @@
-!$InputFile$: line 1: column 0: Unexpected 'a'
+# B: 0, C: 0, L: 1, c: 0
+!Unexpected 'a'
diff --git a/tests/s-white.sp.output b/tests/s-white.sp.output
--- a/tests/s-white.sp.output
+++ b/tests/s-white.sp.output
@@ -1,1 +1,2 @@
-? 
+# B: 0, C: 0, L: 1, c: 0
+- 
diff --git a/tests/s-white.tab.output b/tests/s-white.tab.output
--- a/tests/s-white.tab.output
+++ b/tests/s-white.tab.output
@@ -1,1 +1,2 @@
-?\x09
+# B: 0, C: 0, L: 1, c: 0
+-\x09
diff --git a/yaml2yeast/Main.hs b/yaml2yeast/Main.hs
--- a/yaml2yeast/Main.hs
+++ b/yaml2yeast/Main.hs
@@ -11,7 +11,7 @@
 -- Convert an input YAML file to a YEAST (YAML Elaborate Atomic Syntax Tokens).
 -- Command line options are:
 --
---  [@-h@ @-?@ @--help@] Prints short usage message
+--  [@-h@ @--help@] Prints short usage message
 --
 --  [@-o@ @--output@ @file@] Specify output file (default is \"@-@\" for
 --  stdout)
@@ -25,8 +25,6 @@
 --
 --  [@-c@ @--c-value@ @c@] Specify the /c/ parameter of the production.
 --
---  [@-s@ @--s-value@ @s@] Specify the /s/ parameter of the production.
---
 --  [@-t@ @--t-value@ @t@] Specify the /t/ parameter of the production.
 --
 --  [@input@] Specify the input file (default is \"@-@\" for stdin).
@@ -54,8 +52,6 @@
 --
 --  [@t@] Contains non-content (meta) text characters
 --
---  [@B@] Contains preserved content line break
---
 --  [@b@] Contains separation line break
 --
 --  [@L@] Contains line break normalized to content line feed
@@ -68,7 +64,7 @@
 --
 --  [@i@] Contains indentation spaces
 --
---  [@K@] Document start marker
+--  [@K@] Directives end marker
 --
 --  [@k@] Document end marker
 --
@@ -128,20 +124,14 @@
 --
 --  [@o@] Ends document
 --
---  [@Y@] Begins YAML stream
---
---  [@y@] Ends YAML stream
---
 --  [@!@] Parsing error at this point.
 --
 --  [@-@] Unparsed text following error point.
 --
--- In addition, the following codes are used for testing partial productions
+-- In addition, the following code is used for testing partial productions
 -- and do not appear when parsing a complete YAML stream:
 --
---  [@?@] Contains test characters otherwise unassigned
---
---  [@\/@] Value of detected parameters
+--  [@$@] Value of detected parameters
 --
 -------------------------------------------------------------------------------
 module Main (main) where
@@ -204,7 +194,7 @@
 
 -- | @usage@ returns the usage string for the program.
 usage :: String
-usage = usageInfo "yamlSyntax: [options] [file]" optionDescriptions
+usage = usageInfo "yaml2yeast: [options] [file]" optionDescriptions
 
 -- | @collectFlags args@ converts the command line /args/ to list of 'Flag'.
 collectFlags :: [String] -> IO [Flag]
diff --git a/yeast2html b/yeast2html
--- a/yeast2html
+++ b/yeast2html
@@ -12,14 +12,13 @@
     U   => { code => 'U', type => 'bom',   title => "Byte order mark" },
     T   => { code => 'T', type => 'text',  title => "Content text" },
     t   => { code => 't', type => 'text',  title => "Non-content text" },
-    B   => { code => 'B', type => 'line',  title => "Content line break" },
-    b   => { code => 'b', type => 'line',  title => "Non-content line break" },
-    L   => { code => 'L', type => 'line',  title => "Line break normalized to line feed" },
-    l   => { code => 'l', type => 'line',  title => "Line break folded to space" },
+    b   => { code => 'b', type => 'text',  title => "Non-content line break" },
+    L   => { code => 'L', type => 'text',  title => "Line break normalized to line feed" },
+    l   => { code => 'l', type => 'text',  title => "Line break folded to space" },
     I   => { code => 'I', type => 'text',  title => "Indicator character" },
     w   => { code => 'w', type => 'text',  title => "Non-content white space" },
     i   => { code => 'i', type => 'text',  title => "Indentation white space" },
-    K   => { code => 'K', type => 'text',  title => "Document start marker" },
+    K   => { code => 'K', type => 'text',  title => "Directives end marker" },
     k   => { code => 'k', type => 'text',  title => "Document end marker" },
     E   => { code => 'E', type => 'begin', title => "Escape sequence" },
     e   => { code => 'e', type => 'end',   title => "Escape sequence" },
@@ -49,10 +48,9 @@
     x   => { code => 'x', type => 'end',   title => "Key:value pair" },
     O   => { code => 'O', type => 'begin', title => "Document" },
     o   => { code => 'o', type => 'end',   title => "Document" },
-    Y   => { code => 'Y', type => 'begin', title => "Stream" },
-    y   => { code => 'y', type => 'end',   title => "Stream" },
     '!' => { code => '!', type => 'error', title => "Error" },
     '-' => { code => '-', type => 'text',  title => "Unparsed" },
+    '$' => { code => '-', type => 'text',  title => "Detected" },
     '~' => { code => '~', type => 'text',  title => "Empty" }
 };
 
@@ -108,6 +106,7 @@
             unless $line =~ /^(.)(.*)$/;
         my $code = $1;
         my $text = $2;
+        next if $code eq '#';
         my $class = $code2class->{$code};
         die("Line $num contains unknown code \"$code\"\n")
             unless $class;
@@ -402,7 +401,7 @@
         } else {
             print $output "$text</span>";
         }
-        $pending_break = $class->{type} eq 'line';
+        $pending_break = $text =~ /&crarr;|&darr;/;
     }
     print $output "\n</div>\n";
 }
@@ -474,7 +473,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (c) 2007, Oren Ben-Kiki
+Copyright (c) 2007, 2008, 2009 Oren Ben-Kiki
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU Lesser General Public License as published by the Free
