diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-21 17:39:43 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-21 17:39:43 +0000 |
| commit | 5dc3cb04bebc79517ae5f64d1d3c652b6dfba7ea (patch) | |
| tree | f14e075f078b7054ea69418756b5a28ceaed65ef /lib/puppet/parser/grammar.ra | |
| parent | 0747b4c34ee0aa2ba4430021c1c0e676f71c20ac (diff) | |
| download | puppet-5dc3cb04bebc79517ae5f64d1d3c652b6dfba7ea.tar.gz puppet-5dc3cb04bebc79517ae5f64d1d3c652b6dfba7ea.tar.xz puppet-5dc3cb04bebc79517ae5f64d1d3c652b6dfba7ea.zip | |
Okay, significant change -- classes no longer accept arguments (which makes things simpler but encourages the user of global variables, which is bad), and classes are finally singletons, meaning they will only ever be evaluated for each node a single time. I still need to make nodes work correctly, but that is going to involve modifying the parsing system and a bit more
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@694 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/grammar.ra')
| -rw-r--r-- | lib/puppet/parser/grammar.ra | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index 2b183539b..7b05433ce 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -117,7 +117,6 @@ object: name LBRACE objectinstances endsemi RBRACE { } | type LBRACE params endcomma RBRACE { # a template setting for a type if val[0].is_a?(AST::ASTArray) - Puppet.notice "invalid type" raise Puppet::ParseError, "Invalid type" end result = AST::TypeDefaults.new( @@ -448,22 +447,23 @@ definition: DEFINE NAME argumentlist LBRACE statements RBRACE { ) } -hostclass: CLASS NAME argumentlist parent LBRACE statements RBRACE { +#hostclass: CLASS NAME argumentlist parent LBRACE statements RBRACE { +hostclass: CLASS NAME parent LBRACE statements RBRACE { + #:args => val[2], args = { :name => AST::Name.new(:value => val[1], :line => @lexer.line), - :args => val[2], :file => @lexer.file, :line => @lexer.line, - :code => val[5] + :code => val[4] } # It'll be an ASTArray if we didn't get a parent - if val[3].is_a?(AST::Name) - args[:parentclass] = val[3] + if val[2].is_a?(AST::Name) + args[:parentclass] = val[2] end result = AST::ClassDef.new(args) } -nodedef: NODE names parent LBRACE statements RBRACE { +nodedef: NODE names LBRACE statements RBRACE { unless val[1].is_a?(AST::ASTArray) val[1] = AST::ASTArray.new( :line => val[1].line, @@ -477,9 +477,9 @@ nodedef: NODE names parent LBRACE statements RBRACE { :names => val[1], :code => val[4] } - if val[3].is_a?(AST::Name) - args[:parentclass] = val[2] - end + #if val[3].is_a?(AST::Name) + # args[:parentclass] = val[2] + #end result = AST::NodeDef.new(args) } |
