summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
* The "collectable" syntax now works end-to-end -- the parser correctly ↵luke2006-05-131-101/+19
| | | | | | recognizes it, the AST objects retain the settings, the scopes do the right conversion, the interpreter stores them all in the database, and then it strips the collectable objects out before sending the object list to the client git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1189 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding some small changes towards fixing #140 and #83, but this work needs ↵luke2006-05-131-10/+38
| | | | | | to take a back seat to object collection, so i will come back to it later. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1186 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #141. It was a problem related to the recent parser changes I made.luke2006-05-121-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1185 980ebf18-57e1-0310-9a29-db15c13687c0
* removing some extraneous loggingluke2006-05-121-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1184 980ebf18-57e1-0310-9a29-db15c13687c0
* Preliminary commit of the first phase of the parser redesign. The biggest ↵luke2006-05-091-119/+168
| | | | | | difference is that overrides should now work for definitions (although i do not yet have a test case -- i will add one on the next commit). The way this is implemented is by having scopes translate themselves at eval time, but in two phases -- the first phase does the overrides, and the second phase does the evaluation of definitions and classes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1180 980ebf18-57e1-0310-9a29-db15c13687c0
* Allowing dashes in class names, although grammar rules restrict it from ↵luke2006-05-021-1/+1
| | | | | | working anywhere except node names or in tag(). They are valid in host names, and many companies have them in the host names; in fact, this fix is for a company with this exact problem -- they cannot use puppet with their nodes because all their hosts have dashes in the host names. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1165 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying "setclass" on scope to check the validity of class names, now that ↵luke2006-04-111-0/+4
| | | | | | "set" can be used to set them manually, and added a test for it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1104 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding simple benchmarking, and using it in a few of the more obvious ↵luke2006-04-101-1/+6
| | | | | | places. Also, fixed a bug in Scope#gennode. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1098 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #103. There are now no such things as node scopes; the entire tree ↵luke2006-04-051-903/+833
| | | | | | is evaluated on every node connection, and node facts are set at the top-level scope. This includes,um, the code; the last commit was accidentally just test changes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1073 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing the class file to actually store class names, not object ids. Also ↵luke2006-04-041-6/+6
| | | | | | added tests to make sure it all stays that way. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1063 980ebf18-57e1-0310-9a29-db15c13687c0
* Using undefined variables is no longer an exception, it just returns an ↵luke2006-03-111-4/+5
| | | | | | empty string. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1003 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #96. Defaults are now set when the object is passed out by the ↵luke2006-03-091-0/+17
| | | | | | scope, rather than when the object is created. This is nice because it also moves awareness of the scope internals out of the AST object and back into the scope. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@996 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug #60. Converting nodes to use types everywhere instead of names, ↵luke2006-02-281-97/+238
| | | | | | and adding a localobjectable to keep track of what parameters have been defined locally. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@957 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #64; multiple class definitions in the same scope is now an error, ↵luke2006-02-271-1/+7
| | | | | | although using the same class name in different scopes is not an error. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@956 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug #73; node names now appear only once in the pathluke2006-02-271-2/+12
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@955 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing all of the autoname codeluke2006-02-271-2/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@953 980ebf18-57e1-0310-9a29-db15c13687c0
* Mostly, this is a refactoring commit. There is one significant new feature,luke2006-02-271-25/+101
| | | | | | | | | | | | | | | | | though: overrides now only work within a class heirarchy, which is to say that a subclass can override an element in a base class, but a child scope cannot otherwise override an element in a base scope. I've also done a good bit of refactoring, though; notably, AST#evaluate now takes named arguments, and I changed the 'name' parameter to 'type' in all of the Component classes (this was all internal, but was confusing as it was). I also removed the need for the autonaming stuff -- it's now acceptable for components not to have names, and everything behaves correctly. I haven't yet removed the autoname code, though; I'll do that on the next commit. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@952 980ebf18-57e1-0310-9a29-db15c13687c0