Hi Adela, > Le 11 sept. 2020 à 15:09, Adela Vais <[email protected]> a écrit : > > * data/skeletons/lalr1.d: Change return value. > * examples/d/calc/calc.y, examples/d/simple/calc.y: Adjust.
This commit fails the test suite too, since the test suite is still using int for yylex's return value. As a matter of fact, the TODO had a question: ** Change the return value of yylex Historically people were allowed to return any int from the scanner (which is convenient and allows `return '+'` from the scanner). Akim tends to see this as an error, we should restrict the return values to TokenKind (not to be confused with SymbolKind). In the case of D, without the history, we have the choice to support or not `int`. If we want to _keep_ `int`, is there a way, say via introspection, to support both signatures of yylex? If we don't keep `int`, just move to TokenKind. I was really curious to know if D's introspection made it possible to support both signatures. If it can't, or if we consider returning an int is not right, then, sure, your commit (once the test suite issue addressed) is the right path. In case you're wondering where the test suite's yoles is coming from, m4_define([AT_CALC_YYLEX(d)],... in tests/calc.at. Cheers!
