help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unquoted strings in BASIC


From: Maury Markowitz
Subject: Re: Unquoted strings in BASIC
Date: Sun, 1 Dec 2024 13:08:34 -0500

> On Dec 1, 2024, at 12:31 PM, EML <eml-bison@cyconix.com> wrote:
> 
> 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] = '\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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]