#315 Regina not handling comment (between operators) properly

open
nobody
None
5
2010-12-23
2010-08-01
No

In the one-line program (2nd program below), Regina isn't
recogizing (apparently) the sixth slash [/] properly.

Good result:

/**/ say 157 / / 2

Bad result:

/**/ say 157 / /*+++*/ / 2

What I understand what a REXX comment is is from IBM's
documentation, Regina doesn't even define what a comment
is (how constructed), or where it can be used, or what a nested
comment is (or handled). A Rexx comment
/* ~~~ */
can occur anywhere white space(s) can occur.

________________________________ Gerard Schildberger

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-08-02

    For reference, on VM it does work as (I think) you expect it to work:

    2 *-* nop
    +++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
    /**/ say 157 / /*+++*/ / 2
    1

    I do have to say though that putting a comment in the middle of an operator is asking for trouble :-)

     
  • Gerard Schildberger

    Yes, I agree with you in that putting comments in the middle of (double) operators
    isn't a good coding practice, but a lot of people do such things as:

    x=functA(a,b,c) + , /* and also add the other*/
    funcB(a,b,c) /*for the grand total.*/

    While the above snippet doesn't split a double operator, it does show how
    some coders do insert comments inside (or around) arithemetic operators
    and the such. It is common to do this with multiple concatenations (||) so as
    to make the code more readable.

    In reporting the bug, I was not, of course, indorsing the use of such,
    but Regina's parser should be robust enough to handle "my" bug and
    others of the same ilk.

    ____________________________________ Gerard Schildberger

     
  • Gerard Schildberger

    I perhaps shouldn't have stated the problem as I did, it could've been stated as Regina not handling double operators correctly with an intervening comment (/*..*/).

    ____________________________________ Gerard Schildberger

     
  • Gerard Schildberger

    • summary: Regina not handling comment properly --> Regina not handling comment (between operators) properly
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks