summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2014-08-01(maint) Remove call to 'debugger'Henrik Lindberg1-1/+0
2014-08-01(PUP-2898) Make Resource Expr comply with spec (left QualifiedReference)Henrik Lindberg2-3/+7
The LHS (type name) of a Resource Expression is specified as QualifiedName or QualifiedReference (or to be a Resource[T]). The implementation did not work when given a QualifiedReference (runtime error, due to errors in the error checking). This both fixes the runtime error, and makes a string that complies with QualifiedReference work. (An actual QualifiedReference evaluates to Resource[T], so that already worked). This also removes a call to debugger in relationship operator (that would be triggered if user tried to create a resource from a non CatalogEntry type).
2014-08-01(maint) Make logic around "missing file" clearerHenrik Lindberg1-5/+13
2014-08-01(maint) Cleanup assignment inside conditional - not neededHenrik Lindberg1-1/+2
2014-08-01(maint) Add private/public to @api tags where this were missingHenrik Lindberg1-4/+4
2014-08-01(PUP-2898) Add 4x style resource expressionsHenrik Lindberg11-1815/+1780
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.
2014-08-01(maint) Add assertions to type factory creation of ResourceHenrik Lindberg1-1/+8
This asserts that the given type name conforms to the name rule as we want to avoid having instances of PResourceType that are not correct.
2014-08-01(maint) Add token name to Token debug stringHenrik Lindberg1-1/+1
This adds the token name to the debug string. It used to only contain the token text which is not enough since there are several tokens tht have the same text.
2014-08-01(maint) Output extra info for debugging parser and cleanupHenrik Lindberg1-48/+14
This adds output of the token number when an error occurs (it otherwise only outputs the text representation, and there are several tokens where the text is the same). This only matters when debugging a grammar and this behavior is used when @yydebug manually has been set to true. This commit also cleans up dead comments and removes unused code.
2014-08-01(maint) Remove stale comments about hyphens in name patterns.Henrik Lindberg1-2/+0
2014-08-01(maint) Add a --dump action to the parser faceHenrik Lindberg1-0/+73
This adds the --dump action to the parser face which performs a tree dump of the produced AST model using the future parser. The command accepts an additional --[no]-validate option to turn off validation (the default validates). Without validation only syntax errors terminate the dump. The -e option (chosen to mimic -e to apply) accepts the source on the command line. Alternatively the source can be fed to stdin, or given as a series of files (without -e option) This command is useful because it is otherwise required to instrument the code to get a dump of the result when working on parser related bugs.
2014-08-01(PUP-2898) Drop support for AST Transform of ResourcesHenrik Lindberg1-24/+4
The implementation no longer needs to transform resource expressions to 3x AST. This changes the transformer to raise an error if attempted. The spec test for resource transformation is also dropped. No new test added that transformer raises exceptions for resource transformation since all transformation eventually will be dropped.
2014-08-01(maint) Add to_s methods to Token and Factory to get sane parser debugHenrik Lindberg2-0/+10
This adds methods to Factory and Lexer2::Token that produce output suitable for output from a parser in debug mode. The reason for this change is that default inspect output was produced and this created very poor signal to noise ratio in the debug output.
2014-08-01(maint) Add entry to makefile to generat a debug version of the parser.Henrik Lindberg1-0/+4
The parser generated by using make egrammar.debug should NOT be checked in, as it is slower and produces lots of output at the end.
2014-07-31Merge pull request #2930 from highb/fix/master/pup-2912-windows-spec-testsAnderson Mills2-2/+4
(PUP-2912) Puppet FS symlinks in build/unpack
2014-07-31(PUP-2912) Puppet FS symlinks in build/unpackBrandon High2-2/+4
Prior to this commit build/unpack were trying to use the Ruby stdlib symlink to deal with symlinks. This fails on platforms (Windows) that Puppet says supports symlinks because it does not duck punch Ruby stdlib. This commit switches the specs and code for build/unpack to use Puppet FS lib's symlink functions. This should allow it to function correctly on Windows hosts that Puppet supports symlinks.
2014-07-31Merge remote-tracking branch 'upstream/stable'Andrew Parker1-1/+1
* upstream/stable: (PUP-2991) Restore ability to manage shells on solaris
2014-07-31Merge pull request #2867 from hlindberg/PUP-2860_optimizations-and-maintenanceAndrew Parker27-2151/+1559
(PUP-2860) optimizations and maintenance
2014-07-31(PUP-2991) Restore ability to manage shells on solarisKylo Ginsberg1-1/+1
Background: for PUP-1448 commit 73b0c2b0 added a new feature for user providers `manage_shells`. The intent of that commit was to add this feature to all existing user providers which had that feature, and several were covered, but Solaris was missed. This commit simply adds the `manage_shells` feature to the Solaris user provider, following up on the intent in PUP-1448.
2014-07-31(PUP-877) Deprecate masterlog settingCharlie Sharpsteen1-1/+4
The `masterlog` setting is dead code, not used anywhere and has been removed in Puppet 4.
2014-07-31(perf) Make small optimization to lexer by avoiding extra arrayHenrik Lindberg1-1/+2
This removes the extra array being created for every token returned from the lexer - the token is already an array with the correct content.
2014-07-31(maint) Fix regression - negative string length came back after merge.Henrik Lindberg1-1/+1
This was a manual merge mistake.
2014-07-30Merge pull request #2854 from highb/fix/master/pup-2912_build_no_symlinksAnderson Mills2-0/+27
(PUP-2912) PMT Build symlink exception
2014-07-30(PUP-2745) Ignore malformed forge dependenciesBrandon High3-27/+24
Prior to this commit a malformed name in the dependencies for a downloaded forge module dependency would cause the PMT to fail unexpectedly. This commit causes the PMT to ignore malformed dependencies.
2014-07-30(PUP-2952) Puppet should only log facts in debug modeWilliam Van Hevelingen1-3/+4
In environments with lots of facts puppet agent can fill the screen and log files with loading fact messages. This is only useful when debugging and should thus be only enabled when in debug mode.
2014-07-29Merge pull request #2880 from ↵Adrien Thebo4-3/+15
fiddyspence/feature/2945/warning_on_windows_package_source (PUP-398) Windows package provider source munging and test
2014-07-29(PUP-398) Munge package source on Windowsfiddyspence4-3/+15
Adding munge and slashreplace method to windows package provider to ensure successful installation of packages. Validation in the type validate() not possible because we haven't chosen a provider at that point. Outputs debug as a means of notifying the user that the source has been changed.
2014-07-28Merge pull request #2918 from ↵Peter Huene1-3/+24
adrienthebo/fixup/master/pup-2871-install-uninstall-options-pacman Fixup/master/pup 2871 install uninstall options pacman
2014-07-28(PUP-2901) Add module dependency validationBrandon High4-4/+69
Prior to this commit there wasn't much verification for module dependencies. This commit adds verification the module dependencies have sane names and version ranges. If verification fails, it will raise an argument exception.
2014-07-28(PE-2912) Error on symlink in module installBrandon High1-0/+13
Prior to this commit when encountering a symlink in a module file during install, the install would error out with No such file or directory - /path/to/symlink. This is confusing and doesn't show what the problem actually is. This commit modifies the installer behavior to check for any symlinks after the module is extracted, give errors for each symlink it finds, and die. This will hopefully help module authors track down the actual reason for the failed install more easily.
2014-07-28(PUP-2912) PMT Build symlink exceptionBrandon High1-0/+14
Prior to this commit the build command would add symlinks to packages. This can cause unexpected behavior when installed on a system. This commit causes the build command to throw an error when it finds a symlink. That should prevent new modules from being created with a symlink included.
2014-07-28(maint) Make pacman (un)install_options privateAdrien Thebo1-8/+10
These methods should not be called by any outside class; this commit makes them private and removes the tests that invoke them directly.
2014-07-28(PUP-2871) Concatenate uninstall_options to argvAdrien Thebo1-1/+1
In the same manner as 9137faf uninstall_options were being appended as a nested array value; this commit changes the uninstall method to concatentate options to the array.
2014-07-28(PUP-2871) Concatenate install install_options to argvAdrien Thebo1-2/+2
Before this commit, install_options were passed as a nested array to pacman/yaourt. This commit changes that to concatentate the values with the argument vector.
2014-07-27(PUP-2860) Fix comments as pointed out in reviewHenrik Lindberg6-75/+21
Fix files with same comment after splitting models. The implementation now points out that it uses the meta part and mixes in the implementation. The possible optimization logged in a ticket, and ticket is instead referenced in the comments. Manual inlining of accessor commented to avoid it being DRYed out.
2014-07-27(perf) Use faster polymorph lookup in bindings checkerHenrik Lindberg1-1/+1
2014-07-27(maint) Remove extra abstraction PAbstractType - change to PAnyTypeHenrik Lindberg14-37/+28
Since all types now are PAnyType, there is no need to have an extra abstratin called PAbstractType, it just adds level in the ancestor hierarchy that needs to be consulted for methods, one extra step to go when checking is_a? against PAbstractType instead of PAnyType, etc.
2014-07-27(perf) freeze all string tokens at the source (in the lexer)Henrik Lindberg1-8/+8
This freezes all strings that are returned as tokens (varname, sq and dq string, name, classref). Keywords were already frozen. This optimizations means that these strings does not have to be frozen later, and the values are faster to use as hash lookup without incurring the penalty of again freezing (~10us per freeze call). + it is a sane thing to do anyway to avoid someone modifying the strings.
2014-07-27(PUP-2860) Remove future parser's old lexerHenrik Lindberg2-754/+0
The old (intermediate) lexer was still hanging around even if it was not being used. Cycles were also wasted on unit testing it. The new lexer "Lexer2" has been in use for quite some time and the old lexer is not useful even as a reference at this point. This speeds up both loading and unit testing.
2014-07-27(perf) Make small adjustments to TypeCalculatorHenrik Lindberg1-13/+15
Most of the changes are to call assignable_PIntegerType directly when it is known that both sides are PIntegerType instead of calling the polymorphic dispatch.
2014-07-27(perf) Make small perf adjustments to TypeFactoryHenrik Lindberg1-5/+7
It is faster to compare :symbol == x than the other way around when the x can be something other than a symbol (nil, string, integer) etc.
2014-07-27(maint) Remove the unused class Visitor::Visitor2Henrik Lindberg1-103/+0
The Visitor2 class had an alternative method for making polymorphic dispatch based on fact that calling a bound method is faster than a send. The gain is however lost since bound methods are instance specific and it is thus not possible to cache across all instances. Using the Visitor2 also requires one extra step of setup. Now that we have benchmarks, there was no improvement when using Visitor2 over the regular Visitor, in fact there was a tendency for Visitor2 to be slower (by ~1% in a couple of the runs). This was expected, as polymorphic dispatching did not show up on the hot list.
2014-07-27(perf) Make a series of small nips and tucks wrt performanceHenrik Lindberg3-27/+34
This makes a series of small changes in the evaluator logic. replacing use of literal strings with frozen constants, choosing a faster way to produce a string, to do a join etc. Some of the optimizations also produce less garbage, but this is very difficult to measure. Do not expect better micro benchmark results from these changes.
2014-07-27(PUP-2860) Remove repeated assert_rgen from other sources.Henrik Lindberg1-11/+10
The assert_rgen_installed() method is called from multiple sources, and it did not check if an assert had already been made. This logic was in the methods that called assert_rgen_installed(). This change moves the check if already asserted into the method itself. This reduces the number of calls to require rgen, and the number of rgen version compliance checks to 1.
2014-07-27(PUP-2860) Make injector transform using faster visitor callHenrik Lindberg1-1/+1
2014-07-27(PUP-2860) Make micro improvement by removing redundant checksHenrik Lindberg1-1/+1
This removes redundant checks for exported? and virtual? by calling the underlying exported and virtual methods. There was no real reason why it needed to check if methods exists before calling them.
2014-07-27(perf) Make micro improvement in getting exported/virtual statusHenrik Lindberg1-2/+10
2014-07-27(perf) Make micro improvment by avoiding a method call for getting lineHenrik Lindberg1-1/+1
2014-07-27(perf) Avoid extracting resource type/title multiple times.Henrik Lindberg1-6/+8
This avoids a large number of calls to extract the type and title from a resource ref.
2014-07-27(PUP-2860) Separate models into meta and implHenrik Lindberg7-1156/+1463
This separates the three models for the language, types and bindings into separate files for the meta part and the implementation. This is done in anticipation of future changes / alternative ways of generating the logic and working with models. Now, when the runtime model is wanted, it loads the meta part and then mixes in the implementation. This also separates the dependencies between the models; now the PopsObject from the language model is not reused in the other models.