(#22363) Add tests for evaluation of types
(#22363) Make if, unless, case be rvalue producers

The evaluator already treated these statements as rvalue producers.
The change is a relaxation in the validator.
This also adds tests.

Also correct mistake of not checking in the validator 4.
(maint) Remove unused cruft from pops model

This removes unused code from the pops model and related factory
methods.
Also removes some stale comments and commented out code.
(#22363) Add top level Program model, and add pops AST bridge

This adds classes Puppet::Parser::AST::PopsBridge that bridges between
a top level Puppet::Pops::Model::Program and the 3x API as well
as a Puppet::Pops::Model::Expression.

These classes makes it possible to wire the model into the 3x compiler,
Resource and Type objects. The AST equivalent objects for host class,
node and definition are bypassed and these are instead handled by the
bridge.

The Puppet::Pops::Model::Program object is populated by the e_parser to
avoid having to scan for the definitions (these are now found as
references in the top level Program model that is returned by the parser
if the "program" contains any definitions, else just the body.

The Program class is transparent in all other respects (it does not have
a dump footprint, and when evaluated it just evauates its body.

The bridge classes are yet untested, but the regular tests should
pass as the new evaluator has not yet replaced the 3x evaluation.
(#22363) First wiring of new evaluator to parser factory

This is the initial work of wiring the new evaluator into the regular
puppet logic. This is achieved via a new E4ParserAdapter that is used
together with the AST::PopsBridge classes. The ParserFactory is modified
to instantiate the new E4ParserAdapter.

Since not everything is finished, there are many tests failing, but at
this point a command like puppet apply --parser future -e 'notice hi' is
parsed and evaluated using the new evaluator.
(#22363) Fix typos, missing methods

The new evaluator's lambda was missing parameter_count method.
All validation of classes failed due to Program not recognized as
top level.
(#22363) Add evaluation of Resource Expression

This adds support for evaluation of resource expressions.
The TypeCalculator can now infer a Resource type from a PuppetResource.
The evaluator can create new resource instances.

Most parser tests are now passing (but a rebase is required since
grammar is at par with head, but not the tests).
(#22363) Fix issues relating to handling of undef and "to_s"

This adds the polymorph string_ visitor to the evluator for the
purpose of producing the string when doing interpolation.
Previously this was simply done by doing .to_s on the object which
then produced the text 'under' for the symbol 'undef'.
(#22363) Add impl of evaluation of resource defaults and overrides

This adds implementation of resource defaults (i.e. Type {a => b}, and
resource overrides (i.e. Type[x,y,z] { a => b }).

Smoke tested via the command line and small manifests.
(#22363) Add lookup of resource parameter value

This makes it possible to get the value of a resource's parameter
(or its not yet set default or override value) by using syntax such as:

Notify[id][param]
(maint) Remove unused OptionalAttributeOperation

The expression OptionalAttributeOperation was thought as an
instruction that would treat an assignment of :undef as
antimatter vs. setting an explicit nil. This is not possible
when using the 3x Resource class, and no concrete syntax was
introduced.

This removes it from the model and the todo note to implement it
in the evaluator.
(maint) Clean up stale comments
(maint) Remove unused constructs and use faster polymorph calls

This removes the ability to pass a block to evaluate since this
was only used in one specific case, and there are many calls to
evaluate (removes one conditional in very hot execution path).

Adds caching to polymorph tables in compare operator
sub evaluator.
(maint) Remove support for hyphen in name in lexer2
(#22363) Add support for evaluation of CollectExpression.

This replaces the earlier attempt of improving the CollectExpression
evaluation with an extended set of operations. The 3x API proved to
be too complicated. Instead, the implementation now performs a
transformation to the 3x way of handling Collection and evaluates
the transformed logic.
(#22363) Make selector and case use same equality as for '==' operator

The is_match? used by selector and case used Ruby == for all
RHS matches except for regular expression. This is now changed to
use the Puppet '==' operator.

Also, in this commit is a change that checks that LHS result is
a String when the RHS is a regular expression - an issue is
raised otherwise (other than the earlier Ruby TypeError).

Tests added.
(#22363) Remove unused datatype_reference method in evaluator.

This method was unused - its intent was to create an RGen meta type
given a name - creation of types is deferred to a future version and
this method was just dead weight.
(maint) Remove stale TODO comments
(#22363) Remove the support for applying [] operation without arg(s).

The intent was to use an empty [] as a "default", but this was
a bad idea, it is just as easy (and clearer) to write just Array instead
of Array[] to mean an unspecified Array. All variants of apply of
[] to LHS now raise an error if arguments are empty.
(#22363) Refactor name of Puppet::Pops::Evaluator::Lambda to Closure

The new implementation is a Closure in that it has a reference to
the Evaluator and Scope where it was created.