struct KYAML::ClassifiedComments

Overview

Comments classified at emit time, ready for the emitter to consult. Lookup tables are keyed by YAML::Nodes::Node object identity.

Defined in:

kyaml/classifier.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Struct

==(other : KYAML::Any) ==

Instance methods inherited from struct Value

==(other : KYAML::Any) ==

Instance methods inherited from class Object

to_kyaml(io : IO) : Nil
to_kyaml(builder : KYAML::Builder) : Nil
to_kyaml : String
to_kyaml

Constructor Detail

def self.new(header : Array(KYAML::Comment) = [] of KYAML::Comment, leading : Hash(YAML::Nodes::Node, Array(KYAML::Comment)) = {} of YAML::Nodes::Node => Array(KYAML::Comment), trailing : Hash(YAML::Nodes::Node, KYAML::Comment) = {} of YAML::Nodes::Node => KYAML::Comment, tail : Hash(YAML::Nodes::Node, Array(KYAML::Comment)) = {} of YAML::Nodes::Node => Array(KYAML::Comment), commented : Set(YAML::Nodes::Node) = Set(YAML::Nodes::Node).new) #

[View source]

Instance Method Detail

def commented : Set(YAML::Nodes::Node) #

[View source]
def header : Array(KYAML::Comment) #

headeris flat since a doc has at most one header position above its---`


[View source]
def leading : Hash(YAML::Nodes::Node, Array(KYAML::Comment)) #

leading is a list per node, since multiple comments can stack above a node


[View source]
def tail : Hash(YAML::Nodes::Node, Array(KYAML::Comment)) #

tail is a list per container node, holding comments after the last child


[View source]
def trailing : Hash(YAML::Nodes::Node, KYAML::Comment) #

trailing is a single comment per node, since there can only be one trailing comment per source line


[View source]