Euphoria
Ticket #76:
Negative constant after block leaving statements (break, exit, ...) produces syntax error (code 132)
-
Reported by
Palacee
Sep 18, 2009
The documentation states that negative numbers can be used after block leaving statements to tell the interpreter to count the blocks from the outer ones. However trying this results in a syntax error. The parser complains about the minus sign. Context seems irrelevant, this always seems to happen. Examining the error with eu.ex showed that it may be connected to "exit_level" function in parser.e and/or number scanning. The framework for this feature is undoubtedly built in the parser, but somehow it doesn't catch the negative constant as such, and continues parsing on a wrong trail.
Details
1. Comment by mattlewis
Sep 18, 2009
The documentation is actually incorrect. The exit statement accepts an optional label or positive integer:
for i = 1 to 5 do
for j = 1 to 3 do
? i & j
exit 2
end for
end for
2. Comment by mattlewis
Sep 18, 2009
Ok, I looked at it wrong. I guess I just didn't remember this proposed feature. I see that the code expects an atom, but gets a UMINUS.
3. Comment by mattlewis
Sep 18, 2009
Added a test to t_flow.e to make sure this is covered.
4. Comment by jeremy
Sep 18, 2009
The state/status is confusing, better terms need to exist. The idea of the State "Confirm" is that it's still an Open state. The Status is "Fixed", i.e. I fixed it. So, the state should go from Open -> Confirm -> Closed or possibly back to Open. The Status "Needs Confirmed" is for something such as user ABC reports problem DEF but the devs can't duplicate it. It's asking others, can you confirm there is a problem?
I'm open to suggestions for another name. As for now, I changed this ticket to Confirm/Fixed.
5. Comment by mattlewis
Sep 18, 2009
Yeah, every time I go to mark something off, I dither between Fixed and Needs Confirmed. Your explanation makes more sense now.
6. Comment by mattlewis
Sep 18, 2009
Maybe a better way to put it is: "Cannot Reproduce"
7. Comment by jeremy
Sep 18, 2009
Can't Confirm seems to indicated a completed status, such as fixed. i.e. I'm giving up, can't confirm.