Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000398Core InformRules and rulebookspublic2010-11-07 17:012011-01-10 11:15
ReporterPoster 
Assigned Tograham 
PrioritynormalSeveritycriticalReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.5
Product Version6F95 
Target VersionFixed in Version6G60 
Summary0000398: Code Block Underflow in Chapter 22/Stack Frames.w from single-line "else if"
DescriptionThis is the error:

Problem. An internal error has occurred: code block underflow. The current sentence is 'Else if player is not in love seat, say "--."' ; the error was detected at line 1035 of "Chapter 22/Stack Frames.w". This should never happen, and I am now halting in abject failure.

----
Minimal Source Text To Reproduce
TestRoom is a Room.
When play begins:
	If true is true, say "--.";
	Else if true is true, say "--."
Additional InformationMaking the sofa and love seat containers instead of supporters, or if you surround the second condition in parenthesis makes no difference.
TagsNo tags attached.
Effect(critical) Compiler reports internal error
Attached Files

- Relationships
related to 0000557closedgraham Bogus errors when using both colon and comma forms within If statement. 

-  Notes
(0000803)
jmcgrew (administrator)
2010-11-08 14:47

Original test case gave a different error (maybe Mantis broke the formatting?). Confirmed with a shorter test case. The problem seems to be using "else if" in single-line form, not the content of the conditions.
(0000807)
Poster (reporter)
2010-11-09 19:19
edited on: 2010-11-10 18:17

Confirmed that there is a problem with else if in single-line form. The following code compiles:

TestRoom is a Room.
When play begins:
If true is true:
           Say "--.";
Else if true is true:
           Say "--.";

However, there is more to the error. This code does NOT compile (ordinary error):

Cell is a room.
Sofa is a container in Cell.
Love seat is a container in Cell.

Globe rules is a rulebook.
A globe rule (this is the first rule):
If (player is in sofa):
Say "--A.";
Else if (player is not in love seat):
Say "--B.";
Follow the globe rulebook.

(0000817)
jmcgrew (administrator)
2010-11-14 21:38

Mantis unfortunately doesn't show tabs in comments, but from the page source it looks like "Follow the globe rulebook" is not indented, so that it lines up with "A globe rule (this is the first rule)". That won't work, since it would logically mean that "Follow the globe rulebook" is outside the body of the rule (which is all indented with a single tab).

The code compiles correctly for me if indented as follows:

<code>
Cell is a room.
Sofa is a container in Cell.
Love seat is a container in Cell.

Globe rules is a rulebook.
A globe rule (this is the first rule):
[TAB] If (player is in sofa):
[TAB] [TAB] Say "--A.";
[TAB] Else if (player is not in love seat):
[TAB] [TAB] Say "--B.";
[TAB] Follow the globe rulebook.
</code>
(0000823)
Poster (reporter)
2010-11-16 17:44
edited on: 2010-11-16 17:57

I see the problem. I've been opening a new project, which places this code as the first line:

"<name of file>" by Poster

That first line should have a period at the end, which is a separate issue.

I retract the second example. It works for me.

(0000851)
graham (administrator)
2010-11-21 09:36

Inform was panicking while trying to produce a problem message. Fixed.

- Issue History
Date Modified Username Field Change
2010-11-07 17:01 Poster New Issue
2010-11-08 14:47 jmcgrew Note Added: 0000803
2010-11-08 14:47 jmcgrew Severity serious => critical
2010-11-08 14:47 jmcgrew Status new => confirmed
2010-11-08 14:47 jmcgrew Steps to Reproduce Updated View Revisions
2010-11-09 19:20 Poster Note Added: 0000807
2010-11-09 19:20 Poster Note Edited: 0000807 View Revisions
2010-11-10 18:17 Poster Note Edited: 0000807 View Revisions
2010-11-14 21:38 jmcgrew Note Added: 0000817
2010-11-16 17:44 Poster Note Added: 0000823
2010-11-16 17:44 Poster Note Edited: 0000823 View Revisions
2010-11-16 17:45 Poster Note Edited: 0000823 View Revisions
2010-11-16 17:57 Poster Note Edited: 0000823 View Revisions
2010-11-19 00:44 jmcgrew Summary Code Block Underflow in First Rule in Rulebook That Uses If and Else If / Chapter 22 Stacks Frame.w => Code Block Underflow in Chapter 22/Stack Frames.w from single-line "else if"
2010-11-21 09:36 graham Note Added: 0000851
2010-11-21 09:36 graham Status confirmed => resolved
2010-11-21 09:36 graham Resolution open => fixed
2010-11-21 09:36 graham Assigned To => graham
2010-12-23 17:37 jmcgrew Fixed in Version => 6G60
2011-01-10 11:15 jmcgrew Status resolved => closed
2011-02-13 21:56 EmacsUser Relationship added related to 0000557


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker