Csound Csound-dev Csound-tekno Search About

Trailing New Line in UDO

Date2015-12-08 23:33
FromBeinan Li
SubjectTrailing New Line in UDO
Hi Csound (6.05 on OS X El Capitan):

I noticed that if I have two UDO headers to include, and the one that is "#included" first does not contain a trailing new line after "endop".

I get this error:

"error: syntax error, unexpected '#', expecting NEWLINE  (token "#") from file myheader.inc (2)"

Also, the UDO header that comes after needs no trailing new lines.
Is it that the interpreter uses the new line to separate multiple headers to include?

Is this by design? If so, wouldn't the opcode/endop keywords be good enough to separate the UDOs?

Anyways, this is not blocking. I'm just curious.

Thanks,
Beinan

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2015-12-09 06:47
FromVictor Lazzarini
SubjectRe: Trailing New Line in UDO
I think the reason for this is that the included file, not having a newline, will make the
next line in your code follow on without a newline. There is probably another #include in the next line. The parser expects a newline  not a hash.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 8 Dec 2015, at 23:33, Beinan Li  wrote:
> 
> Hi Csound (6.05 on OS X El Capitan):
> 
> I noticed that if I have two UDO headers to include, and the one that is "#included" first does not contain a trailing new line after "endop".
> 
> I get this error:
> 
> "error: syntax error, unexpected '#', expecting NEWLINE  (token "#") from file myheader.inc (2)"
> 
> Also, the UDO header that comes after needs no trailing new lines.
> Is it that the interpreter uses the new line to separate multiple headers to include?
> 
> Is this by design? If so, wouldn't the opcode/endop keywords be good enough to separate the UDOs?
> 
> Anyways, this is not blocking. I'm just curious.
> 
> Thanks,
> Beinan
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-12-09 08:02
FromOeyvind Brandtsegg
SubjectRe: Trailing New Line in UDO
I recognize this trap from earlier, it can create a lot of confusion
for new users.
Would it be possible to add a newline after an include statement
automatically when parsing?
Come to think of it, the user has already typed in the newline (as the
last item on the line with the include statement).
best
Oeyvind

2015-12-09 7:47 GMT+01:00 Victor Lazzarini :
> I think the reason for this is that the included file, not having a newline, will make the
> next line in your code follow on without a newline. There is probably another #include in the next line. The parser expects a newline  not a hash.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 8 Dec 2015, at 23:33, Beinan Li  wrote:
>>
>> Hi Csound (6.05 on OS X El Capitan):
>>
>> I noticed that if I have two UDO headers to include, and the one that is "#included" first does not contain a trailing new line after "endop".
>>
>> I get this error:
>>
>> "error: syntax error, unexpected '#', expecting NEWLINE  (token "#") from file myheader.inc (2)"
>>
>> Also, the UDO header that comes after needs no trailing new lines.
>> Is it that the interpreter uses the new line to separate multiple headers to include?
>>
>> Is this by design? If so, wouldn't the opcode/endop keywords be good enough to separate the UDOs?
>>
>> Anyways, this is not blocking. I'm just curious.
>>
>> Thanks,
>> Beinan
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here