Skip to content

Commit

Permalink
Fix and test case for Mantis bug 1979
Browse files Browse the repository at this point in the history
  • Loading branch information
ganelson committed Apr 10, 2022
1 parent 8af83ac commit 76ae1a9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inform7/Tests/Test Problems/PM_NoSuchVerbNumberedColon.txt
@@ -0,0 +1,5 @@
Lab is a room.

To (X - a number) be praised!: say X.

To recite a hymn to 3: 3 be praised!.
@@ -0,0 +1,15 @@
Inform 7 v10.1.0 has started.
I've now read your source text, which is 22 words long.
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
I've also read Standard Rules by Graham Nelson, which is 32092 words long.
Problem__ PM_NoSuchVerbNumberedColon
>--> In the sentence 'To recite a hymn to 3: 3 be praised !' (source text, line 5),
I can't find a verb that I know how to deal with. I notice there's a colon
':' with a number either side of it - this might have led to confusion
because the usual convention that ':' divides a rule or phrase from its
definition does not apply in this case, to avoid potential confusion with
times of day like '2:15 PM'. If you put a line break after the ':' and
before the second number, though, you can make sure I'm definitely reading
it as punctuation.
Inform 7 has finished.
14 changes: 14 additions & 0 deletions inform7/assertions-module/Chapter 2/Classifying Sentences.w
Expand Up @@ -209,6 +209,7 @@ this, a problem message of some kind will certainly result.
before/every/after/when/instead/check/carry/report ... | ==> @<Issue PM_RuleWithoutColon problem@>
if ... | ==> @<Issue PM_IfOutsidePhrase problem@>
... , ... | ==> @<Issue PM_NoSuchVerbComma problem@>
... <cardinal-number> : <cardinal-number> ... | ==> @<Issue PM_NoSuchVerbNumberedColon problem@>
... ==> @<Issue PM_NoSuchVerb problem@>

<no-primary-verb-diagnosis-tail> ::=
Expand Down Expand Up @@ -250,6 +251,19 @@ this, a problem message of some kind will certainly result.
"have been a colon ':'?)");
Problems::issue_problem_end();

@<Issue PM_NoSuchVerbNumberedColon problem@> =
Problems::quote_source(1, current_sentence);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_NoSuchVerbNumberedColon));
Problems::issue_problem_segment(
"In the sentence %1, I can't find a verb that I know how to deal with. "
"I notice there's a colon ':' with a number either side of it - this might "
"have led to confusion because the usual convention that ':' divides a "
"rule or phrase from its definition does not apply in this case, to avoid "
"potential confusion with times of day like '2:15 PM'. If you put a line "
"break after the ':' and before the second number, though, you can make "
"sure I'm definitely reading it as punctuation.");
Problems::issue_problem_end();

@<Issue PM_NoSuchVerb problem@> =
Problems::quote_source(1, current_sentence);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_NoSuchVerb));
Expand Down

0 comments on commit 76ae1a9

Please sign in to comment.