[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: |
Wed, 4 Dec 2024 16:30:41 -0500 |
To top this thread off, I went with this:
/* DATA statements convert everything to a string */
<DATA_STATEMENT>{
[^,:\n]* {
// eat any leading and trailing whitespace
yytext = str_trim(yytext);
// and quotes
yytext = str_unquote(yytext);
yylval.s = str_new(yytext);
return STRING;
}
[,] { return ','; } // triggers the exprlist syntax
/* colons or line-ends end the data statement and reset the state */
[:] { BEGIN(INITIAL); return ':'; }
[\n] { BEGIN(INITIAL); return '\n'; }
}
It's worked with everything I've thrown at it from every book I could find.
Hans noted that it would be best to do this in the patterns, and I agree, but
working is a feature!
Now I just have to get my matrix inversion working and we're good to release.
- Re: Unquoted strings in BASIC, (continued)
- Re: Unquoted strings in BASIC, James K. Lowden, 2024/12/01
- Re: Unquoted strings in BASIC, Maury Markowitz, 2024/12/01
- Re: Unquoted strings in BASIC, Hans Åberg, 2024/12/02
- Re: Unquoted strings in BASIC, James K. Lowden, 2024/12/02
- Re: Unquoted strings in BASIC, Hans Åberg, 2024/12/02
- Re: Unquoted strings in BASIC, Maury Markowitz, 2024/12/03
- Re: Unquoted strings in BASIC, Hans Åberg, 2024/12/03
- Re: Unquoted strings in BASIC, James K. Lowden, 2024/12/04
- Re: Unquoted strings in BASIC, Hans Åberg, 2024/12/04
- Re: Unquoted strings in BASIC,
Maury Markowitz <=