summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast
Commit message (Collapse)AuthorAgeFilesLines
...
* Add comparison operators (< > == != <= >=) to ASTBrice Figureau2008-09-301-0/+37
|
* Add boolean operators to ASTBrice Figureau2008-09-301-0/+48
|
* Add an append (+=) variable operator:Brice Figureau2008-09-211-2/+2
| | | | | | | | | | | | | | | | | | | The append variable operator can be used to append something to a variable defined in a parent scope, containing either a string or an array. The main use is to append array elements in classes to a variable globally defined in a node. Example: $ssh_users = ['brice', 'admin1'] class backup { $ssh_users += ['backup_operator'] ... } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1396 - Added sha1 function from DavidS to coreJames Turnbull2008-07-081-1/+1
|
* Fixed #1047 -- Puppet's parser no longer changes the orderLuke Kanies2008-02-281-21/+3
| | | | | | in which statements are evaluated, which means that case statements can now set variables that are used by other variables.
* Fixing #1085, I think -- I was not returning a resourceLuke Kanies2008-02-252-4/+8
| | | | | | if the class had already been evaluated, but this was only being run into in corner cases -- mostly where one class included another class, I assume.
* Moving the ast node tests to rspec (which I could haveLuke Kanies2008-02-123-34/+15
| | | | | | | *sworn* I did this weekend). In the process, I fixed a couple of bugs related to differentiating between nodes and classes, and then cleaned up quite a few error messages.
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-116-9/+9
| | | | | since it's stupid to have a class named after a verb.
* Changing some methods in the Compile class toLuke Kanies2008-02-113-3/+3
| | | | | be more internally consistent (switched store_resource to add_resource, and store_override to add_override).
* Fixed #1030 - class and definition evaluation has been significantlyLuke Kanies2008-02-112-19/+26
| | | | | | refactored, fixing this problem and making the whole interplay between the classes, definitions, and nodes, and the Compile class much cleaner.
* More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-083-264/+249
| | | | | | | | | | | just returns a resource from its evaluate() method, and all of the work is done in the evaluate_code method. This makes the code cleaner, because it means 1) evaluate() has the same prototype as all of the other AST classes, 2) evaluate() is no longer called indirectly through the Parser Resource class, and 3) the classes themselves are responsible for creating the resources, rather than it being done in the Compile class.
* Refactoring the AST classes just a bit. I realized thatLuke Kanies2008-02-0820-106/+64
| | | | | | all of the evaluate() methods only ever accepted a scope, and sometimes one other option, so I switched them all to use named arguments instead of a hash.
* Renaming 'configuration' to 'catalog', fixing #954.Luke Kanies2007-12-111-1/+1
|
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-1/+4
| | | | | | | | | | | | | | | | | | | there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class.
* Fixing the first half of #917 -- the ResourcReferenceLuke Kanies2007-11-281-2/+2
| | | | | | AST code now correctly finds the resource. It's getting lost in the configuration translation, though, so I need to fix that, too.
* Fixing the error message as requested in #893.Luke Kanies2007-11-271-3/+1
|
* Fixing a parser test -- really, just removing testsLuke Kanies2007-11-132-1/+2
| | | | | | | | that belong with the AST classes rather than in the parser. Yeah, these tests need to be rewritten. Committed on an airplane. :)
* Removing the completely obsolete passwd2puppet and the obsolete component.rbLuke Kanies2007-09-131-224/+0
|
* Fixing #802 -- tags are now applied before parent classes are evaluated, so ↵Luke Kanies2007-09-061-1/+3
| | | | parent classes can use tagged() to test if a node is a member of a subclass.
* Renaming some ast resource classes and files so they make a lot more sense.Luke Kanies2007-09-065-6/+6
|
* Fixing #806. Resources correctly look up their fully qualified definition ↵Luke Kanies2007-09-062-17/+33
| | | | type, just like resource references do, which causes the resource and reference to again agree on the full name of a given defined type.
* Successfully modified all tests and code so that all language tests pass ↵Luke Kanies2007-09-042-8/+5
| | | | again. This is the majority of the work necessary to make the separate "configuration" object work.
* We now have a real configuration object, as a subclass of GRATR::Digraph, ↵Luke Kanies2007-09-0422-351/+41
| | | | that has a resource graph including resources for the container objects like classes and nodes. It is apparently functional, but I have not gone through all of the other tests to fix them yet. That is next.
* More refactoring. I have removed a few more extraneous methods from Scope, ↵Luke Kanies2007-09-034-13/+25
| | | | mostly just pointing directly to the compile, and I have begun (but commented out) the move to having resources to model each of the classes and nodes, in addition to the definitions. This will, again, enable a real Configuration object, and it will enable class versioning and similar features.
* Removing the Scope#setresource method, since it was essentially redundant. ↵Luke Kanies2007-09-031-3/+3
| | | | The work is done in either AST::ResourceDef#evaluate or Compile#store_resource.
* Doing a small amount of refactoring, toward being able to use Parser ↵Luke Kanies2007-09-033-78/+63
| | | | resources to evaluate classes and nodes, not just definitions. This will hopefully simplify some of the parsing work, and it will enable the use of a Configuration object that more completely models a configuration.
* Deleting old documentation that somehow made it back into the tree in the ↵Luke Kanies2007-09-012-2/+228
| | | | switch to git, and refactoring the evaluate_classes method on the compile object so I can use resources as intermediaries, thus making classes do late-binding evaluation.
* Renaming the "configuration" object to "compile", because it is only a ↵Luke Kanies2007-08-251-1/+1
| | | | transitional object and I want the real "configuration" object to be the thing that I pass from the server to the client; it will be a subclass of GRATR::Digraph.
* All language tests now pass. I expect there are other failures elsewhere, ↵Luke Kanies2007-08-201-1/+1
| | | | but I want to commit this before delving into them. My method for fixing the tests was to do as little as possible, keeping the tests as bad or as good as they were before I started. Mostly this was about changing references to the interpreter into references to the parser (since that is where the new* methods are now for ast containers) and then dealing with the new config object and its relationship to scopes.
* The first pass where at least all of the snippet tests pass. I have ↵Luke Kanies2007-08-203-37/+29
| | | | unfortunately had to stop being so assiduous in my rewriting of tests, but I am in too much of a time crunch to do this "right". The basic structure is definitely in place, though, and from here it is a question of making the rest of the tests work and hopefully writing some sufficient new tests, rather than making the code itself work.
* An intermediate commit in the work towards adding multi-environment support.Luke Kanies2007-08-141-2/+5
| | | | | | | | This has required splitting the interpreter up considerably, which is much cleaner but is a large project. There is now a 'nodes' handler, but it is currently non-functional, although all the support structure is there. It just needs to have the individual methods fleshed out, and it needs to be connected to the 'facts' handler.
* Fixing #314 and #729; here's the changelog:luke2007-08-032-3/+3
| | | | | | | | | | | | | | | Refactored how the parser and interpreter relate, so parsing is now effectively an atomic process (thus fixing #314 and #729). This makes the interpreter less prone to error and less prone to show the error to the clients. Note that this means that if a configuration fails to parse, then the previous, parseable configuration will be used instead, so the client will not know that the configuration failed to parse. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2742 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the ability to specify relationships to classes, using Class[name] ↵luke2007-07-191-3/+9
| | | | | | resource references. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2715 980ebf18-57e1-0310-9a29-db15c13687c0
* The first round of bug-fixes in preparation for beakerluke2007-07-191-2/+4
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2714 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #703, mostly. You still cannot do multi-condition queries, but you ↵luke2007-07-181-9/+7
| | | | | | can at least query against any parameter, and matching any value is sufficient for a match, so the tags work fine. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2705 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding patch by Valentin Vidic to add the "+>" syntax for adding values to ↵luke2007-07-101-2/+3
| | | | | | parameters git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2670 980ebf18-57e1-0310-9a29-db15c13687c0
* The parser now throws an error when a resource reference is created for an ↵luke2007-07-081-0/+8
| | | | | | unknown type. Also, resource references look up defined types and translate their type accordingly. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2660 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #620 - class names and node names now throw an error when they conflictluke2007-07-041-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2646 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #637 -- defined resources can now correctly be virtual or exportedluke2007-06-111-1/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2562 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #629 -- an undef keyword now existsluke2007-05-171-0/+3
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2522 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing a weird bug that occurred because I was changing @parentclass in the ↵luke2007-05-143-25/+19
| | | | | | AST stuff the first time it was called, from a string to a the actual instance of the parent. This worked fine as long as the parentclass was only called when parsing was complete, such as during evaluation, but if anything resulted in it being called earlier (e.g., attempting to add to the class during parsing), then things behaved, um, badly. This commit fixes the method so that the variable is not modified; there is now @parentclass and @parentobj. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2511 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #615 (subclasses with similar names) by getting rid of the class ↵luke2007-05-031-11/+9
| | | | | | "type" and "fqname", and instead using "classname" everywhere. You should no longer see unqualified class/definition names anywhere. Also, rewriting how snippet tests work, to avoid creating all of the files, since the point was the parsing tests, not functional tests. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2458 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the functionality requested in ↵luke2007-04-191-2/+0
| | | | | | | | | | http://mail.madstop.com/pipermail/puppet-users/2007-April/002398.html . You can now retrieve qualified variables by specifying the full class path. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2393 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #539. Definitions can now have titles, and both $title and $name are ↵luke2007-03-191-6/+16
| | | | | | guaranteed to be set within any definition. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2301 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the webserver_portability branch from version 2182 to version 2258.luke2007-03-062-32/+10
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2259 980ebf18-57e1-0310-9a29-db15c13687c0
* Applying a modified form of the patch by cstorey from #523. The ↵luke2007-02-281-4/+2
| | | | | | modifications were mostly around the fact that Strscan does not set $1 and its ilk. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2239 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #477. setvar() can now accept the file and line info from callers.luke2007-02-281-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2237 980ebf18-57e1-0310-9a29-db15c13687c0
* Applying patch by DavidS from #522, along with test code and a small bit of ↵luke2007-02-272-18/+13
| | | | | | code cleanup. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2231 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #517 and more. Classes now support more than one namespace in their ↵luke2007-02-271-0/+8
| | | | | | search path, parent classes automatically have their namespaces added to subclass namespaces, and (huzzah) there is a "search" function that can be used to add new namespaces into their search path. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2226 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #472. Apparently this has been broken since I did the parser ↵luke2007-02-222-5/+15
| | | | | | redesign. I had to fix the scope trees so that subclass scopes are subscopes of the parent scopes, which used to be the case but was far more complicated. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2220 980ebf18-57e1-0310-9a29-db15c13687c0