scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

number_chars/2 unexpected syntax error

Open UWN opened this issue 7 months ago • 3 comments

?- number_chars(N,"0'.").
   error(syntax_error(unexpected_char),number_chars/2:0), unexpected.
   X = 46. % expected, but not found
?- X = 0'. .
   X = 46. % so this is known to the parser

UWN avatar Jun 14 '25 02:06 UWN

I think all such issues must be converted to test cases, because Scryer is lacking on the testing side, I see some bugs (not this one) re-appearing after a while and that's good that people spot them – but it would've been much better if they had never have happened. Basically every fixed bug shall go with at least 1 additional test case – which I rarely see.

hurufu avatar Jun 14 '25 04:06 hurufu

Please note that the syntax I use to report bugs is the very syntax to process test cases (quads). That is, the very text as a bug report (equipped with unexpected), is already a test case. No further processing needed.

(I waited for testing/reporting for the rebis-dev - master merge. After all, #24 reported 7 years ago is much more important, but it seems this takes much more time ...)

UWN avatar Jun 14 '25 04:06 UWN

@hurufu: Please see https://github.com/mthom/scryer-prolog/pull/2746; with this change applied, we can already embed the reported test case as is in a Prolog source file. With a future change, the stated answer description will be taken into account for testing.

triska avatar Jun 14 '25 06:06 triska