Age | Commit message (Collapse) | Author | Files | Lines |
|
The :undef symbol was still leaking all over the place internally. This
caused type inference to sometimes end up with Runtime[ruby, Symbol]. By
using nil instead of :undef, everything can be much more
straightforward. Once the code removal for puppet 4 comes into play even
more oddities around how resource parameters are handled can be
performed.
|
|
For PUP-2857 :undef was changed from being a PNilType to a PRuntimeType.
This stopped the undef literal in the language from being able to be
assigned to Optional parameters. However, this only happened when the
undef was the default expression for the parameter.
|
|
snippets
In the puppet 4.0 parser, the file resource's mode property will be
required to be a string containing an octal (or symbolic) representation
of mode.
For consistency then, this commit changes all cases where mode was
specified as a Numeric to be a string containing an octal representation
of mode (always prefaced with a 0, again for clarity and consistency).
|
|
The comment had trailing whitespace and a comma. It makes more sense
without either.
|
|
This reverts the change in PUP-867 by (again) calling the same 3x logic
for looking up defaults. The implementation of PUP-867 also added tests,
and one of those are now changed to reflect the changed behavior.
|
|
This changes the following:
* Assignment has lower precedence than resource expressions
* Local defaults are supported in resource instantiation expressions
* A Resource body may have a new expression AttributesOperation that
must evaluate to a hash.
* Stricter validation of resource titles
* Changes to TreeModelDumper wrt how BlockExpression is rendered (to
improve debugging output). As a consequence many tests needed
adjustments.
* Tests that previously passed have been modified because of stricter
validation.
This also includes maintenance. Removing dead code/fixing stale comments
and documentation.
|
|
This makes an attempt to override a class parameter issue an
error from the runtime layer rather than expecting the underlying
3x implementation to do it when the left expression does not
result in a resource, or a resource that has 'class' as resource type.
|
|
The lookup of resource parameters via the type e.g. Notify[id][message]
performed the lookup in the calling scope, not the resource's closure
scope which resulted in parameter default values were being seen from
the perspective of the caller (they may be very different).
This corrects the lookup to use the resource's closure scope.
|
|
This renames the top most type in the type system to Any from
the name Object. This is done because the word Object carries
connotations of "Object Oriented Programming" that simply adds confusion
about how puppet works.
This commit is basically a rename refactoring.
|
|
Object is now the top class and so there is no need to use
Optional[Object] everywhere. This removes the type factory method
optional_object and replaces all occurrances with just object. It also
updates all of the uses of Optional[Object] to use just Object.
|
|
|
|
The previous implementation checked the argument types twice against the
signature. This reduces it to a single check. The error for a missing
argument is now caught in a place that used to be unreachable and so the
error has been converted into an issue, which also provides the
information about where the failure occurred.
|
|
This adds a check when the signature for a closure is being calculated
to catch invalid parameter specifications where required arguments are
placed after optional onces. Allowing that would mean that the argument
range information would be incorrect.
|
|
This updates Closure code to implement type checking for the parameter
values.
|
|
The work so far has not been able to deal with type checking lambdas.
This adds tests for the conditions that will need to be handled for
lambdas to properly type check their arguments. Currently none of these
new tests pass.
|
|
|
|
(PUP-121) remove relative name spacing
|
|
The attempt to make all catalogEntryTypes absolute did not
work out so great as the lower level APIs in 3x expect non :: prefixed
names to be absolute.
This changes the transformation made in the evaluator to always use
"relative" names.
|
|
When the 3x to 4x calls take place, resource references in the form
of a PCatalogEntryType are transformed to Puppet::Resource.
Depending on where these (reference) Puppet::Resource instances are
used they need to either be absolute, or not (yes, 3x is inconsistent).
Since future parser in 3.7 (and later 4.0) will not support dynamic
name scoping, the PCatalogEntryType's should in general be absolute.
This commit changes the transformation to make the created
Puppet::Resource (references) absolute (when it is possible).
This also adds more tests
|
|
* upstream/stable:
(maint) Remove failure for empty generated tags
(maint) Update test to use resource matcher
(maint) Add sitemoduledir to env env tests
(PUP-2689) Make AST Resource check tags against "inherited" tags
(maint) Remove unused Puppet::Parser::AST::Tag class
|
|
This overrides the tagged? method in AST Resource to also search
for tags in its containing resource. These tags will be set when
the resource is finalized (just before serialization on transformation
to external format).
If this is not done, resources will have a different tag set when
a search is made for the node itself (exported or virtual) vs. searching
external resources.
This also correct minor problems with passing an array (which could
result in an array being set as a tag).
It was also possible for empty tags to be set if a string tag contained
multiple :: in sequence, or if ending with ::. Now an error is raised
for these conditions (just like for empty segments generated by using a
sequence of commas (which was on a different code path).
|
|
WHen future parser is in effect, the lookup of default values
will now not look in "parent scopes" (i.e. scopes that *contain*
the resource). Instead it now only looks in inherited and enclosing
scopes + itself.
This removes the confusion that occurs when a class may be included
from different locations, and the location that wins manages to impose
the defaults from its scope.
This removal goes hand in hand with dynamic scoping being removed
everywhere else.
|
|
Using the have_resource matcher makes the tests a little shorter and
more expressive. It also uses the common way of matching so that we can
get better error reporting.
It turns out that one of the tests was matching against the incorrect
class name, so that is now fixed.
This also extracts a be_resource matcher so that you can match against
an individual resource independent of a catalog.
|
|
The tests used various ways to contruct the catalog. However, putting
together a catalog isn't always as simple as just calling compile.
compile_to_catalog puts all of the steps together in a way that is easy
to use in the tests.
|
|
When defaults were set using future evaluator and the resource has
a qualified name, the registration of the default was not recognized
because scope requires every segment of a qualified name to be upper
cased.
This adds upper casing of every segment. An integration test checks
that the capitalization works.
|
|
The problem was that nil was not transformed to undef for the result
of a parameter default expression and nil was interpreted as value
missing by the 3x class/define logic.
This adds a transformation in the PopsBridge by introducing a new kind
of bridging expression. Likewise, a transformation was needed back again
to nil as the value was set in TypeCalculator when performing an
inference and symbol :undef can not be used where a String is expected.
It was also observed in PUP-1964 that the error that surfaced lacked
location information. This was caused by the transformation of
unparenthesized call, where the transformed call expression did not
get location information set.
Tests added for the two different problems.
The factory method for recording position now also checks if the
end_locateable is void of location information (which can happen
in some transformations).
|
|
The last segment of a qualified variable name is allowed to start
with an underscore. Previously this was only allowed for a single
segment.
|
|
The vaidation was changed from a specific relationship validation
to using just R-Value check. This was a mistake since a
CollectExpression is a valid operand in a relationship even if not
producing an R-Value. Old version resurrected and streamlined to do
either R-Value check, or check that operand is a Collector.
|
|
|
|
4 tests were failing because Puppet[:hashed_node_data] was renamed
to Puppet[:trusted_node_data]. This commit changes the failing tests
to use the renamed setting.
|
|
(This was missing in an earlier commit)
|