Block

CLASS

class Config::BINDish::AST::Block - representation of a configuration block

DESCRIPTION

Is Config::BINDish::AST::Node.

Does Config::BINDish::AST::Blockish.

ATTRIBUTES

Bool:D $.flat

A flat block doesn't allow multiple children of the same kind. In other words, for a flat block it is guaranteed that for the same named and classified blocks, or same options, there will always be only one child under the block's AST node.

For example:

foo "bar" { # A flat block
        opt1 "1";
        opt1 2; # This will override the above
        subblock "baz" {
            opt2 "first";
        }
        subblock "baz" {
            opt2 "second"; # :foo<bar> => :subblock<baz> => "opt2" will return "second"
        }
    }

The attribute is by default set either to the value in $*CFG-FLAT-BLOCKS or to False.

METHODS

keyword(Bool :$raw)

Returns value payload of a child marked with 'block-type' or 'keyword' label. Returns the AST node itself with `:raw` argument.

name(Bool :$raw)

Returns value payload of a child marked with 'block-name' label. Returns the AST node itself with `:raw` argument.

class(Bool :$raw)

Returns value payload of a child marked with 'block-class' label. Returns the AST node itself with `:raw` argument.

multi add(Config::BINDish::AST::Block:D $block)

Add $block as a child.

multi add(Config::BINDish::AST::Option $option)

Adds $option as a child.

flatten()

Returns a flattened copy of the block.

SEE ALSO

COPYRIGHT

(c) 2023, Vadim Belman <[email protected]>

LICENSE

Artistic License 2.0

See the LICENSE file in this distribution.

Config::BINDish v0.0.18

Extensible BIND9-like Configuration Files Support

Authors

  • Vadim Belman

License

Artistic-2.0

Dependencies

AttrX::Mooish:auth<zef:vrurg>:ver<1.0.0+>:api<1.0.*>IP::AddrTest::Async:auth<zef:vrurg>:ver<0.1.2+>

Test Dependencies

Provides

  • Config::BINDish
  • Config::BINDish::AST
  • Config::BINDish::Actions
  • Config::BINDish::Expandable
  • Config::BINDish::Grammar
  • Config::BINDish::INET
  • Config::BINDish::Ops
  • Config::BINDish::Test
  • Config::BINDish::X

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.