|Anonymous | Login | Signup for a new account||2018-12-18 07:40 PST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000557||Core Inform||Assertions and creations||public||2011-02-12 17:06||2014-05-07 07:34|
|Platform||x86||OS||Mac OS X||OS Version||10.5|
|Target Version||Fixed in Version||6L02|
|Summary||0000557: Bogus errors when using both colon and comma forms within If statement.|
|Description||The included code generates two errors. The first is bogus and should not be stated, as the problem is not indentions at all. |
The second error is incorrect, as well, because the code causing the problem is not "Whee!...", it is "If the phone is blue,..."
These seem to indicate a problem with Inform's parsing of if/else if statements.
|Minimal Source Text To Reproduce|
Every turn: If (turn count is three): Now phone is silent; [Display phone status.] If the phone is ringing: If the phone is blue, say "Uh oh. Code blue. Better answer it."; Else if phone is green: Say "Whee! You know that Ziggberry is calling!"; Defecatory is a room. Phone is in Defecatory. Phone can be ringing or silent. Phone is ringing. Phone can be green, blue, or purple at random.
|Additional Information||Problem. You wrote 'Else if phone is green' : but this seems to be misplaced since it is not placed within an 'if', as it must be. An 'otherwise' must be vertically underneath the 'if' to which it corresponds, at the same indentation.|
Problem. The phrase or rule definition 'Every turn' is written using the 'colon and indentation' syntax for its 'if's, 'repeat's and 'while's, where blocks of phrases grouped together are indented one tab step inward from the 'if ...:' or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can't determine the structure. The first phrase going awry in the definition seems to be 'Say "Whee! You know that Ziggberry is calling!"' , in case that helps.
|Tags||No tags attached.|
|Effect||(cosmetic) Error message is badly worded|
Jim Aikin (reporter)
This problem is caused by Inform's attempt to allow more fluid English syntax using a comma after an if. The problem is in the line, "If the phone is blue, say...." Following an if with a comma is only allowed (I believe) if the rule is a simple one and that's the end of it.
The error messages are misleading. As a suggestion, the code structure shown should be allowed. Alternatively, the compiler should detect the true source of the problem and issue a better error message.
Are cosmetic issues ever addressed (aside from documentation)? Two errors are generated where one will suffice.
Yes, it would be better if Inform just didn't care about the comma vs. colon distinction at all.
As the Inform language currently stands, the first problem message is correct: the ``else'' is in fact not within the ``if,'' as Jim pointed out in the comments. The suggestion to allow this syntax is a feature request, so it should be placed on UserVoice rather than Mantis. But I can confirm the bug that the problem messages are misleading in these circumstances.
|Both problem messages are correctly issued, but the first is misleading. I've fixed this.|
|2011-02-12 17:06||Poster||New Issue|
|2011-02-12 17:19||Jim Aikin||Note Added: 0001014|
|2011-02-12 18:35||jmcgrew||Effect||(mild) Compiler accepts invalid code => (cosmetic) Error message is badly worded|
|2011-02-12 18:35||jmcgrew||Severity||mild => cosmetic|
|2011-02-12 18:56||jmcgrew||Status||new => acknowledged|
|2011-02-13 05:32||Poster||Note Added: 0001017|
|2011-02-13 21:56||EmacsUser||Relationship added||related to 0000398|
|2011-02-16 15:29||EmacsUser||Note Added: 0001034|
|2011-02-16 15:29||EmacsUser||Status||acknowledged => confirmed|
|2011-10-15 03:30||graham||Note Added: 0001366|
|2011-10-15 03:30||graham||Status||confirmed => resolved|
|2011-10-15 03:30||graham||Resolution||open => fixed|
|2011-10-15 03:30||graham||Assigned To||=> graham|
|2011-11-02 13:00||EmacsUser||Relationship added||has duplicate 0000786|
|2011-11-02 13:01||EmacsUser||Relationship deleted||has duplicate 0000786|
|2014-05-07 07:34||jmcgrew||Fixed in Version||=> 6L02|
|2014-05-07 07:34||jmcgrew||Status||resolved => closed|
|Copyright © 2000 - 2010 MantisBT Group|