Post Reply 
(free42) PGM Copy/Paste and @
03-20-2018, 12:06 PM
Post: #2
RE: (free42) PGM Copy/Paste and @
(03-20-2018 10:03 AM)Werner Wrote:  Free42 seems to recognize @ as a comment character - just like the DM42 encoder/decoder page does.
However, it does not work after a number that can be mistaken for a line number

Actually, it doesn't recognize any comment characters. Once it has parsed a complete command, it simply ignores whatever follows on the current line.

There are two cases where it's a bit more complicated: strings and numbers. Strings (including commands with string arguments) are tricky because double quote characters aren't escaped, so you can't just stop parsing when you see a second double quote character; you have to keep going until the end of the line, or until you reach the maximum string length, until you can be sure where the string ends.

Numbers are complicated because a number can be a line number, or it can be a number without a line number. The logic that chooses between these two cases could probably use some improvement. The way it works now, "1 @" is considered a numbered line with an unrecognized command, so it is skipped. It's not easy to see how this *should* work... one possibility that has crossed my mind is to require uniformity in line numbering, i.e. either all lines should have line numbers, or none of them. That still leaves an ambiguity if a program *starts* with an ambiguous line, but it would fix the ambiguities in most cases.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
(free42) PGM Copy/Paste and @ - Werner - 03-20-2018, 10:03 AM
RE: (free42) PGM Copy/Paste and @ - Thomas Okken - 03-20-2018 12:06 PM
RE: (free42) PGM Copy/Paste and @ - Werner - 03-20-2018, 01:50 PM
RE: (free42) PGM Copy/Paste and @ - Werner - 03-20-2018, 03:06 PM
RE: (free42) PGM Copy/Paste and @ - Werner - 03-21-2018, 04:09 PM

User(s) browsing this thread: 1 Guest(s)