module

Krikri::Lint::NodeUtil

Instance methods

column(node : YAML::Nodes::Node | Nil) : Int32
Source
each_entry(mapping : YAML::Nodes::Mapping, &)

Iterate a mapping's flat [k1, v1, k2, v2, ...] node list as pairs.

Source

Find a mapping entry by key name; yields the key and value nodes.

Source
line(node : YAML::Nodes::Node | Nil) : Int32

1-based line/column, falling back to 1 for nodes without position data (should not happen with YAML::Nodes.parse output).

Source
scalar?(node : YAML::Nodes::Node | Nil) : Bool
Source
scalar_value(node : YAML::Nodes::Node) : String | Nil
Source
walk(node : YAML::Nodes::Node, &) : Nil

Depth-first walk of every node in the tree (iterative; a recursive yield-based implementation hits Crystal's recursive block-inlining limit).

Source