1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-02 23:14:57 +03:00

Fix for Mantis bug 1838

This commit is contained in:
Graham Nelson 2022-04-12 13:01:01 +01:00
parent ce8014cfc5
commit 6e04553d9d
5 changed files with 75 additions and 37 deletions

View file

@ -1,33 +1,37 @@
100.0% in inform7 run 100.0% in inform7 run
68.8% in compilation to Inter 67.8% in compilation to Inter
47.8% in //Sequence::undertake_queued_tasks// 47.3% in //Sequence::undertake_queued_tasks//
4.5% in //MajorNodes::pre_pass// 4.6% in //MajorNodes::pre_pass//
3.4% in //MajorNodes::pass_1// 3.3% in //MajorNodes::pass_1//
2.4% in //RTPhrasebook::compile_entries// 2.2% in //RTPhrasebook::compile_entries//
1.8% in //ImperativeDefinitions::assess_all// 1.9% in //ImperativeDefinitions::assess_all//
1.5% in //RTKindConstructors::compile// 1.5% in //RTKindConstructors::compile//
1.1% in //Sequence::lint_inter// 1.0% in //Sequence::lint_inter//
0.5% in //ImperativeDefinitions::compile_first_block//
0.5% in //MajorNodes::pass_2// 0.5% in //MajorNodes::pass_2//
0.5% in //Sequence::undertake_queued_tasks//
0.5% in //World::stage_V// 0.5% in //World::stage_V//
0.3% in //Sequence::undertake_queued_tasks// 0.4% in //ImperativeDefinitions::compile_first_block//
0.1% in //CompletionModule::compile// 0.4% in //Sequence::undertake_queued_tasks//
0.4% in //Sequence::undertake_queued_tasks//
0.2% in //CompletionModule::compile//
0.2% in //RTKindConstructors::compile_permissions//
0.1% in //InferenceSubjects::emit_all// 0.1% in //InferenceSubjects::emit_all//
0.1% in //RTKindConstructors::compile_permissions//
0.1% in //Task::make_built_in_kind_constructors// 0.1% in //Task::make_built_in_kind_constructors//
0.1% in //Understand::traverse//
0.1% in //World::stages_II_and_III// 0.1% in //World::stages_II_and_III//
2.4% not specifically accounted for 2.1% not specifically accounted for
28.4% in running Inter pipeline 29.3% in running Inter pipeline
10.2% in step 14/15: generate inform6 -> auto.inf 10.2% in step 14/15: generate inform6 -> auto.inf
7.5% in step 5/15: load-binary-kits 7.7% in step 5/15: load-binary-kits
6.4% in step 6/15: make-synoptic-module 6.6% in step 6/15: make-synoptic-module
1.5% in step 9/15: make-identifiers-unique 1.5% in step 9/15: make-identifiers-unique
0.3% in step 12/15: eliminate-redundant-operations 0.4% in step 12/15: eliminate-redundant-operations
0.3% in step 4/15: compile-splats 0.4% in step 4/15: compile-splats
0.3% in step 7/15: shorten-wiring 0.4% in step 7/15: shorten-wiring
0.3% in step 8/15: detect-indirect-calls 0.3% in step 8/15: detect-indirect-calls
0.1% in step 11/15: eliminate-redundant-labels 0.2% in step 11/15: eliminate-redundant-labels
0.9% not specifically accounted for 0.1% in step 10/15: reconcile-verbs
2.2% in supervisor 0.1% in step 2/15: parse-insertions
0.1% in step 3/15: resolve-conditional-compilation
0.7% not specifically accounted for
2.3% in supervisor
0.4% not specifically accounted for 0.4% not specifically accounted for

View file

@ -0,0 +1,4 @@
Home is a room.
Use sequential action translates as (- Constant SEQUENTIAL_ACTION; -).
Use sequential action translates as (- Constant ASEQUENTIAL_ACTION; -).

View file

@ -0,0 +1,12 @@
Inform 7 v10.1.0 has started.
I've now read your source text, which is 18 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_UODuplicate
>--> In 'Use sequential action translates as (- Constant ASEQUENTIAL_ACTION;
-)' (source text, line 4), you define a use option 'sequential action', but
that has already been defined, and with a different meaning: 'Use
sequential action translates as (- Constant SEQUENTIAL_ACTION; -)' (source
text, line 3).
Inform 7 has finished.

View file

@ -79,22 +79,38 @@ typedef struct use_option {
wording SP = Node::get_text(V->next); wording SP = Node::get_text(V->next);
wording OP = Node::get_text(V->next->next); wording OP = Node::get_text(V->next->next);
<use-setting>(SP); /* always passes */ <use-setting>(SP); /* always passes */
int N = <<r>>; int N = <<r>>; if (N < 0) N = -1;
use_option *uo = CREATE(use_option); wording UOW = GET_RW(<use-setting>, 1);
uo->name = GET_RW(<use-setting>, 1); use_option *existing_uo = NewUseOptions::parse_uo(UOW);
uo->expansion = OP; if (existing_uo) {
uo->option_used = FALSE; if ((Wordings::match(OP, existing_uo->expansion) == FALSE) ||
uo->minimum_setting_value = (N >= 0) ? N : -1; (N != existing_uo->minimum_setting_value)) {
uo->source_file_scoped = FALSE; Problems::quote_source(1, current_sentence);
uo->notable_option_code = -1; Problems::quote_wording(2, UOW);
if (<notable-use-option-name>(uo->name)) uo->notable_option_code = <<r>>; Problems::quote_source(3, existing_uo->where_created);
if (uo->notable_option_code == AUTHORIAL_MODESTY_UO) uo->source_file_scoped = TRUE; StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_UODuplicate));
uo->where_used = NULL; Problems::issue_problem_segment(
uo->where_created = current_sentence; "In %1, you define a use option '%2', but that has already been "
uo->compilation_data = RTUseOptions::new_compilation_data(uo); "defined, and with a different meaning: %3.");
Nouns::new_proper_noun(uo->name, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT, Problems::issue_problem_end();
MISCELLANEOUS_MC, Rvalues::from_use_option(uo), Task::language_of_syntax()); }
} else {
use_option *uo = CREATE(use_option);
uo->name = UOW;
uo->expansion = OP;
uo->option_used = FALSE;
uo->minimum_setting_value = N;
uo->source_file_scoped = FALSE;
uo->notable_option_code = -1;
if (<notable-use-option-name>(uo->name)) uo->notable_option_code = <<r>>;
if (uo->notable_option_code == AUTHORIAL_MODESTY_UO) uo->source_file_scoped = TRUE;
uo->where_used = NULL;
uo->where_created = current_sentence;
uo->compilation_data = RTUseOptions::new_compilation_data(uo);
Nouns::new_proper_noun(uo->name, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT,
MISCELLANEOUS_MC, Rvalues::from_use_option(uo), Task::language_of_syntax());
}
@ Having registered the use option names as miscellaneous, we need to parse @ Having registered the use option names as miscellaneous, we need to parse
them back that way too: them back that way too:

View file

@ -17965,6 +17965,8 @@ then instead the I6 inclusion becomes:
The I6 constant MAX_PRESENTED_FOOTNOTES can then be used as the size of an array, for instance. The I6 constant MAX_PRESENTED_FOOTNOTES can then be used as the size of an array, for instance.
Finally, note that it is legal to define the same use option more than once, but only if it has exactly the same meaning each time it is defined. (This is allowed so that multiple extensions all needing the same definition can safely make it, and still be used together.)
[x] Longer extracts of Inform 6 code [x] Longer extracts of Inform 6 code
^^{Inform 6 inclusions: long sections of code} ^^{Inform 6 inclusions: long sections of code}