Returning to the ChgUnitPoolInfos case (there are others) of where the AGEWiki pages appear to be, if not "flat out wrong", then questionable.
The AGEWiki page
ChgUnitPoolInfos
clearly indicates three parameters
ChgUnitPoolInfos = <UnitDef>|<variation of Force Pool>|<AI Pool Ratio>
with none of them optional. But there are more than a few cases of actual usage where the parameters are only two (see post #92 above).
So what do I do? Reject the usage evidence, and report those as errors (as Chliperic suggests I do in post #95 above)? And risk possible false positives?
I have instead decided to report such unusual -- maybe? probably? definitely? -- "wrong" usages as warnings:
Code: Select all
chgunitpoolinfos: _CHGUNITPOOLINFOS eq unidefval sc int {
txterrmsg(_WARNING, TRUE, linenorhs, "suspicious, apparent omission of <AI Pool Ratio> as third argument");
}
| _CHGUNITPOOLINFOS eq unidefval sc int sc pct
{
/*
http://www.ageod.net/agewiki/ChgUnitPoolInfos
Syntax: ChgUnitPoolInfos = <UnitDef>|<variation of Force Pool>|<AI Pool Ratio>
contrary to the docs, uses ; instead of |
*/
}
;
Here, too, note the: "contrary to the docs, uses ; instead of |".
Tricky, tricky business, this coding the txt.y parser. Also straddling the line between reporting too many "errors" (too many false positives) vs. reporting too few.
Reporting a "warning" instead of a definite "error" allows me to hedge my bets. In fact, I had added the "warning" category to cover gray areas such as these. (I also had added the "notice" category to cover the nitpicky stuff.)
Report questionable stuff in full. Then let the developer/modder decide the issues!