A slew of errors

I have been working on a rather long project. Recently, I moved into a new computer which has Windows 11 on it, so I thought it would be a good idea to update my Inform7 application to the latest version, ‘version 10 Inform’. So far so good. However, when I started to resume my work on my project, trying to run it with ‘Go’ so I could have an index to work with, I got a slew of error messages. I kind of expected that, but not so many, and these were errors for things that I had no trouble with on the version of Inform7 that I was using. An example–

Part of my piece takes place in a theatre where there are a number of private viewing boxes. Each of them has a door. Here is my Understand phrase for the door to Private Box Number One–

Understand "door number/no/#/-- one/#1/1" as pbonedoor.

Well, I was about to copy and paste the error messages, but the application won’t let me do that. But the messages were something to the effect of the parser not being able to understand digits, and that there must be an actual word or grammar token behind the ‘/’. Each one of the doors got error messages. With the previous version I was using, there were no such errors, and I was able to start testing my piece. Now I am trying to figure out how I can allow the player to refer to these doors using either digits or words for the door, and also the ‘#’ for ‘number’. (Each of these doors, in the piece, have the respective digit painted on it.)

I hope this conversion isn’t going to be a headache(!)(?)…

The “Settings” tab for your project has an option for “Language Version”. You can use that to switch back to an earlier version of the I7 compiler, while still using the same IDE.

2 Likes

That’s great, Andrew, thanks! But is it the only solution?

Thanks!

I set the compiler to the 6M62 version, the one that I used before. Of course it works!

Was one of the ‘fixes’ to disallow numeric references to objects, to avoid confusion between numerical names and amounts? Thanks again.

I can get this to compile in 6M62, but it doesn’t work as expected. I get:

>x door number one
You see nothing special about pbonedoor.

>x door #1
You can't see any such thing.

>x door # one
You see nothing special about pbonedoor.

>x door no 1
You can't see any such thing.

>x door # 1
You can't see any such thing.

>x door number 1
You can't see any such thing

It’s compiling, but not everything in your understand line is being parsed in the intended way, so it’s not really compiling correctly. This might be why the latest version is rejecting it. The error message in 10.1.2:

Problem. You wrote ‘Understand “door number/no/#/-- one/#1/1” as pbonedoor’ : but ‘understand’ uses a slash ‘/’ here in a way which cuts off something which contains only digits, and this will not do anything good. (Note that a slash in grammar like this means an alternative choice of word.)

tells us that using just having just a slash and a number (like /1) won’t work and in the version that compiles, it seems to be ignored. In other words, the syntax didn’t work before and was simply ignored (which isn’t really helpful) and now is illegal and rejected.

Thanks for your diligence. I haven’t tested that yet, myself, I was so absorbed in the writing. Yeah, each of the doors are privately-named. Apparently the possibilities that include digits are rejected. Hmm. But the ‘#’ symbol was not.

Well, it’s back to the drawing board…

You could try something along these lines:

1 Like

This comes down to the way the parser works. When it encounters a word, it first tries to look it up in the game’s dictionary. But numbers are never stored in the game’s dictionary—there are just too many of them out there! And a slash in an “Understand…” line means “look for either of these two dictionary entries”—which numbers never are.

BadParser’s solution is to instead tell Inform that this “1” is a number, not a dictionary word, so it should delegate to the parsing code that handles numbers. That should make everything work fine.

2 Likes

Good solution! I understand it perfectly, and see how it works.

I found another one–

Understand "one/#1", "door number/no/#/-- 1" as pbonedoor.  ["door number/no/#/--" was already set to go with the kind; it works along with the "one/#1"]

I just had to make a separate string with the number alone and no ‘/’, as Daniel mentioned.

Thank you so much for your diligence!

1 Like