#203 Definition of line comments

None
wont-fix
nobody
None
3
2013-12-05
2013-05-16
No

1.10.3. Comments
...
A line comment is started by two subsequent minus signs (--) and ends at the end of a line.

add "outside of a literal string or comment"
note that / or / is not recognized within literal strings!

...
01 parse pull input
02 / if substr(input,1,5) = "/123"
03 then call process
04 / dept = substr(input,32,5)
This is incorrect because the language processor would interpret the /
that is part of the literal string
/123 as the start of a nested standard comment. It would not process the rest of the program because it
would be looking for a matching standard comment end (
/).
You can avoid this type of problem by using concatenation for literal strings containing

2.11. INTERPRET

-INTERPRET--expression--;------------------------------------><
INTERPRET processes instructions that have been built dynamically by evaluating expression.
The expression is evaluated to produce a character string, and is then processed (interpreted) just as
though the resulting string were a line inserted into the program and bracketed by a DO; and an END;.

Interpret 'x=3'
DO; x=3 END; would cause a syntax error

MFC suggested this changed wording:
were a line inserted into the program preceded by a line 'DO;' and followed by a line 'END;'
thus
DO;
x=3
END;
or ---- bracketed by a 'DO;' and ';END;'. (tricky:-)
thus
DO; x=3 ;END;

Discussion

  • Erich

    Erich - 2013-06-05

    To fix documentation bug #203 this patch changes instrc.xml in docs/branches/4.1.3/trunk/rexxref
    It should also apply cleanly to docs/branches/4.1/trunk/rexxref
    In addition it should apply "with offset 44" to /docs/trunk/rexxref

    Following MFC's suggestions

    from: Mike Cowlishaw
    date: Sat, May 11, 2013 at 8:46 AM
    This could be emphasised by changing the text to:

    ... just as though the resulting string were a line inserted into the program and bracketed by lines containing a DO; and an END;.

    from: Mike Cowlishaw
    date: Thu, May 30, 2013 at 2:24 PM
    Interesting. So a stronger statement is needed there, perhaps: 'with an added semicolon'.

    --- instrc.xml (revision 9260)
    After "program" in "line inserted into the program and bracketed by a DO; and an END;.":

    • removed "and bracketed by"
    • inserted "with a trailing semicolon and bracketed by lines containing"
     
  • Rick McGuire

    Rick McGuire - 2013-12-05
    • status: open --> wont-fix
     
  • Rick McGuire

    Rick McGuire - 2013-12-05

    This is a rather pointless update, adding nothing to the definition.

     


Anonymous

Cancel  Add attachments





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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks