Issue #22593 has been updated by Andrew Parker.

Status changed from In Topic Branch Pending Review to Merged - Pending Release

Merged into master in 
[67d7e0fa61a](https://github.com/puppetlabs/puppet/commit/67d7e0fa61a92b57e1e9de8694c8766098d7f498)

----------------------------------------
Bug #22593: future parser lexer does not handle all kinds of interpolated 
expressions
https://projects.puppetlabs.com/issues/22593#change-98194

* Author: Henrik Lindberg
* Status: Merged - Pending Release
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: language
* Target version: 3.4.0
* Affected Puppet version: 3.0.0
* Keywords: language lexer interpolation variables brace
* Branch: https://github.com/puppetlabs/puppet/pull/1958
----------------------------------------
There are several problems with the future parser's lexer wrt. interpolation. 
(The same problem exist in the old lexer, but is
less of a concern as the parser will give bad errors anyway).

* Interpolation does not honor nesting of braces, takes the first r-brace to be 
end of interpolated expression. This leads
  to an hard to understand syntax error (because the lexer told the parser a 
lie). I.e. the marked section is what is lexed as
  an epression, the first '}' ends the interpolation.
<pre>
    "${x ? { true => 'hi', default => 'goodbye'}}"
       ^--------------------------------------^
</pre>
* Since the first bare word is lexed as a variable unless followed by '(' (i.e. 
a function call), it is impossible to use
  the expressions if, unless, case, undef, true, false without having to 
enclose them in parentheses. The lexer should translate these
  to the respective keywords instead of treating them as variables (other 
keywords does not matter as much - node in particular is
  used as a variable. In 3.x. the expressions are not r-values, but in 4x they 
will be.

This is bad because it gives the wrong error message when it can do much better 
in 3.x, and it prevents a selector expression from being
used in interpolation. For 4.x. it is bad because it also prevents using if, 
unless, and case expressions in interpolation.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to