In the last case I looked at, described in the previous blog post, this was an ambiguous parse case: the same line of code was valid if you added the missing comma or not, but it was interpreted two totally different ways. The newline between the second and third arguments makes it easy to miss, but as soon as we put it all together it becomes obvious. The problem is with how the arguments are passed to FileIO: the first two arguments are separated by a comma, but the second and third aren’t. In this form, the error is a bit more obvious than when it was spread across multiple lines. Set DiskChk = FileIO(mnew,"read" "The Source:Put Contents on Hard Drive:Journey to the Source:YZ.DATA") If we do the work of the preprocessor/lexer ourselves, we get this copy of the line: The error message above contains a version of the line between those two steps: the preprocessor has combined the two lines of code into one, but the continuation marker hasn’t been replaced with a space yet. Afterwards, in the lexer, it replaces the marker with a space to produce a single normal line of code. In a preprocessor phase, it removes the newline after the marker in order to simplify parsing later. ScummVM handles the continuation marker in two phases. Spoiler: it turned out not to be an issue with the continuation marker, but it pointed me in the right direction anyway. The continuation marker is a special kind of escape character with one specific purpose: it escapes newlines to allow statements to extend across more than one line of code, and nothing else.Īt first I thought maybe the issue was with the continuation marker itself being misparsed, like in the error I documented in that older blog post maybe it was failing to be recognized and wasn’t being replaced with whitespace? To figure that out, I started digging around in ScummVM’s Lingo preprocessor. The symbol at the end of that first line is a continuation marker, which you might remember from a previous blog post where I debugged a different issue with them. "The Source:Put Contents on Hard Drive:Journey to the Source:YZ.DATA")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |