Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • inform6lib inform6lib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • David Griffith
  • inform6libinform6lib
  • Issues
  • #124
Closed
Open
Issue created Aug 13, 2021 by Fredrik Ramsberg@framsberg

Broken specification + code for grammar property

The Inform 6 standard library tries to distinguish between the return values 'verb' and -'verb' from a grammar property routine. Here's the library code, for Z-code (line 1707 in parser.h):

        if ((i ~= 0 or 1) &&
            (UnsignedCompare(i, dict_start) < 0 ||
             UnsignedCompare(i, dict_end) >= 0 ||
             (i - dict_start) % dict_entry_size ~= 0)) {
            usual_grammar_after = j;
            i=-i;
        }

If the dictionary spans the $8000 mark, and the first word in the dictionary starts at address a where ($8000 - a) % dict_entry_size == 0, the test to see if the value is a negative dictionary word may fail.

I suggested fixing this in the compiler, which is ugly but the only way to not change the specification of how the routine should work. Andrew Plotkin thinks the change should be done in the library though. Here's the ticket: https://github.com/DavidKinder/Inform6/issues/130

Changing the specification so the routine returns 'verb'+1 instead of -'verb', and changing the code accordingly, should do the trick. I can't see a way to fix this without making a breaking change.

Edited Aug 13, 2021 by Fredrik Ramsberg
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking