> On 3 Dec 2024, at 21:24, James K. Lowden <jklow...@schemamania.org> wrote: > > On Tue, 3 Dec 2024 17:57:13 +0100 > Hans Åberg <hans.aber...@icloud.com> wrote: > >> In general, one tries to exploit tokens to do special things, which >> is also useful in a Bison parser when adding mid-rule actions. > > That's good advice, hard-won. > >>> it seems it is much easier to parse everything in the data section >>> as a string > > I think you mean to lex each element in the DATA line, removing the > quotes, but not distinguish between number and string? IIUC that will > work fine. Those elements don't *have* a type until they're assigned > to a variable; until then, they're just data, just as is true for > any other kind of input.
I meant trying to first write a correct DATA line with the strings without quotes, and then add a start condition for the strings with quotes. This is more in line with use in say Scheme, and the example I gave. It could be the numbers can be distinguished from strings without quotes, it depends on what you want to put in them.