Hi Thomas,

I am willing to investigate this, however: your project doesn't say how 
to run these 'broken' specs and I don't have the time to find out. 
Please give us something we can run to verify what we claim before we 
post it. (aka test driven posting)

By glancing at your code, I suspect you simply ask for the heredoc not 
to be empty, which makes the tests fail. Have you excluded that possibility?

Greetings,
kaspar

On 21.05.13 23:24, Thomas Ingram wrote:
> I'm having trouble parsing heredocs. I adapted the example document
> code[1], and my parser[2] correctly parses "normal heredocs". However
> heredocs[3] containing only whitespace (indentation/empty lines) fail to
> parse.
>
> Extra information about Rip heredocs might be useful:
> * They may not be nested. (or place whatever you want in a heredoc, but
> Rip will only see a single string.)
> * They follow the same termination rules as Ruby's <<-HEREDOCS. (In
> other words heredocs terminators may be indented, but otherwise must
> appear on a blank line. Additionally the only thing allowed after the
> heredoc terminator is a line break or nothing.)
> * In contrast to Ruby heredocs, Rip heredocs consisting solely of
> multiple blank lines does not get collapsed into an empty string. (Why
> does Ruby do this anyway?)
>
> [2]
> https://github.com/rip-lang/rip/blob/heredoc/lib/rip/compiler/parser.rb#L257-L269
> [3]
> https://github.com/rip-lang/rip/blob/heredoc/spec/unit/rip/compiler/parser_spec.rb#L1449-L1529
>
> --
> Thomas Ingram


Reply via email to