_nt_comment_to_eol (Treetop::Compiler::Metagrammar)

    # File lib/treetop/compiler/metagrammar.rb, line 2995
          def _nt_comment_to_eol
            start_index = index
            if node_cache[:comment_to_eol].has_key?(index)
              cached = node_cache[:comment_to_eol][index]
              @index = cached.interval.end if cached
              return cached
            end

            i0, s0 = index, []
            if input.index('#', index) == index
              r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
              @index += 1
            else
              terminal_parse_failure('#')
              r1 = nil
            end
            s0 << r1
            if r1
              s2, i2 = [], index
              loop do
                i3, s3 = index, []
                i4 = index
                if input.index("\n", index) == index
                  r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
                  @index += 1
                else
                  terminal_parse_failure("\n")
                  r5 = nil
                end
                if r5
                  r4 = nil
                else
                  self.index = i4
                  r4 = instantiate_node(SyntaxNode,input, index...index)
                end
                s3 << r4
                if r4
                  if index < input_length
                    r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
                    @index += 1
                  else
                    terminal_parse_failure("any character")
                    r6 = nil
                  end
                  s3 << r6
                end
                if s3.last
                  r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
                  r3.extend(CommentToEol0)
                else
                  self.index = i3
                  r3 = nil
                end
                if r3
                  s2 << r3
                else
                  break
                end
              end
              r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
              s0 << r2
            end
            if s0.last
              r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
              r0.extend(CommentToEol1)
            else
              self.index = i0
              r0 = nil
            end

            node_cache[:comment_to_eol][start_index] = r0

            return r0
          end