Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002107Core InformRules and rulebookspublic2019-09-27 11:272019-09-28 13:08
Reportermattweiner 
Assigned To 
PrioritynormalSeveritymildReproducibilityalways
StatusnewResolutionopen 
PlatformmacintoshOSmojaveOS Version10.14.6
Product Version6M62 
Target VersionFixed in Version 
Summary0002107: compiler accepts and ignores malformed when-clause
DescriptionWhen a rule heading contains a when-clause with "in" instead of "is," the clause compiles and is ignored instead of throwing an error.
Minimal Source Text To Reproduce
Cliff is a room. There is a chasm in the cliff. The chasm can be spanned or unspanned.

Ledges is north of Cliff.

Instead of going north when the chasm in unspanned, say "yadda yadd."

[note: should be "chasm is unspanned]
Additional InformationGenerated I6 code:

! Instead of going north when the chasm in unspanned:
[ R_766 ;
    if ((((action ==##Go) && (actor==player) && ((noun == I51_north) && (true)) && (self=actor,true) && (true)))) { ! Runs only when pattern matches
    self = noun;
    if (debug_rules) DB_Rule(R_766, 766);
    ! [2: say ~yadda yadd.~]
    say__p=1;! [3: ~yadda yadd.~]
    ParaContent(); print "yadda yadd."; new_line; .L_Say3; .L_SayX3;RulebookFails(); rtrue;
    } else if (debug_rules > 1) DB_Rule(R_766, 766, 'action');
    rfalse;
];

Forum thread: https://intfiction.org/t/is-this-a-known-bug-misfeature-in-i7-is-in-confusion/42595 [^]
TagsNo tags attached.
Effect(mild) Compiler accepts invalid code
Attached Files

- Relationships

-  Notes
(0004875)
zarf (developer)
2019-09-28 13:08

I played around with this but couldn't figure out what the compiler was thinking.

It's interpreting "...unspanned..." as "...an unspanned object..." That's a known (and normally desirable) quirk of the language. But the rest of the condition is compiling as (self=actor,true).

This seems to happen for rule conditions like "when X in Y" (with no linking verb). It *doesn't* seem to happen for conditions in an "if" statement.

- Issue History
Date Modified Username Field Change
2019-09-27 11:27 mattweiner New Issue
2019-09-28 13:08 zarf Note Added: 0004875


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker