Csound Csound-dev Csound-tekno Search About

[Csnd-dev] parser/commenting question/request

Date2024-03-29 18:26
FromIain Duncan
Subject[Csnd-dev] parser/commenting question/request
Hello devs, I noticed yesterday that interleaving comments in a function-syntax opcode call does not work in Csound 6. I was wondering whether this might be possible in the new parser for 7? (perhaps is already?)

iain

Example (from a recursive UDO)

    xout avco + vco2(
      1 / ivoices,                          ; amp
      ; this comment kills it, being the only thing on the line  
      kcps * (1 + (inum * gi_spread_cps)),  
      2,                                    ; imode, 2 = pulse
      kpw + (inum * gi_spread_pw),          ; pw + pw spread
      0)

Error message:

error: syntax error, unexpected NEWLINE  (token "
")
 from file superpad.csd (1), line 26:
 >>>        <<<
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra

Date2024-03-29 18:30
FromSteven Yi
SubjectRe: [Csnd-dev] parser/commenting question/request
Could you provide a minimal CSD that has the problem? Could try it out
here with CS7 and if it's not working it'd be good to have an issue on
the tracker. We could also add the example to the test suite.

On Fri, Mar 29, 2024 at 2:25 PM Iain Duncan  wrote:
>
> Hello devs, I noticed yesterday that interleaving comments in a function-syntax opcode call does not work in Csound 6. I was wondering whether this might be possible in the new parser for 7? (perhaps is already?)
>
> iain
>
> Example (from a recursive UDO)
>
>     xout avco + vco2(
>       1 / ivoices,                          ; amp
>       ; this comment kills it, being the only thing on the line
>       kcps * (1 + (inum * gi_spread_cps)),
>       2,                                    ; imode, 2 = pulse
>       kpw + (inum * gi_spread_pw),          ; pw + pw spread
>       0)
>
> Error message:
>
> error: syntax error, unexpected NEWLINE  (token "
> ")
>  from file superpad.csd (1), line 26:
>  >>>        <<<
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra

Date2024-03-29 19:46
FromIain Duncan
SubjectRe: [Csnd-dev] parser/commenting question/request
Attachmentsudo_comment_bug.csd  
Hi Steven, here's the file that was busting, and it's still pretty small. 
HTH!

On Fri, Mar 29, 2024 at 11:30 AM Steven Yi <stevenyi@gmail.com> wrote:
Could you provide a minimal CSD that has the problem? Could try it out
here with CS7 and if it's not working it'd be good to have an issue on
the tracker. We could also add the example to the test suite.

On Fri, Mar 29, 2024 at 2:25 PM Iain Duncan <iainduncanlists@gmail.com> wrote:
>
> Hello devs, I noticed yesterday that interleaving comments in a function-syntax opcode call does not work in Csound 6. I was wondering whether this might be possible in the new parser for 7? (perhaps is already?)
>
> iain
>
> Example (from a recursive UDO)
>
>     xout avco + vco2(
>       1 / ivoices,                          ; amp
>       ; this comment kills it, being the only thing on the line
>       kcps * (1 + (inum * gi_spread_cps)),
>       2,                                    ; imode, 2 = pulse
>       kpw + (inum * gi_spread_pw),          ; pw + pw spread
>       0)
>
> Error message:
>
> error: syntax error, unexpected NEWLINE  (token "
> ")
>  from file superpad.csd (1), line 26:
>  >>>        <<<
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra