Issue #4638 has been reported by Paul Berry.

----------------------------------------
Bug #4638: Confusion between arrays and scalars in grammar
http://projects.puppetlabs.com/issues/4638

Author: Paul Berry
Status: Accepted
Priority: Normal
Assignee: Paul Berry
Category: parser
Target version: Statler
Affected version: 
Keywords: 
Branch: 


In the grammar, when a construct can contain a variable number of objects, we 
generally represent it as an ASTArray when it contains more than one object (or 
zero objects) and a scalar object when it contains exactly one object.  This 
saves a trivial amount of memory at the expense of complicating the code, 
because it forces all uses of these plural constructs to check whether they are 
accessing an array or a scalar, and alter their behavior accordingly.

In addition to complicating the code, it causes the parser to behave 
incorrectly in situations where an array contains other arrays, because while 
parsing an array the parser can't reliably distinguish between an array nested 
inside another array and an array that hasn't been completely parsed yet.  As a 
result, [[[a, b], c], d] produces an identical parse result to [a, b, c, d].  
Fortunately, this inconsistency has not been a problem so far because there 
aren't any providers for which nested arrays are a useful construct.  But it 
would be nice to fix the parser before such a situation arises.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to