Strictness

CLASS

Config::BINDish::Grammar::Strictness - strict mode options

DESCRIPTION

This class defines what parts of the parser should operate in strict mode. See #ATTRIBUTES.

The most simple way to initialize an instance of this class is to coerce it from a Bool value:

Config::BINDish::Grammar::Strictness(True); # All strict

From the perspective of creating a new grammar it would be done as:

Config::BINDish::Grammar.parse(..., :strict);   # All strict
    Config::BINDish::Grammar.parse(..., :!strict);  # All non-strict

ATTRIBUTES

Bool:D $.syntax = False

When set the parser will require a semi-colon (;) after all statements. Otherwise semi-colon is optional after block's closing curly brace, and after an option if it is followed by a closing brace. The following example is ok when syntax is non-strict:

block {
        option "foo"
    }

Otherwise it has to be like this:

block {
        option "foo";
    };

Bool:D $.options = False

This attribute determines if all options have to be explicitly pre-declared.

See method declare-options in Config::BINDish::Grammar.

Bool:D $.blocks = False

This attribute determines if all block types have to be explicitly pre-declared.

See method declare-blocks in Config::BINDish::Grammar.

Bool:D $.warnings = True

If set the the grammar will issue warnings when it suspects a problem. For example, a warning will be printed if a hash is used to initialize grammar's %.options or %.blocks attributes:

Config::BINDish.new: options => { :op1<op> => { ... } };

Because by default Raku uses hashes with Str keys, :op1<op> will be coerced and instead a Pair, representing option op ID and keyword, the grammar will find a string "op1\top" which is an invalid keyword.

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.