Forums

Newbie question about heredoc

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Newbie question about heredoc

Postby AMIGrAve » Sat Jun 02, 2012 1:30 am

Can someone tell why this code :

Code: Select all
class Test
    def main
        print """ fewfefwe """



Produce this compilation error ?

test.cobra(3,15): error: Expecting an expression.
Compilation failed - 1 error, 0 warnings
Not running due to errors above.
AMIGrAve
 
Posts: 6

Re: Newbie question about heredoc

Postby Charles » Sat Jun 02, 2012 6:22 am

We don't have support for multi-line strings in expressions yet. Currently, we just have them for doc strings.

This works:
class Test
def main
print " fewfefwe "
print ' fewfefwe '
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Newbie question about heredoc

Postby AMIGrAve » Sat Jun 02, 2012 5:24 pm

Ok, thanks for the answer Charles !

Hope your wrist is getting better.
AMIGrAve
 
Posts: 6


Return to Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron