Daily farming script

holatuwol

Developer
No, it generates that error on its own. When this page and this page make perfect sense to you, so will the error messages that KoLmafia generates when parsing ASH scripts, along with the error messages that Java generates when parsing Java source code. This understanding usually occurs shortly after you take a formal course in compilers and interpreters.

In essence, there is no ambiguity on what KoLmafia wants to see -- by the time it reaches that '=' token, KoLmafia truly expects nothing except an ')'. But, since this constantly comes up, it's probably a good idea to make the error message less ambiguous as to which token it's looking at when it says it's expecting an ')' or maybe allow '=' to stand in for '=='.
 

Metraxis

Member
There are times when assignment in a test (be it while() or if()) is the most elegant solution to a computational issue. They may be corner cases, but still are valid. Perhaps a better/more informative solution would be to give the line number of the ( in need of closure and possibly the token which caused the condition?

Examples:

'=' on Line 33 requires that '(' on Line 33 be closed. ')' expected.

'bar()' on Line 106 requires that '{' on Line 20 be closed. '}' expected.
 

BigH

New member
I had a line in the script that read "countI1++;" and Mafia obviously doesnt recognise ++ as an increment, and displayed an error message similar to the last one, apart from it had a curly bracket insted of a parenthethis, "}" and not ")". Just saying that if you were reconsidering the error messages that are displayed, this might be another one to consider.
 
Top