Closed GoogleCodeExporter closed 8 years ago
The intent is to put strings that look like identifiers in pipes, so you can
tell the
difference between, e.g., the identifier S1 and the string S1. However, the
code to
do this is very sloppy, and simply assumes that any string that contains an
uppercase
character could be confused for an identifier, which clearly isn't true. I don't
think anyone would complain if this were cleaned up.
Original comment by marin...@gmail.com
on 21 Apr 2010 at 12:06
I see some lines at the end of the string testing function that's explicitly
testing
for identifiers:
if (isalpha(*ch)) {
/* --- is the rest of the string an integer? --- */
ch += 1;
while (isdigit(*ch)) ch++; /* string of digits */
if ((*ch==0)&&(isdigit(*(ch-1)))) *possible_id = TRUE;
}
So is the uppercase testing redundant and safely removable, or is there
something
else going on there?
Original comment by joseph...@gmail.com
on 21 Apr 2010 at 12:34
I don't know what else could be going on, but perhaps we should be careful.
Maybe
email soar-group to see if anyone would object to changing the behavior?
Original comment by marin...@gmail.com
on 21 Apr 2010 at 12:37
The rereadability junk, as you know, is only used when printed a string symbol
and
ensuring that, when read back by the lexer, it'll still be a string. For
example,
numbers stored as string, strings that look like ids, and strings that look like
variables. The upper case check is definitely bizarre. I'd wager this is a
vestigial
piece of code from long, long ago that everyone's afraid to "fix":
http://en.wikipedia.org/wiki/Symbol_%28Lisp%29
In Lisp, caps are treated specially in symbols so maybe that's where it came
from.
I say, only quote it if it looks like a different type (int, float, id) or
contains
non-constituent chars like spaces or anything that needs to be escaped.
Original comment by dave...@gmail.com
on 21 Apr 2010 at 1:13
This issue was closed by revision r11966.
Original comment by joseph...@gmail.com
on 21 Apr 2010 at 6:13
I've come up with a little test rule that shows how various strings are quoted.
A lot
of stuff aren't handled right.
Original comment by joseph...@gmail.com
on 21 Apr 2010 at 8:16
Attachments:
Original issue reported on code.google.com by
joseph...@gmail.com
on 20 Apr 2010 at 11:07