On 04/16/2014 01:05 PM, Andy Parker wrote:
> On Tue, Apr 15, 2014 at 11:15 AM, Joshua Hoblitt <[email protected]> wrote:
>>
>> * Is it possible to escape the endtag so that it can appear inside the
>> heredoc string?
>>
>>
> I don't believe so. In fact I don't know of any heredoc system that allows
> that, since you can just select a different end marker.

Nor do I; nor am I requesting this feature. :)  I would be nice for this
to be mentioned in the eventual docs.

The only solid use case that occurs to me is being able to put complete
code examples into a heredoc.  I imagine supporting such a feature would
require the parser to backtrack from the endtag to look for an escape
sequence, which may not be worth the cost.

>> * I feel it's a bit confusing for an operator to have a function call
>> like syntax.  I'm sure it's already been discussed at length but why
>> wasn't the shell/perl5/ruby << heredoc operator reused?
>>
> 
> Actually, there wasn't much discussion. Henrik will have to explain the
> choice. I always assumed it had to do with parsing, possibly since << is
> used to introduce the collection query (a complete guess).

That was my thought to but it looks like the DSL has a left shift
operator I was ignorant of:

https://github.com/puppetlabs/puppet/blob/master/lib/puppet/parser/lexer.rb#L168

The total extent of knowledge about racc is that it exists.  Is there a
goal / technical reason to try to keep the grammar as context free as
possible?

-Josh

--

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/534EF909.10208%40cpan.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to