Ove Kaaven ovek@arcticnet.no 04/19/04 22:50 PM >>>
man, 19.04.2004 kl. 17.03 skrev Robert Shearman:
Doesn't the "version" rule already handle this?
It would appear not. The 'version' type is declared > as a number further up
It's declared that the rule *returns* a number, you mean. The actual rule is defined as
version: aNUM { $$ = MAKELONG($1, 0); } | aNUM '.' aNUM { $$ = MAKELONG($1, $3); } ;
Now if this somehow returns 0, then you need to fix that rule, not add another rule which makes a version of e.g. "1.2.3.4" valid syntax (but still return a wrong result).
Ok, I missed that before. I suspect it doesn't work properly because it correctly matches aNUM and attempts to convert it to a number and succeeds (but returning 0). We should re-arrange that rule so that the dotted version matches first and falls back to the second version if there is no '.'. However, I doubt I will have the time to resend that patch for a while.
Rob