Page 1 of 1

Newbie question about heredoc

PostPosted: Sat Jun 02, 2012 1:30 am
by AMIGrAve
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.

Re: Newbie question about heredoc

PostPosted: Sat Jun 02, 2012 6:22 am
by Charles
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 '

Re: Newbie question about heredoc

PostPosted: Sat Jun 02, 2012 5:24 pm
by AMIGrAve
Ok, thanks for the answer Charles !

Hope your wrist is getting better.