Issue #4638 has been updated by Paul Berry. Status changed from Accepted to Ready for Testing % Done changed from 0 to 100 Branch set to http://github.com/stereotype441/puppet/tree/ticket/next/4638
I've pushed a patch that represents all grammar elements consistently either as an ASTArray (for grammar elements that can represent more than one thing) or a scalar object (for all other grammar elements). ---------------------------------------- Bug #4638: Confusion between arrays and scalars in grammar http://projects.puppetlabs.com/issues/4638 Author: Paul Berry Status: Ready for Testing Priority: Normal Assignee: Paul Berry Category: parser Target version: Statler Affected version: Keywords: Branch: http://github.com/stereotype441/puppet/tree/ticket/next/4638 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.
