1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-03 07:24:58 +03:00

Fix and test case for Mantis bug 1979

This commit is contained in:
Graham Nelson 2022-04-10 15:54:11 +01:00
parent 8af83ace5a
commit 76ae1a9083
3 changed files with 34 additions and 0 deletions

View file

@ -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!.

View file

@ -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.

View file

@ -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> ::=
@ -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));