Re: Unquoted strings in BASIC

Maury Markowitz <[email protected]> Sun, 1 Dec 2024 13:08:34 -0500
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
> On Dec 1, 2024, at 12:31=E2=80=AFPM, EML <[email protected]> =
wrote:
>=20
> This matches, among other things, a string which starts with a double =
quote, terminated by a newline, with no closing quote. Not even Basic =
can be that bad.

Sorry to be the bearer of bad news, but BASIC is precisely that bad. =
Since many PRINTs were constants and the only statement on the line, =
leaving these off the end of the line added up. They only had 786 bytes =
free on an IMSAI, every byte was precious.

FOCAL did the same thing, and in that case I have several common =
programs that did this, notably Hammurabi which didn't fit on a PDP-8 =
otherwise.

> This matches a single '.', '.E0', and so on.


Both are valid in MS dialects. This project has been surprisingly =
educational!

> And why have you got 'yytext+1'? If you're trying to get rid of the =
leading quote, you also need a code block to get rid of the closing =
quote.

yytext[strlen(yytext) - 1] =3D '\0';

Seems to do the trick, I'm definitely not getting trailing quotes in my =
strings, nor clipping the last char.

> And note that you only need one caret (^),

Fixed!

> This will probably require you to take into account the current =
context; see Hans's reply.

Yeah, I am completely new to that side of things. I'm in the bison dox =
now and I can't say I'm understanding much yet.

Hmmm, just noticed Mail is addressing this to people, not the list. =
Annoying.=