From: SourceForge.net <no...@so...> - 2007-06-12 15:08:06
|
Bugs item #1735294, was opened at 2007-06-11 15:58 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1735294&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interpreter Group: 3.1.2 >Status: Pending Resolution: Invalid Priority: 5 Private: No Submitted By: Rony G. Flatscher (orexx) Assigned to: Nobody/Anonymous (nobody) Summary: Wrong symbol serving as label on END ? Initial Comment: Not really sure whether this is a bug or working as designed. If the latter, then maybe the error message could be rephrased to make it clearer, what the error is? The following program uses the new "LABEL" subkeyword and also a control variable 'i' on a DO statement. The matching END statement denotes the control variable 'i' instead of the label "aha2". ----------- cut here ----------- str= - "do label aha2 i=1 to 5 ;" - " say 'hi #' i ;" - " leave aha2 ;" - "end i ;" say str~changestr(";", .endOfLine) say "--- about to INTERPRET:" interpret str ----------- cut here ----------- Saving and running the above program yields the following output and error message: ----------- cut here ----------- do label aha2 i=1 to 5 say 'hi #' i leave aha2 end i --- about to INTERPRET: 10 *-* end i ; 10 *-* interpret str Error 10 running F:\work\svn\oorexx\test\tests\oorexxunit\ooRexx\base\tstLabel.rex line 10: Unexpected or unmatched END Error 10.2: Symbol following END ("I") must either match control variable or LABEL of block specification ("AHA2" on line 10) or be omitted ----------- cut here ----------- "I" *is* the control variable used in that block statement. ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2007-06-12 11:07 Message: Logged In: YES user_id=1125291 Originator: NO All that's really justified here is a tweak to the error message wording. Committed revision 460. ---------------------------------------------------------------------- Comment By: Rony G. Flatscher (orexx) Date: 2007-06-11 16:32 Message: Logged In: YES user_id=662126 Originator: YES Just read the NetRexx specification, where on pp. 68-69 the "Label phrase" is explained. It says that if a label was defined at the beginning of the block (explained in the context of LOOP), then it overrides any control variable for the END keyword instruction. As this implementation mostlikely ;) follows the NetRexx definition, I change the resolution to "Invalid", but keep it open to draw the attention to the error message suggestion. *However*, I would like to propose to change the error message to point to the cause of the error. It seems that it might be possible to tell the user the name of the acceptable label at the END statement. Something like: "Symbol following END must match the label name "AHA2" defined on line 10." And in the case that a control variable must be referred to: "Symbol following END must match the control variable name "I" defined on line 10." ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1735294&group_id=119701 |