summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-111-8/+8
| | | | | since it's stupid to have a class named after a verb.
* More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-081-0/+5
| | | | | | | | | | | 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.
* Successfully modified all tests and code so that all language tests pass ↵Luke Kanies2007-09-041-37/+1
| | | | 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-041-44/+1
| | | | 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-031-51/+20
| | | | 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-15/+0
| | | | The work is done in either AST::ResourceDef#evaluate or Compile#store_resource.
* Renaming the "configuration" object to "compile", because it is only a ↵Luke Kanies2007-08-251-11/+11
| | | | 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.
* A round of bugfixing. Many more tests now pass -- I think we are largely ↵Luke Kanies2007-08-201-1/+1
| | | | down to tests that (yay!) fail in trunk.
* All language tests now pass. I expect there are other failures elsewhere, ↵Luke Kanies2007-08-201-3/+3
| | | | 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-201-47/+28
| | | | 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.
* The new parser configuration object works now,Luke Kanies2007-08-161-137/+12
| | | | | | | | | | | | | | but the rest of the compiling process is hosed (although the parser itself should still be fine). The configuration object is unifying a lot of work that was scattered around either the interpreter or the scopes, and it simplifies the whole system. However, its new simplicity has made the complexity of the rest of the system that much more apparent, and I am resolved to fixing the system rather than hacking it sufficiently to just make it work.
* An intermediate commit in the work towards adding multi-environment support.Luke Kanies2007-08-141-182/+40
| | | | | | | | 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 #620 - class names and node names now throw an error when they conflictluke2007-07-041-9/+21
| | | | 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-4/+13
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2562 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #566 -- definitions, tags, and classes can now be single charactersluke2007-05-171-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2523 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #629 -- an undef keyword now existsluke2007-05-171-2/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2522 980ebf18-57e1-0310-9a29-db15c13687c0
* Consolidating all of the configuration parameter declarations into ↵luke2007-05-041-8/+0
| | | | | | configuration, at least partially just because then the docs for each parameter have to be a bit better. Also, I have gotten rid of the "puppet" section, replacing it with "main", and changed, added, or removed a couple of other sections. In general, we should now prefer more sections, rather than fewer. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2463 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #615 (subclasses with similar names) by getting rid of the class ↵luke2007-05-031-7/+7
| | | | | | "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
* Fixing #603 -- I had to add a special case for escaped carriage returns. I ↵luke2007-04-261-0/+2
| | | | | | am not entirely sure this is the right solution, but so be it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2418 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the functionality requested in ↵luke2007-04-191-4/+28
| | | | | | | | | | 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 context to the warning message about unknown escapesluke2007-03-191-1/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2319 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the webserver_portability branch from version 2182 to version 2258.luke2007-03-061-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2259 980ebf18-57e1-0310-9a29-db15c13687c0
* Apparently the include function was not failing when it could not find ↵luke2007-03-011-0/+1
| | | | | | asked-for classes. Now it does. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2250 980ebf18-57e1-0310-9a29-db15c13687c0
* Applying a modified form of the patch by cstorey from #523. The ↵luke2007-02-281-12/+41
| | | | | | 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-2/+9
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2237 980ebf18-57e1-0310-9a29-db15c13687c0
* More code related to #517. Oops.luke2007-02-271-4/+32
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2227 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #472. Apparently this has been broken since I did the parser ↵luke2007-02-221-1/+12
| | | | | | 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
* Still trying to track down the tagging problemluke2006-12-291-3/+3
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1994 980ebf18-57e1-0310-9a29-db15c13687c0
* adding a bit better error reporting when tags are badluke2006-12-291-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1993 980ebf18-57e1-0310-9a29-db15c13687c0
* A couple of small bug-fixesluke2006-12-281-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1976 980ebf18-57e1-0310-9a29-db15c13687c0
* Many, many, many performance improvements in the compiler (I hope). I did ↵luke2006-10-061-74/+43
| | | | | | not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1739 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the changes from the override-refactor branch. This is a ↵luke2006-10-041-1045/+499
| | | | | | significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the feature from #259. I had to rework the Scope#lookupvar a bit, ↵luke2006-09-151-4/+14
| | | | | | but everything now works as expected when variables are either undefined or set to empty strings. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1609 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding eat-last-line support in ERBluke2006-09-031-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1542 980ebf18-57e1-0310-9a29-db15c13687c0
* downgrading the template interpolation messageluke2006-08-301-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1517 980ebf18-57e1-0310-9a29-db15c13687c0
* Committing definition inheritance. I have not yet written tests yet, but my ↵luke2006-08-221-0/+21
| | | | | | last commit pretty seriously broke some things without me realizing it, so I wanted to get this in. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1484 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding "if/else" constructs. No operators, no elsif, but it is a good ↵luke2006-08-221-0/+10
| | | | | | start, anyway. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1483 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug in scope/interpreter where nodes found in ldap must have parent ↵luke2006-07-181-1/+1
| | | | | | nodes. The problem was that the the scope was using the presence of a parent node to determine whether a node was found. Instead I added a flag in the arguments to "Scope#evaluate" to mark nodes as found. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1401 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing templating so it immediately fails when a variable is not found, as ↵luke2006-07-111-4/+19
| | | | | | opposed to passing up the method_missing heirarchy, which was causing a nasty memory leak and some kind of weird, long-running search git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1389 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing templating bug that can result in what looks like an infinite loop, ↵luke2006-07-111-1/+7
| | | | | | and changing default timeout to 2 minutes instead of 30 seconds git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1385 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing error when template does not existluke2006-07-111-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1383 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding minimal update checking for templates. It will only check the ↵luke2006-07-031-0/+5
| | | | | | templates that have been parsed in this process, but it is better than nothing. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1353 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving the template handling into a simple wrapper object so templates don't ↵luke2006-06-301-8/+33
| | | | | | have full access to the scope object without some real hacking. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1342 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding initial template support. It is just a function, and a ↵luke2006-06-291-1/+13
| | | | | | method_missing method on Scope. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1340 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding test and fix for empty execs being ignoredluke2006-06-151-3/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1288 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding support for default nodes as requested in #136.luke2006-06-131-0/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1261 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #163. Strings can now correctly escape dollar signs.luke2006-06-051-12/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1234 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #160. Fixing the error in Puppet::Type#[]= and scope.newobjectluke2006-06-011-5/+11
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1230 980ebf18-57e1-0310-9a29-db15c13687c0
* I believe I have finalized export/collection support. I still want to go ↵luke2006-05-151-17/+46
| | | | | | through all of the code and s/collectable/exported/g (thanks to womble for that term). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1193 980ebf18-57e1-0310-9a29-db15c13687c0
* I had to redo how the scopes handled collectable objects (which I will soon ↵luke2006-05-141-17/+70
| | | | | | change to being called "exported objects"). All seems to work now, though. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1192 980ebf18-57e1-0310-9a29-db15c13687c0