(#16856) Add ability to specify type string for Hash with single argument.

This adds the ability to write 'Hash[T]' where 'T' is the type of the
element. Default 'Literal' is then used for key.
(#16856) Add ability to call lookup function with a lambda.

This adds the ability to call lookup with a lambda that gets the looked
up result for futher processing. The lambda gets undef when nothing was
found. This enables a convenient way to define a default when value is
missing.
(#16856) Make lookup return :undef if nothing is found.
Nil does not work when returned to puppet logic.
(#16856) Add support for multibinding multibinds.

There was a design flaw in the model that made it impossible to bind a
multibind in another. This prevented setting up complex structures
inside the data.

This fix makes any binding be a potential MultibindingContribution by
simply setting its multibind_id.
(#16856) Improve error reporting when something is wrong with an Issue

This helps to detect what is wrong with the issue. Before this it was
not possible to see which issue caused the exception and debugging was
always required. Now the output contain the issue code.
(#16856) Add version to binder_config.yaml

This also makes it possible to leave out sections of the hash to
get the default values.
(#16856) Correct API of BindingsFactory, add/correct yardoc.

Contains small API adjustments wrt. using varargs intead of requiring
that arguments were wrapped in an array.

Also adds ability to use a ruby lambda for producer transformer option.
(#16856) Refactor bindings scheme handlers, fix issues with type as hash key.

The scheme handler support is now done via injection. This is good
because it reuses existing functionality rather than providing yet
another way of loading user code. A special injector only used while
creating the real injector is created (called boot_injector).

The scheme handlers are now broken out into separate ruby files (they
were earlier in the BindingsComposer). The broken out handlers are now
lazily loaded by an injector.

A flaw was found in the type system; types where not usable as hash
keys. This commit also fixes this by adding hash and eql methods to
the types.
(#16856) Add extension capability to binder_config.yaml

This makes it possible to specify scheme_handlers and hiera_backends by
binding scheme/symbolic name to a runtime class name.

These are loaded by the injector when required.

Adds tests, and fixes issues.
(#16856) Fix test failing because lookup returns :undef instead of nil.
(#16856) Add setting binder_conf to control which binder configuration to load.

A setting of nil is the default which optionally loads
$confdir/binder_config.yaml, and a default internal config if this file
is missing. If set it must point to an existing file.
(yardoc) Correct and amend yardoc for the central clsses in binder.
(#16856) Improve formatting of error messages.

Also adds tests for some exceptional cases.
Adds ability to specify override and abstract in the BindingsFactory.
(#16856) Make a hiera.yaml in confdir be ignored if it not version 2.

The confdir-hiera scheme no has logic to skip a hiera-1 hiera.yaml
if it cannot be loaded.

This commit also fixes a problems with re-registration of injector
boot extensions. They were made in a static way causing the next
run to again register a duplicate set of bindings which caused a
conflicting bindings error. The boot bindings (for the request) should
not be system wide, and should therefore be associated with the
environment and overwritten on each request. The new mechanism changes
how the bindings from the binder_conf.yaml gets contributed to the boot
injector.
(#16856) Fix issue with failing integration tests (caching problems)

The problem was that the bindings system switched to the future
parser when evaluating puppet logic by modifying the Puppet[:parser]
setting back and forth. This caused the compiler to (somewhere) be made
aware of a change "in the environment" - this caused tests to fail as
the environment was cleared as a consequence.

The fix is a simple change, the ast_transformer now creates an
ArithmeticOperator2 instead of ArithmeticOperator. Only future parser
creates those instances. The ArithmeticOperator2 naturally allows
concatenation. With that change, all switching of Puppet[:parser] could
be removed.

This is a much better solution because the settings are kept unchanged.
(#16856) Make use of Puppet Binder optional (and thus also rgen)

The Puppet Binder a.k.a "Data-in-Modules" is based on Rgen, and is
required to be able to use the data-in-module/hiera2 features.

The setting :binder must be set to true, or :parser set to 'future' for
the bindings system, data-in-modules, and hiera2 to be in effect.

The bindings system is now "booted" by the compiler on demand if the
settings dictate this.

Implicit lookup of undefined class parameters will not use injector
unless active.

Explicit lookup using lookup will raise an error unless the bindings
system is active.

Tests toggle the activation
(#16856) Fix problem with YAML spec test on Ruby 1.8.7

In Ruby 1.8.7, the YAML implementation does odd things on syntax
errors in yaml source input (it is not reported and ends up being
interpted the wrong way). The test that checks for YAML syntax error is
now modified to handle RUBY 1.8.7 braindead YAML by checking for a
different issue code from the validator.
(#16856) Fix lookup of ::x in topscope when topscope is not fully evaluated

When the scope gets a request for e.g. ::fqdn it goes on a search along
the milky way galaxy to find the scope for the class named "" (which is
the special "top scope class"), as the compiler is evaluating
expressions before having evaluated all of the things that eventually
contributes variables to the top scope, it can not find the scope for
the class named "". The class "" still exists at this point, but there
is no maping from name "" to the scope (and it cannot be registered
until it is fully evaluated since the registration also means that the
class has been evaluated (CATCH-22).

To overcome the problem, scope now identifies the special corner case
of request is for ""::name, "" exists, but there is no scope for it, and
the request for ""::name was made to topscope, it is safe to then
perform the lookup as a local scope lookup.

At the same time this is fixed, there is a performance difference
between lookup of $::fqdn, and $fqdn and the defaults is changed to use
$fqdn.
(#16856) Make the lookup function raise appropriate error on inactive bindings

When bindings are not activated (with --binder, or --parser future), the
lookup function tried to use classes in the Pops name space and fails on
uninitialized constant.

This fix changes that to raise a more meaningful message.
(#16856) Improve comments, remove dead code, and increase readability

A series of small fixes to readability in comments and logic in
bindings_composer.