intfiction.org

The Interactive Fiction Community Forum
It is currently Tue Jan 15, 2019 10:12 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Dec 26, 2018 5:24 am 
Offline

Joined: Mon Dec 30, 2013 4:55 am
Posts: 122
It's hard to explain what's going on with Bocfel and abbreviation 'x//':
If the grammar is verb 'x//' * -> Examine or verb 'x//' 'exam' * -> Examine, and I input >x:
DicWord(1), return 0 (what is wrong!)
But if the grammar is verb 'x//' 'examine' * -> Examine, and I input >x:
DicWord(1), return a value greater than 0.
Under Frotz (David Griffith) or WindowsFrotz, all works fine, the value is always greater than 0.
Code:
Constant INPUT_BUFFER_LEN = WORDSIZE + 16;
Constant MAX_BUFFER_WORDS = 1;

Array buffer -> INPUT_BUFFER_LEN + 1;
Array parse buffer (MAX_BUFFER_WORDS * 4) + 3;

[ DicWord w; return parse-->(w * 2 - 1); ];
[ NumWord; return parse->1; ];

[ Main   w;
   buffer->0 = INPUT_BUFFER_LEN - WORDSIZE;
   parse->0 = MAX_BUFFER_WORDS;
   while(1) {
      .FreshInput;
      print "^>";
      read buffer parse;
      if ( NumWord() == 0 )
         jump FreshInput;
      w = DicWord(1);
      if (w && w == 'quit') break;
      print w,"^";
   }
];

[ ExamineSub; ];
!verb 'x//' * -> Examine;
verb 'x//' 'exam' * -> Examine;
!verb 'x//' 'examine' * -> Examine;
verb 'x//' 'exam' * -> Examine:
Quote:
> x
0
> exam
1305
>
verb 'x//' 'examine' * -> Examine:
Quote:
> x
1305
> examine
1305
>
'x' is greater than 0 but equal to 'examine' (which is not the case with other interpreters!?)
Can anyone try to reproduce these mistakes?


Last edited by auraes on Wed Dec 26, 2018 5:58 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Dec 26, 2018 5:46 am 
Offline

Joined: Mon Dec 30, 2013 4:55 am
Posts: 122
You can try with library. Just remove or rename, in grammar.h, 'examine' to 'exam':
Code:
!% +Language_name=english
Include "parser";
Include "verblib";

Object here "Here or anywhere"
   with description "You are somewhere.",
   has light;

object ball "ball" here
   with name 'ball',
   description "A red ball.";

[ Initialise; location = here; ];
Include "grammar";
Quote:
Release 1 / Serial number 181226 / Inform v6.34 Library v6.12.3pre S

Here or anywhere
You are somewhere.

You can see a ball here.

> x ball
That’s not a verb I recognise.

> exam ball
A red ball.

>
'x//' is not recognized.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Dec 26, 2018 9:00 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2576
Bocfel automatically rewrites abbreviations before the game gets access to it:

Quote:
Many games include abbreviations for commonly-used commands: x for EXAMINE, g for AGAIN, z for WAIT, and o for OOPS. Some early Infocom games, however, do not provide these. For these Infocom games, x, g, z, and o are mapped to their respective commands, providing convenient shortcuts for games that don't provide them. If a game requires one of these letters for its own use, these abbreviations can be turned off with -x.


Perhaps it would be better if it detected modern games (or tried to based on the serial number) and disabled this.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Dec 26, 2018 10:23 am 
Offline

Joined: Mon Dec 30, 2013 4:55 am
Posts: 122
Oh, thanks... I didn't know that!
It's an option, maybe it would be better to reverse it: turned on abbreviations with -x for old game and nothing for recent game.
Can the interpreter change the way Inform works?
For me, it's like a bug: Interpreter must not return 0 if 'x//' is in the grammar and in the dictionary.


Last edited by auraes on Thu Dec 27, 2018 1:21 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Dec 26, 2018 1:19 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5880
Quote:
Perhaps it would be better if it detected modern games (or tried to based on the serial number) and disabled this.


Obviously you mean it should try to detect *old* games. :) The list of Z-code games which don't support "X" for "EXAMINE" -- but should -- is just the Infocom canon, right?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Dec 26, 2018 5:57 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2576
You're right. In fact Bocfel already has a big list of Infocom V1-4 games, would that be all of them, or would it need the version 5 games to be added as well? https://github.com/garglk/garglk/blob/m ... erp.c#L203

Actually, this code makes it look like the abbreviation expansion should only be applying to Infocom games anyway: https://github.com/garglk/garglk/blob/2 ... ict.c#L207

Added 4 years ago, but after the last release of Gargoyle.

auraes are you using the Bocfel from Gargoyle? We really need to do another release of Gargoyle. It's 7 years old now!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Dec 27, 2018 1:33 am 
Offline

Joined: Mon Dec 30, 2013 4:55 am
Posts: 122
Dannii wrote:
auraes are you using the Bocfel from Gargoyle?
Yes, from my linux distribution software repository (Gargoyle, version 2011.1b-1).


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group