Isn't this wrong?
- Posted by useless Jul 25, 2010
- 1141 views
This runs fine using Eu 3.1:
atom retry retry = 0 with trace trace(1) while 1 do if retry then end if end while
but fails using 4.0:
<0025>:: a name is expected here atom retry
Hmm. Ok, i rename it to retry2, and this runs fine on Eu v4a3 and v4b2:
atom retry2 retry2 = 0 with trace trace(1) while 1 do if retry2 then end if end while
Ok, that is interesting, what with that dangling "if" there, it runs with no errors using 3 Eu interpreters. Well, ok. So i add a few lines...
sequence TheWebPage TheWebPage = "" atom retry2 retry2 = 0 with trace trace(1) while 1 do if match(upper("<title>404 - Page Not Found</title>"),upper(TheWebPage)) then TheWebPage = "404" exit end if retry2 then end if end while
Eu v4a2 says:
Syntax error - expected to see =, +=, -=, *=, /= or &=\\ if retry2 then end\\ ^\\
implying i should start a expression of some sort between "then" and "end", starting with a boolean or math of some sort? Suddenly, the line that ran fine before needs an assigment in it?
Eu v4b2 says:
<0076>:: expected to see an assignment after 'retry2', such as =, +=, -=, *=, /= or &= if retry2 then end ^
but again, pointing to between "then" and "end". Even tho retry2 has been assigned. And why does an assignment after an "if" ? Plus, " if retry2 then end" ran with no errors before i added the code about TheWebPage.
So i changed the line to:
if retry2 = 1 then end
and it replied
Syntax error - expected to see possibly 'end', not 'then' if retry2 = 1 then end ^
So what the heck, remove the "then"....
it complained about the dangling "if"....
removed the dangling "if"....
it complained about the "end" in "end while"....
removed that "end"....
And for jollies, change the "retry2 +" to "retry2 +=" and this runs just fine:
include wildcard.e -- for upper() sequence TheWebPage TheWebPage = "" atom retry2 retry2 = 0 with trace trace(1) while 1 do if match(upper("<title>404 - Page Not Found</title>"),upper(TheWebPage)) then TheWebPage = "404" exit end if retry2 += 1 end while
And retry2 is incremented each pass thru.
But you do get different results if you comment out the ifthen about TheWebPage.
And even if you say <cr><cr> between "end" and "while" doesn't break the token's meaning, if that "end<cr><cr>while" go together as far as the interpreter sees it, i have a dangling "if" preceeding the "retry2 += 1".
useless