Misleading preprocessor error message with character literals, especially within dialogs #2609
Labels
context: script compiler
type: bug
unexpected/erroneous behavior in the existing functionality
what: editor
related to the game editor
Describe the bug
I hit on a big snag in a game that has > 20 dialogs: When I compiled (F7), the system complained
Unterminated string
in file__DialogScripts.asc
, line 1384. I couldn't navigate to the error by double-clicking the message, so I was tasked with finding the rogue line in about 1500 lines of dialog that were distributed in 20 dialog "files". This was time consuming. (This aspect is reported in #2389.)When I found the rogue line at long last, it turned out to be the following:
Note the indentation, which turns the line into an AGS statement instead of a dialog line. The system found the
'
in ‘I've’ and complained about anUnterminated string
.It hadn't occurred to me at all that this might even be the problem: I had been looking for a missing
"
, not for a missing'
because the error message complained about a ‘string’.So at the end of the day, I lost a lot of time and nerves in locating and hunting down the wrong problem in a big bunch of big "files".
How can we better help AGS programmers that are stuck in this kind of situation? The cryptic message
Unterminated string
isn't it IMHO.AGS Version
AGS 4 branch, commit dfc68e2
Also happens within AGS 3.6.1
As far as I can see, the error message comes out of file preprocessor.cpp of the classic compiler, line 248 and/or file Preprocessor.cs of the Editor, line 391
To Reproduce
Steps to reproduce the behavior:
cEgo
The text was updated successfully, but these errors were encountered: