From 9a41dfadbdeab4b159d2ea5fffe7635ffaa3ce54 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Sat, 27 Apr 2019 21:11:52 +0100 Subject: [PATCH] Compiled simplest template routines to pure Inter --- docs/codegen-module/2-alm.html | 52 +++++++++++--- docs/codegen-module/2-lnk.html | 2 +- docs/codegen-module/3-is.html | 27 +++++-- docs/codegen-module/4-cg.html | 52 +++++++------- docs/core-module/12-is.html | 2 +- docs/core-module/25-cii.html | 4 +- docs/core-module/27-ei.html | 7 +- docs/core-module/27-eis.html | 71 +++++++++++++------ docs/core-module/27-hr.html | 38 ++++------ docs/core-module/27-in.html | 2 +- docs/core-module/27-pc.html | 6 +- docs/if-module/5-gp.html | 1 + docs/inter-module/2-bkm.html | 2 - docs/inter-module/3-ca.html | 2 + inform7/core-module/Chapter 12/I6 Schemas.w | 2 +- .../Chapter 25/Compile Invocations Inline.w | 4 +- inform7/core-module/Chapter 27/Emit.w | 5 ++ .../Chapter 27/Emitting Inter Schemas.w | 71 +++++++++++++------ inform7/core-module/Chapter 27/Hierarchy.w | 34 ++++----- .../if-module/Chapter 5/Grammar Properties.w | 1 + inter/codegen-module/Chapter 2/Assimilate.w | 46 ++++++++++-- .../codegen-module/Chapter 3/Inter Schemas.w | 27 +++++-- .../Chapter 4/Code Generation.w | 50 +++++++------ inter/inter-module/Chapter 2/Bookmarks.w | 2 - .../Chapter 3/Canonical Annotations.w | 2 + 25 files changed, 333 insertions(+), 179 deletions(-) diff --git a/docs/codegen-module/2-alm.html b/docs/codegen-module/2-alm.html index 6f355e67c..608f521c0 100644 --- a/docs/codegen-module/2-alm.html +++ b/docs/codegen-module/2-alm.html @@ -57,6 +57,7 @@ case DEFAULT_PLM: case CONSTANT_PLM: case FAKEACTION_PLM: + case OBJECT_PLM: case VERB_PLM: if (unchecked_kind_symbol) <Assimilate definition 1.1>; break; @@ -143,11 +144,15 @@ identifier = Str::new(); WRITE_TO(identifier, "##%S", old); } + if (switch_on == OBJECT_PLM) value = NULL; if (switch_on != DEFAULT_PLM) { - LOG("Assum identifier is %S\n", identifier); inter_symbol *con_name = CodeGen::Assimilate::maybe_extern(I, identifier, into_scope); Inter::Symbols::annotate_i(I, con_name, ASSIMILATED_IANN, 1); + if (switch_on == FAKEACTION_PLM) + Inter::Symbols::annotate_i(I, con_name, FAKE_ACTION_IANN, 1); + if (switch_on == OBJECT_PLM) + Inter::Symbols::annotate_i(I, con_name, OBJECT_IANN, 1); if (con_name->equated_to) { inter_symbol *external_name = con_name->equated_to; @@ -159,19 +164,13 @@ switch (switch_on) { case CONSTANT_PLM: - <Assimilate a value 1.1.2>; - CodeGen::Link::guard(Inter::Constant::new_numerical(&ib, - Inter::SymbolsTables::id_from_symbol(I, outer, con_name), - Inter::SymbolsTables::id_from_symbol(I, outer, unchecked_kind_symbol), v1, v2, - baseline, NULL)); - break; case FAKEACTION_PLM: + case OBJECT_PLM: <Assimilate a value 1.1.2>; CodeGen::Link::guard(Inter::Constant::new_numerical(&ib, Inter::SymbolsTables::id_from_symbol(I, outer, con_name), Inter::SymbolsTables::id_from_symbol(I, outer, unchecked_kind_symbol), v1, v2, baseline, NULL)); - LOG("So FAPLM made $3\n", con_name); break; case GLOBAL_PLM: <Assimilate a value 1.1.2>; @@ -339,7 +338,7 @@

-

This code is used in §1.1 (four times).

+

This code is used in §1.1 (three times).

§1.2. <Assimilate routine 1.2> = @@ -397,6 +396,7 @@ var_count++; inter_symbol *loc_name = Inter::SymbolsTables::create_with_unique_name(Inter::Package::local_symbols(block_name), value); + Inter::Symbols::local(loc_name); CodeGen::Link::guard(Inter::Local::new(&ib, block_name, loc_name, unchecked_kind_symbol, 0, baseline+1, NULL)); DISCARD_TEXT(value); @@ -415,7 +415,7 @@ while ((L>0) && (Str::get_at(body, L) != ']')) L--; while ((L>0) && (Characters::is_whitespace(Str::get_at(body, L-1)))) L--; Str::truncate(body, L); - CodeGen::Link::entire_splat(&ib, NULL, body, baseline+2, block_name); + CodeGen::Assimilate::routine_body(&ib, block_name, baseline+2, body); } CodeGen::Link::guard(Inter::Label::new(&ib, block_name, end_name, baseline+1, NULL)); @@ -726,6 +726,36 @@ DISCARD_TEXT(NN); return mcc_name; } + + int rb_splat_count = 1; + void CodeGen::Assimilate::routine_body(inter_reading_state *IRS, inter_symbol *block_name, inter_t offset, text_stream *body) { + if (Str::is_whitespace(body)) return; + if (Str::len(body) < 20) { + LOG("=======\n\nCandidate (%S): '%S'\n\n", block_name->symbol_name, body); + inter_schema *sch = InterSchemas::from_text(body, FALSE, 0, NULL); + + if (sch == NULL) LOG("NULL SCH\n"); + else if (sch->node_tree == NULL) { + LOG("Lint fail: Non-empty text but empty scheme\n"); + internal_error("inter schema empty"); + } else InterSchemas::log(sch); + + #ifdef CORE_MODULE + current_inter_routine = block_name; + Packaging::set_state(IRS, Packaging::enclosure()); + Emit::push_code_position(Emit::new_cip(IRS)); + value_holster VH = Holsters::new(INTER_VOID_VHMODE); + inter_symbols_table *scope1 = Inter::Package::local_symbols(block_name); + inter_symbols_table *scope2 = Inter::Packages::scope(Packaging::incarnate(Hierarchy::template())); + EmitInterSchemas::emit(&VH, sch, NULL, TRUE, FALSE, scope1, scope2, NULL, NULL); + Emit::pop_code_position(); + current_inter_routine = NULL; + return; + #endif + } + CodeGen::Link::entire_splat(IRS, NULL, body, offset, block_name); + LOG("Splat %d\n", rb_splat_count++); + }

@@ -744,6 +774,8 @@

The function CodeGen::Assimilate::computed_constant_symbol appears nowhere else.

+

The function CodeGen::Assimilate::routine_body is used in §1.2.

+

diff --git a/docs/codegen-module/2-lnk.html b/docs/codegen-module/2-lnk.html index 451d0cd08..0fb36334a 100644 --- a/docs/codegen-module/2-lnk.html +++ b/docs/codegen-module/2-lnk.html @@ -132,7 +132,7 @@

The function CodeGen::Link::guard is used in 2/alm (§1.1, §1.2, §3), 3/ip (§2).

-

The function CodeGen::Link::entire_splat is used in §2, 2/alm (§1.2).

+

The function CodeGen::Link::entire_splat is used in §2, 2/alm (§3).

§2.

diff --git a/docs/codegen-module/3-is.html b/docs/codegen-module/3-is.html index d0ee9140a..4636942ba 100644 --- a/docs/codegen-module/3-is.html +++ b/docs/codegen-module/3-is.html @@ -295,8 +295,8 @@ compilation process, and never survive into the final schema:
     enum RAW_ISTT from 1    something unidentified as yet
     enum WHITE_SPACE_ISTT			    a stretch of white space
-    enum RESERVED_ISTT				    am I6 reserved word such as while
-    enum OPERATOR_ISTT				    an I6 operator such as --> or +
+    enum RESERVED_ISTT			    am I6 reserved word such as while
+    enum OPERATOR_ISTT			    an I6 operator such as --> or +
     enum DIVIDER_ISTT				    a semicolon used to divide I6 statements
     enum OPEN_ROUND_ISTT			    open round bracket
     enum CLOSE_ROUND_ISTT			    close round bracket
@@ -541,7 +541,8 @@ we go to some trouble here.
 
 
     void InterSchemas::log(inter_schema *sch) {
-        if (sch == NULL) LOG("<null schema>");
+        if (sch == NULL) LOG("<null schema>\n");
+        else if (sch->node_tree == NULL) LOG("<schema without nodes>\n");
         else InterSchemas::log_depth(sch->node_tree, 0);
     }
 
@@ -866,6 +867,7 @@ for instance, we could simply have defined:
 
         <Begin the schema as a single expression node with a linked list of tokens 20.2>;
         <Perform transformations to grow the tree and reduce the token count 20.4>;
+
         InterSchemas::lint(sch);
 
         if ((Log::aspect_switched_on(SCHEMA_COMPILATION_DA)) ||
@@ -1521,6 +1523,7 @@ language opcodes such as @pull
         int monograph = TRUE, digraph = FALSE, trigraph = FALSE;
         if ((Characters::isalnum(c1)) || (c1 == '_')) monograph = FALSE;
+        if ((c1 == '#') && (Characters::isalpha(c2))) monograph = FALSE;
         if ((c1 == '@') && (Characters::isalpha(c2))) monograph = FALSE;
 
         if ((c1 == '+') && (c2 == '+')) digraph = TRUE;
@@ -1617,6 +1620,15 @@ inclusive; we ignore an empty token.
 
 
         if (Str::get_at(T, 0) == '@') is = OPCODE_ISTT;
+        if ((Str::get_at(T, 0) == '#') && (Characters::isalpha(Str::get_at(T, 1)))) {
+            is = IDENTIFIER_ISTT;
+            LOOP_THROUGH_TEXT(P, T) {
+                int c = Str::get(P);
+                if ((c != '_') && (c != '#') && (!Characters::isalnum(c)))
+                    is = RAW_ISTT;
+            }
+            LOG("Looks hashy! %S\n", T);;
+        }
         if (Characters::isalpha(Str::get_at(T, 0))) {
             is = IDENTIFIER_ISTT;
             LOOP_THROUGH_TEXT(P, T) {
@@ -2304,6 +2316,9 @@ these out at the start of each iteration.
                                         } else if (Str::eq(pr->material, I"string")) {
                                             subordinate_to = printstring_interp;
                                             operand1 = n;
+                                        } else if (Str::eq(pr->material, I"name")) {
+                                            subordinate_to = printname_interp;
+                                            operand1 = n;
                                         } else if (Str::eq(pr->material, I"the")) {
                                             subordinate_to = printdef_interp;
                                             operand1 = n;
@@ -2471,6 +2486,10 @@ these out at the start of each iteration.
                             if (l->ist_type != WHITE_SPACE_ISTT) {
                                 inter_schema_node *new_isn = InterSchemas::new_node(isn->parent_schema, EXPRESSION_ISNT);
                                 new_isn->expression_tokens = l; l->next = NULL; l->owner = new_isn;
+                                if (l->operation_primitive) {
+                                    l->ist_type = IDENTIFIER_ISTT;
+                                    l->operation_primitive = NULL;
+                                }
                                 if (isn->child_node == NULL) isn->child_node = new_isn;
                                 else if (prev_node) prev_node->next_node = new_isn;
                                 new_isn->parent_node = isn;
@@ -2667,7 +2686,7 @@ these out at the start of each iteration.
             if ((isn->isn_type == EXPRESSION_ISNT) && (isn->expression_tokens == NULL)) {
                 if (prev) prev->next_node = isn->next_node;
                 else if (par) par->child_node = isn->next_node;
-                else isn->parent_schema->node_tree = NULL;
+                else isn->parent_schema->node_tree = isn->next_node;
                 return TRUE;
             }
             if (InterSchemas::remove_empties(isn, isn->child_node)) return TRUE;
diff --git a/docs/codegen-module/4-cg.html b/docs/codegen-module/4-cg.html
index c5762941f..3622b580e 100644
--- a/docs/codegen-module/4-cg.html
+++ b/docs/codegen-module/4-cg.html
@@ -85,6 +85,7 @@
                         case CONSTANT_IST: {
                             inter_symbol *con_name =
                                 Inter::SymbolsTables::symbol_from_frame_data(P, DEFN_CONST_IFLD);
+                            if (Inter::Symbols::read_annotation(con_name, OBJECT_IANN) == 1) break;
                             if (Inter::Packages::container(P) == Inter::Packages::main(I)) {
                                 WRITE_TO(STDERR, "Bad constant: %S\n", con_name->symbol_name);
                                 internal_error("constant defined in main");
@@ -119,7 +120,8 @@
                         case INSTANCE_IST:
                             CodeGen::frame(TO, I, P); break;
                         case SPLAT_IST:
-                            if (P.data[PLM_SPLAT_IFLD] != OBJECT_PLM) CodeGen::frame(TO, I, P);
+                            internal_error("top-level splat remaining");
+    if (P.data[PLM_SPLAT_IFLD] != OBJECT_PLM) CodeGen::frame(TO, I, P);
                             break;
                         case PROPERTYVALUE_IST:
                             <Property knowledge 1.1>;
@@ -194,8 +196,8 @@
         }
 
         WRITE("%S", summations_at_eof);
-    WRITE("%S", attributes_at_eof);
         WRITE("%S", arrays_at_eof);
+
         WRITE("%S", main_matter);
         WRITE("%S", routines_at_eof);
         WRITE("%S", code_at_eof);
@@ -216,14 +218,10 @@
 
 
         if (properties_written == FALSE) {
-            for (int j=0; j<no_repos; j++) {
-                inter_repository *I = repos[j];
-                inter_frame P;
-                LOOP_THROUGH_FRAMES(P, I) {
-                    if ((P.data[ID_IFLD] == SPLAT_IST) && (P.data[PLM_SPLAT_IFLD] == OBJECT_PLM))
-                        CodeGen::frame(TO, I, P);
-                }
-            }
+            WRITE_TO(TO, "Object Compass \"compass\" has concealed;\n");
+            WRITE_TO(TO, "Object thedark \"(darkness object)\";\n");
+            WRITE_TO(TO, "Object InformParser \"(Inform Parser)\" has proper;\n");
+            WRITE_TO(TO, "Object InformLibrary \"(Inform Library)\" has proper;\n");
             properties_written = TRUE;
             CodeGen::IP::knowledge(TO, I, code_at_eof, attributes_at_eof);
         }
@@ -297,7 +295,7 @@
 
 

The function CodeGen::repo_list is used in §1, 2/erm (§1).

-

The function CodeGen::frame is used in §1, §1.1, §3, §4, §4.1, §4.2, §4.6, §4.7, §4.8, §4.9, §4.10, §4.11, §4.12, §4.13, §4.14, §4.15, §4.16, §4.17, §4.18, §4.19, §4.20, §4.21, §4.22, §4.23, §4.24, §4.25, §4.26, §4.27, §4.28, §4.29, §4.30, §4.31, §4.32, §4.33, §4.34, §4.35, §4.39, §4.40, §4.41, §4.42, §4.43, §4.44, §4.45, §4.46, §4.47, §4.48, §4.49, §4.50, §4.51, §4.52, §4.53, §4.54, §4.55, §4.56, §4.57, §4.58, §4.59, §4.60, §4.61, §4.62, §4.63, §4.64, §4.65, §4.66, §4.67, §4.68, §4.69, §4.70, §4.71, §4.72, §4.73, §4.74, §4.75, §4.76, §4.77, §4.78, §4.79, §4.80, §4.81, §4.82, §4.83, §4.84, §4.85, §4.86, §4.87, §4.88, §4.89.

+

The function CodeGen::frame is used in §1, §3, §4, §4.1, §4.2, §4.6, §4.7, §4.8, §4.9, §4.10, §4.11, §4.12, §4.13, §4.14, §4.15, §4.16, §4.17, §4.18, §4.19, §4.20, §4.21, §4.22, §4.23, §4.24, §4.25, §4.26, §4.27, §4.28, §4.29, §4.30, §4.31, §4.32, §4.33, §4.34, §4.35, §4.39, §4.40, §4.41, §4.42, §4.43, §4.44, §4.45, §4.46, §4.47, §4.48, §4.49, §4.50, §4.51, §4.52, §4.53, §4.54, §4.55, §4.56, §4.57, §4.58, §4.59, §4.60, §4.61, §4.62, §4.63, §4.64, §4.65, §4.66, §4.67, §4.68, §4.69, §4.70, §4.71, §4.72, §4.73, §4.74, §4.75, §4.76, §4.77, §4.78, §4.79, §4.80, §4.81, §4.82, §4.83, §4.84, §4.85, §4.86, §4.87, §4.88, §4.89.

§3. There's a contrivance here to get around an awkward point of I6 syntax: an array written in the form @@ -326,20 +324,11 @@ is 20. We instead compile this as inter_symbol *con_name = Inter::SymbolsTables::symbol_from_frame_data(P, DEFN_CONST_IFLD); if (Inter::Symbols::read_annotation(con_name, INLINE_ARRAY_IANN) == 1) return; - - if (Inter::Symbols::read_annotation(con_name,ACTION_IANN) == 1) { - if (Inter::Symbols::read_annotation(con_name, FAKE_ACTION_IANN) == 1) { - WRITE("Fake_action %S;\n", con_name->symbol_name); - } - return; - } + if (Inter::Symbols::read_annotation(con_name, ACTION_IANN) == 1) return; if (Str::eq(con_name->symbol_name, I"nothing")) return; - if ((Str::eq(con_name->symbol_name, I"##TheSame")) || - (Str::eq(con_name->symbol_name, I"##PluralFound")) || - (Str::eq(con_name->symbol_name, I"##Miscellany")) || - (Str::eq(con_name->symbol_name, I"##ListMiscellany"))) { + if (Inter::Symbols::read_annotation(con_name, FAKE_ACTION_IANN) == 1) { text_stream *fa = Str::duplicate(con_name->symbol_name); Str::delete_first_character(fa); Str::delete_first_character(fa); @@ -350,8 +339,23 @@ is 20. We instead compile this as if (Str::eq(con_name->symbol_name, I"parent")) return; if (Str::eq(con_name->symbol_name, I"child")) return; if (Str::eq(con_name->symbol_name, I"sibling")) return; - if (Str::eq(con_name->symbol_name, I"thedark")) return; - if (Str::eq(con_name->symbol_name, I"InformLibrary")) return; + if (Str::eq(con_name->symbol_name, I"thedark")) { + WRITE("Object thedark \"(darkness object)\";\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"InformLibrary")) { + WRITE("Object InformLibrary \"(Inform Library)\" has proper;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"InformParser")) { + WRITE("Object InformParser \"(Inform Parser)\" has proper;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"Compass")) { + WRITE("Object Compass \"compass\" has concealed;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"ResponseTexts")) return; if (Str::eq(con_name->symbol_name, I"FLOAT_NAN")) return; diff --git a/docs/core-module/12-is.html b/docs/core-module/12-is.html index a0f728e88..616bb72cc 100644 --- a/docs/core-module/12-is.html +++ b/docs/core-module/12-is.html @@ -311,7 +311,7 @@ either specify two parameters, both of them terms... value_holster VH = Holsters::new(INTER_VAL_VHMODE); int val_mode = FALSE; if (code_mode == FALSE) val_mode = TRUE; - EmitInterSchemas::emit(&VH, sch->compiled, ems, code_mode, val_mode, + EmitInterSchemas::emit(&VH, sch->compiled, ems, code_mode, val_mode, NULL, NULL, &Calculus::Schemas::sch_inline, NULL); END_COMPILATION_MODE; diff --git a/docs/core-module/25-cii.html b/docs/core-module/25-cii.html index a9cfa66af..c0a9b8066 100644 --- a/docs/core-module/25-cii.html +++ b/docs/core-module/25-cii.html @@ -255,7 +255,7 @@ or with a fragment of Inform 7 source text inside int to_val = FALSE; if (VH->vhmode_wanted == INTER_VAL_VHMODE) { to_val = TRUE; to_code = FALSE; } - EmitInterSchemas::emit(VH, sch, CSIS, to_code, to_val, + EmitInterSchemas::emit(VH, sch, CSIS, to_code, to_val, NULL, NULL, &Invocations::Inline::csi_inline_inner_inner, &TemplateFiles::compile_I7_from_I6); }

@@ -2514,7 +2514,7 @@ very special circumstances. } else { TEMPORARY_TEXT(T); WRITE_TO(T, "%~W", Wordings::one_word(ParseTree::int_annotation(inv, ssp_closing_segment_wn_ANNOT))); - inter_symbol *T_s = EmitInterSchemas::find_identifier_text(T); + inter_symbol *T_s = EmitInterSchemas::find_identifier_text(T, NULL, NULL); Emit::val_symbol(K_value, T_s); DISCARD_TEXT(T); } diff --git a/docs/core-module/27-ei.html b/docs/core-module/27-ei.html index c543efd4d..e4b8ca509 100644 --- a/docs/core-module/27-ei.html +++ b/docs/core-module/27-ei.html @@ -49,6 +49,11 @@ Packaging::initialise_state(repo); Packaging::outside_all_packages(); + Packaging::incarnate(Packaging::get_module(I"generic")->the_package); + Packaging::incarnate(Packaging::get_module(I"synoptic")->the_package); + Packaging::incarnate(Packaging::get_module(I"standard_rules")->the_package); + Packaging::incarnate(Hierarchy::template()); + inter_name *KU = Hierarchy::find(K_UNCHECKED_HL); packaging_state save = Packaging::enter_home_of(KU); unchecked_interk = InterNames::to_symbol(KU); @@ -1704,7 +1709,7 @@ insert them into the Inter stream close to the top.

The function Emit::change_translation is used in 5/un (§1), 13/rsfk (§24), 15/pr (§21), 27/hl (§3, §3.1), 27/pc (§18).

-

The function Emit::get_translation is used in 15/pr (§22.1).

+

The function Emit::get_translation is used in 15/pr (§22.1), 27/hr (§5).

The function Emit::to_text is used in 15/vp (§3), 27/hr (§5).

diff --git a/docs/core-module/27-eis.html b/docs/core-module/27-eis.html index 56e0291a6..f00727a96 100644 --- a/docs/core-module/27-eis.html +++ b/docs/core-module/27-eis.html @@ -14,14 +14,14 @@
     void EmitInterSchemas::emit(value_holster *VH, inter_schema *sch, void *opaque_state,
-        int to_code, int to_val,
+        int to_code, int to_val, inter_symbols_table *first_call, inter_symbols_table *second_call,
         void (*inline_command_handler)(value_holster *VH, inter_schema_token *t, void *opaque_state, int prim_cat),
         void (*i7_source_handler)(value_holster *VH, text_stream *OUT, text_stream *S)) {
         if (sch->mid_case) { Emit::to_last_level(4); }
         int prim_cat = VAL_PRIM_CAT;
         if (to_code) prim_cat = CODE_PRIM_CAT;
         for (inter_schema_node *isn = sch->node_tree; isn; isn=isn->next_node)
-            EmitInterSchemas::emit_inner(isn, VH, sch, opaque_state, prim_cat, inline_command_handler, i7_source_handler);
+            EmitInterSchemas::emit_inner(isn, VH, sch, opaque_state, prim_cat, first_call, second_call, inline_command_handler, i7_source_handler);
     }
 
@@ -34,7 +34,7 @@
     void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH,
-        inter_schema *sch, void *opaque_state, int prim_cat,
+        inter_schema *sch, void *opaque_state, int prim_cat, inter_symbols_table *first_call, inter_symbols_table *second_call,
         void (*inline_command_handler)(value_holster *VH, inter_schema_token *t, void *opaque_state, int prim_cat),
         void (*i7_source_handler)(value_holster *VH, text_stream *OUT, text_stream *S)) {
         if (isn == NULL) return;
@@ -75,7 +75,8 @@
                 } else if ((t->ist_type == INLINE_ISTT) &&
                     ((t->inline_command == counter_up_ISINC) || (t->inline_command == counter_down_ISINC))) {
                     value_holster VN = Holsters::new(INTER_DATA_VHMODE);
-                    (*inline_command_handler)(&VN, t, opaque_state, VAL_PRIM_CAT);
+                    if (inline_command_handler)
+                        (*inline_command_handler)(&VN, t, opaque_state, VAL_PRIM_CAT);
                 } else internal_error("bad label stuff");
             }
         }
@@ -100,7 +101,8 @@
         }
         for (inter_schema_node *at = isn->child_node; at; at=at->next_node)
             EmitInterSchemas::emit_inner(at,
-                VH, sch, opaque_state, CODE_PRIM_CAT, inline_command_handler, i7_source_handler);
+                VH, sch, opaque_state, CODE_PRIM_CAT, first_call, second_call,
+                inline_command_handler, i7_source_handler);
         if (isn->unclosed == FALSE) {
             Emit::up();
         }
@@ -131,7 +133,8 @@
             Emit::down();
             for (at = at->next_node; at; at=at->next_node)
                 EmitInterSchemas::emit_inner(at, VH, sch, opaque_state,
-                    VAL_PRIM_CAT, inline_command_handler, i7_source_handler);
+                    VAL_PRIM_CAT, first_call, second_call,
+                    inline_command_handler, i7_source_handler);
             Emit::up();
         }
 
@@ -155,7 +158,7 @@ to_call = tok; } if (to_call) { - Emit::inv_call(EmitInterSchemas::find_identifier(to_call)); + Emit::inv_call(EmitInterSchemas::find_identifier(to_call, first_call, second_call)); at = at->next_node; } else { int argc = 0; @@ -175,7 +178,8 @@ Emit::down(); for (; at; at=at->next_node) EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); Emit::up(); }
@@ -202,7 +206,8 @@ Emit::down(); } EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); } while (d > 0) { Emit::up(); d--; } } @@ -225,10 +230,13 @@ int pc = VAL_PRIM_CAT; if (InterSchemas::first_operand_ref(isn->isn_clarifier)) pc = REF_PRIM_CAT; EmitInterSchemas::emit_inner(isn->child_node, - VH, sch, opaque_state, pc, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, pc, first_call, second_call, + inline_command_handler, i7_source_handler); if (InterSchemas::arity(isn->isn_clarifier) == 2) EmitInterSchemas::emit_inner(isn->child_node->next_node, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, + inline_command_handler, i7_source_handler); Emit::up(); if (prim_cat == REF_PRIM_CAT) { Emit::up(); } @@ -252,7 +260,8 @@ Emit::down(); } EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, prim_cat, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, prim_cat, first_call, second_call, + inline_command_handler, i7_source_handler); } while (d > 0) { Emit::up(); d--; }
@@ -281,7 +290,8 @@ for (int i = 0; ((at) && (i<arity)); i++) { actual_arity++; EmitInterSchemas::emit_inner(at, VH, sch, opaque_state, - InterSchemas::ip_prim_cat(isn->isn_clarifier, i), inline_command_handler, i7_source_handler); + InterSchemas::ip_prim_cat(isn->isn_clarifier, i), + first_call, second_call, inline_command_handler, i7_source_handler); last = at; at = at->next_node; } @@ -310,15 +320,18 @@ inter_schema_node *var_node = oc_node->child_node; inter_schema_node *cl_node = var_node?(var_node->next_node):NULL; if ((var_node) && (cl_node)) { - EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, inline_command_handler, i7_source_handler); - EmitInterSchemas::emit_inner(cl_node, VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(cl_node, VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); } else internal_error("malformed OC node"); } else { inter_schema_node *var_node = isn->child_node; while ((var_node) && (var_node->isn_type != EXPRESSION_ISNT)) var_node = var_node->child_node; if (var_node) { - EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); Emit::val_iname(K_value, Kinds::RunTime::I6_classname(K_object)); } else internal_error("objectloop without visible variable"); } @@ -349,7 +362,7 @@ inter_symbol *lvar_s = LocalVariables::declare_this(lvar, FALSE, 8); Emit::val_symbol(K_value, lvar_s); } else { - Emit::val_symbol(K_value, EmitInterSchemas::find_identifier(t)); + Emit::val_symbol(K_value, EmitInterSchemas::find_identifier(t, first_call, second_call)); } break; } @@ -380,7 +393,8 @@ (*i7_source_handler)(VH, NULL, t->material); break; case INLINE_ISTT: - (*inline_command_handler)(VH, t, opaque_state, prim_cat); + if (inline_command_handler) + (*inline_command_handler)(VH, t, opaque_state, prim_cat); break; default: internal_error("bad expression token"); @@ -399,17 +413,28 @@
-    inter_symbol *EmitInterSchemas::find_identifier(inter_schema_token *t) {
+    inter_symbol *EmitInterSchemas::find_identifier(inter_schema_token *t, inter_symbols_table *first_call, inter_symbols_table *second_call) {
         if (t->as_quoted) return InterNames::to_symbol(t->as_quoted);
-        return EmitInterSchemas::find_identifier_text(t->material);
+        return EmitInterSchemas::find_identifier_text(t->material, first_call, second_call);
     }
 
-    inter_symbol *EmitInterSchemas::find_identifier_text(text_stream *S) {
+    inter_symbol *EmitInterSchemas::find_identifier_text(text_stream *S, inter_symbols_table *first_call, inter_symbols_table *second_call) {
+        if (first_call) {
+            inter_symbol *I = Emit::seek_symbol(first_call, S);
+            if (I) return I;
+        }
+        if (second_call) {
+            inter_symbol *I = Emit::seek_symbol(second_call, S);
+            if (I) return I;
+        }
         inter_symbol *I = Emit::seek_symbol(Emit::main_scope(), S);
         if (I) return I;
-        return InterNames::to_symbol(Hierarchy::find_by_name(S));
+        I = InterNames::to_symbol(Hierarchy::find_by_name(S));
+        if (I) return I;
+        LOG("Defeated on %S\n", S);
+        internal_error("unable to find identifier");
+        return NULL;
     }
-
 

diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html index 77c95b929..43a502566 100644 --- a/docs/core-module/27-hr.html +++ b/docs/core-module/27-hr.html @@ -56,14 +56,10 @@
-    enum THESAME_HL from 0
-    enum PLURALFOUND_HL
-    enum PARENT_HL
+    enum PARENT_HL from 0
     enum CHILD_HL
     enum SIBLING_HL
     enum SELF_HL
-    enum THEDARK_HL
-    enum INFORMLIBRARY_HL
     enum DEBUG_HL
     enum TARGET_ZCODE_HL
     enum TARGET_GLULX_HL
@@ -105,8 +101,6 @@
         HierarchyLocations::con(CHILD_HL, I"child", Translation::same(), generic_basics);
         HierarchyLocations::con(SIBLING_HL, I"sibling", Translation::same(), generic_basics);
         HierarchyLocations::con(SELF_HL, I"self", Translation::same(), generic_basics);
-        HierarchyLocations::con(THEDARK_HL, I"thedark", Translation::same(), generic_basics);
-        HierarchyLocations::con(INFORMLIBRARY_HL, I"InformLibrary", Translation::same(), generic_basics);
         HierarchyLocations::con(RESPONSETEXTS_HL, I"ResponseTexts", Translation::same(), generic_basics);
         HierarchyLocations::con(DEBUG_HL, I"DEBUG", Translation::same(), generic_basics);
         HierarchyLocations::con(TARGET_ZCODE_HL, I"TARGET_ZCODE", Translation::same(), generic_basics);
@@ -1354,6 +1348,10 @@
 
 
 
+    enum THESAME_HL
+    enum PLURALFOUND_HL
+    enum THEDARK_HL
+    enum INFORMLIBRARY_HL
     enum ACT_REQUESTER_HL
     enum ACTION_HL
     enum ACTIONCURRENTLYHAPPENINGFLAG_HL
@@ -1597,6 +1595,8 @@
         location_requirement template = HierarchyLocations::this_package(Hierarchy::template());
         HierarchyLocations::con(THESAME_HL, I"##TheSame", Translation::same(), template);
         HierarchyLocations::con(PLURALFOUND_HL, I"##PluralFound", Translation::same(), template);
+        HierarchyLocations::con(THEDARK_HL, I"thedark", Translation::same(), template);
+        HierarchyLocations::con(INFORMLIBRARY_HL, I"InformLibrary", Translation::same(), template);
         HierarchyLocations::con(ACT_REQUESTER_HL, I"act_requester", Translation::same(), template);
         HierarchyLocations::con(ACTION_HL, I"action", Translation::same(), template);
         HierarchyLocations::con(ACTIONCURRENTLYHAPPENINGFLAG_HL, I"ActionCurrentlyHappeningFlag", Translation::same(), template);
@@ -1881,13 +1881,11 @@
 
     inter_name *Hierarchy::post_process(int HL_id, inter_name *iname) {
         switch (HL_id) {
-    case THESAME_HL:
-    case PLURALFOUND_HL:
             case PARENT_HL:
             case CHILD_HL:
             case SIBLING_HL:
-            case THEDARK_HL:
-            case INFORMLIBRARY_HL:
+    case THEDARK_HL:
+    case INFORMLIBRARY_HL:
             case FLOAT_NAN_HL:
             case RESPONSETEXTS_HL:
                 Emit::named_numeric_constant(iname, 0);
@@ -1916,7 +1914,10 @@
     }
 
     void Hierarchy::make_available(inter_name *iname) {
-        HierarchyLocations::make_as(-1, Emit::to_text(iname), iname);
+        text_stream *ma_as = Emit::get_translation(iname);
+        if (Str::len(ma_as) == 0) ma_as = Emit::to_text(iname);
+        LOG("MA: %S = $3\n", ma_as, InterNames::to_symbol(iname));
+        HierarchyLocations::make_as(-1, ma_as, iname);
     }
 
     inter_name *Hierarchy::find_by_name(text_stream *name) {
@@ -1937,15 +1938,6 @@
         return main_pr;
     }
 
-    package_request *resources_pr = NULL;
-    package_request *Hierarchy::resources(void) {
-        if (resources_pr == NULL)
-            resources_pr = Packaging::request(
-                InterNames::explicitly_named(I"resources", Hierarchy::main()),
-                PackageTypes::get(I"_plain"));
-        return resources_pr;
-    }
-
     package_request *template_pr = NULL;
     package_request *Hierarchy::template(void) {
         if (template_pr == NULL) {
@@ -2044,9 +2036,7 @@
 
 

The function Hierarchy::main is used in 27/pc (§11, §14), 27/ei (§3).

-

The function Hierarchy::resources appears nowhere else.

- -

The function Hierarchy::template is used in §1.52, 15/ep (§4), 27/hl (§3, §5), 27/in (§5).

+

The function Hierarchy::template is used in §1.52, 15/ep (§4), 27/hl (§3, §5), 27/in (§5), 27/ei (§2).

The function Hierarchy::package is used in 5/nv (§16), 6/bp (§31), 15/pr (§27), 15/ma (§11.3), 19/tb (§9), 22/ph (§11), 22/tp (§5).

diff --git a/docs/core-module/27-in.html b/docs/core-module/27-in.html index 3ecbbff19..84a213c99 100644 --- a/docs/core-module/27-in.html +++ b/docs/core-module/27-in.html @@ -324,7 +324,7 @@ automatically here:

-

The function InterNames::to_symbol is used in 15/epv (§4), 21/rl (§11.2, §22), 26/iti (§9), 27/eis (§3), 27/ei (§2, §3, §4, §5).

+

The function InterNames::to_symbol is used in 15/epv (§4), 21/rl (§11.2, §22), 26/iti (§9), 27/hr (§5), 27/eis (§3), 27/ei (§2, §3, §4, §5).



diff --git a/docs/core-module/27-pc.html b/docs/core-module/27-pc.html index 4e2b8cb36..8ff70f694 100644 --- a/docs/core-module/27-pc.html +++ b/docs/core-module/27-pc.html @@ -387,7 +387,7 @@ specification.

-

The function Packaging::incarnate is used in §12, 27/in (§7), 27/ei (§3, §5).

+

The function Packaging::incarnate is used in §12, 27/in (§7), 27/ei (§2, §3, §5).

§14. Modules. With the code above, then, we can get the Inter hierarchy of packages set up as far as creating main. After that the Hierarchy code takes over, but it @@ -432,9 +432,9 @@ following creates modules on demand.

-

The function Packaging::get_module is used in §16, 27/hr (§5), 27/cm (§2).

+

The function Packaging::get_module is used in §16, 27/hr (§5), 27/cm (§2), 27/ei (§2).

-

The structure module_package is accessed in 27/hr, 27/cm and here.

+

The structure module_package is accessed in 27/hr, 27/cm, 27/ei and here.

§15. Submodules. Submodules have names such as properties, and the idea is that the same submodule (or rather, submodules with the same name) can be found in multiple modules. The diff --git a/docs/if-module/5-gp.html b/docs/if-module/5-gp.html index 30cf0c806..7e8aabdbc 100644 --- a/docs/if-module/5-gp.html +++ b/docs/if-module/5-gp.html @@ -208,6 +208,7 @@ for parsing: if (stage == 5) { instance *I; P_name = Properties::Valued::new_nameless(I"name", K_text); + Hierarchy::make_available(PL::Parsing::Visibility::name_name()); P_parse_name = Properties::Valued::new_nameless(I"parse_name", K_value); P_action_bitmap = Properties::Valued::new_nameless(I"action_bitmap", K_value); diff --git a/docs/inter-module/2-bkm.html b/docs/inter-module/2-bkm.html index fe6d6a987..4e39cdd63 100644 --- a/docs/inter-module/2-bkm.html +++ b/docs/inter-module/2-bkm.html @@ -64,7 +64,6 @@ IRS.pos = pos; return IRS; } - LOG("Didn't nail it."); return IRS; } @@ -79,7 +78,6 @@ IRS.pos = pos; return IRS; } - LOG("Didn't nail it."); return IRS; } diff --git a/docs/inter-module/3-ca.html b/docs/inter-module/3-ca.html index d0bdd53b6..ec3c48948 100644 --- a/docs/inter-module/3-ca.html +++ b/docs/inter-module/3-ca.html @@ -38,6 +38,7 @@ enum EITHER_OR_IANN enum ENCLOSING_IANN enum FAKE_ACTION_IANN + enum OBJECT_IANN enum HOLDING_IANN enum INLINE_ARRAY_IANN enum LATE_IANN @@ -99,6 +100,7 @@ symbol. Inter::Defn::create_annotation(EITHER_OR_IANN, I"__either_or", FALSE); Inter::Defn::create_annotation(ENCLOSING_IANN, I"__enclosing", FALSE); Inter::Defn::create_annotation(FAKE_ACTION_IANN, I"__fake_action", FALSE); + Inter::Defn::create_annotation(OBJECT_IANN, I"__object", FALSE); Inter::Defn::create_annotation(HOLDING_IANN, I"__holding", FALSE); Inter::Defn::create_annotation(INLINE_ARRAY_IANN, I"__inline_array", FALSE); Inter::Defn::create_annotation(LATE_IANN, I"__late", FALSE); diff --git a/inform7/core-module/Chapter 12/I6 Schemas.w b/inform7/core-module/Chapter 12/I6 Schemas.w index 913231788..576a68f59 100644 --- a/inform7/core-module/Chapter 12/I6 Schemas.w +++ b/inform7/core-module/Chapter 12/I6 Schemas.w @@ -213,7 +213,7 @@ void Calculus::Schemas::sch_emit_inner(i6_schema *sch, i6s_emission_state *ems, value_holster VH = Holsters::new(INTER_VAL_VHMODE); int val_mode = FALSE; if (code_mode == FALSE) val_mode = TRUE; - EmitInterSchemas::emit(&VH, sch->compiled, ems, code_mode, val_mode, + EmitInterSchemas::emit(&VH, sch->compiled, ems, code_mode, val_mode, NULL, NULL, &Calculus::Schemas::sch_inline, NULL); END_COMPILATION_MODE; diff --git a/inform7/core-module/Chapter 25/Compile Invocations Inline.w b/inform7/core-module/Chapter 25/Compile Invocations Inline.w index 34c3291ef..10a772ccd 100644 --- a/inform7/core-module/Chapter 25/Compile Invocations Inline.w +++ b/inform7/core-module/Chapter 25/Compile Invocations Inline.w @@ -145,7 +145,7 @@ void Invocations::Inline::csi_inline_inner(value_holster *VH, inter_schema *sch, int to_val = FALSE; if (VH->vhmode_wanted == INTER_VAL_VHMODE) { to_val = TRUE; to_code = FALSE; } - EmitInterSchemas::emit(VH, sch, CSIS, to_code, to_val, + EmitInterSchemas::emit(VH, sch, CSIS, to_code, to_val, NULL, NULL, &Invocations::Inline::csi_inline_inner_inner, &TemplateFiles::compile_I7_from_I6); } @@ -1412,7 +1412,7 @@ very special circumstances. } else { TEMPORARY_TEXT(T); WRITE_TO(T, "%~W", Wordings::one_word(ParseTree::int_annotation(inv, ssp_closing_segment_wn_ANNOT))); - inter_symbol *T_s = EmitInterSchemas::find_identifier_text(T); + inter_symbol *T_s = EmitInterSchemas::find_identifier_text(T, NULL, NULL); Emit::val_symbol(K_value, T_s); DISCARD_TEXT(T); } diff --git a/inform7/core-module/Chapter 27/Emit.w b/inform7/core-module/Chapter 27/Emit.w index a55aa17ed..7afdbc311 100644 --- a/inform7/core-module/Chapter 27/Emit.w +++ b/inform7/core-module/Chapter 27/Emit.w @@ -38,6 +38,11 @@ void Emit::begin(void) { inter_repository *repo = Inter::create(1, 4096); Packaging::initialise_state(repo); Packaging::outside_all_packages(); + + Packaging::incarnate(Packaging::get_module(I"generic")->the_package); + Packaging::incarnate(Packaging::get_module(I"synoptic")->the_package); + Packaging::incarnate(Packaging::get_module(I"standard_rules")->the_package); + Packaging::incarnate(Hierarchy::template()); inter_name *KU = Hierarchy::find(K_UNCHECKED_HL); packaging_state save = Packaging::enter_home_of(KU); diff --git a/inform7/core-module/Chapter 27/Emitting Inter Schemas.w b/inform7/core-module/Chapter 27/Emitting Inter Schemas.w index f2e67e8b4..5453eb06f 100644 --- a/inform7/core-module/Chapter 27/Emitting Inter Schemas.w +++ b/inform7/core-module/Chapter 27/Emitting Inter Schemas.w @@ -4,19 +4,19 @@ = void EmitInterSchemas::emit(value_holster *VH, inter_schema *sch, void *opaque_state, - int to_code, int to_val, + int to_code, int to_val, inter_symbols_table *first_call, inter_symbols_table *second_call, void (*inline_command_handler)(value_holster *VH, inter_schema_token *t, void *opaque_state, int prim_cat), void (*i7_source_handler)(value_holster *VH, text_stream *OUT, text_stream *S)) { if (sch->mid_case) { Emit::to_last_level(4); } int prim_cat = VAL_PRIM_CAT; if (to_code) prim_cat = CODE_PRIM_CAT; for (inter_schema_node *isn = sch->node_tree; isn; isn=isn->next_node) - EmitInterSchemas::emit_inner(isn, VH, sch, opaque_state, prim_cat, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(isn, VH, sch, opaque_state, prim_cat, first_call, second_call, inline_command_handler, i7_source_handler); } @ = void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, - inter_schema *sch, void *opaque_state, int prim_cat, + inter_schema *sch, void *opaque_state, int prim_cat, inter_symbols_table *first_call, inter_symbols_table *second_call, void (*inline_command_handler)(value_holster *VH, inter_schema_token *t, void *opaque_state, int prim_cat), void (*i7_source_handler)(value_holster *VH, text_stream *OUT, text_stream *S)) { if (isn == NULL) return; @@ -47,7 +47,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, } else if ((t->ist_type == INLINE_ISTT) && ((t->inline_command == counter_up_ISINC) || (t->inline_command == counter_down_ISINC))) { value_holster VN = Holsters::new(INTER_DATA_VHMODE); - (*inline_command_handler)(&VN, t, opaque_state, VAL_PRIM_CAT); + if (inline_command_handler) + (*inline_command_handler)(&VN, t, opaque_state, VAL_PRIM_CAT); } else internal_error("bad label stuff"); } } @@ -62,7 +63,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, } for (inter_schema_node *at = isn->child_node; at; at=at->next_node) EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, CODE_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, CODE_PRIM_CAT, first_call, second_call, + inline_command_handler, i7_source_handler); if (isn->unclosed == FALSE) { Emit::up(); } @@ -83,7 +85,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, Emit::down(); for (at = at->next_node; at; at=at->next_node) EmitInterSchemas::emit_inner(at, VH, sch, opaque_state, - VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VAL_PRIM_CAT, first_call, second_call, + inline_command_handler, i7_source_handler); Emit::up(); } @@ -97,7 +100,7 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, to_call = tok; } if (to_call) { - Emit::inv_call(EmitInterSchemas::find_identifier(to_call)); + Emit::inv_call(EmitInterSchemas::find_identifier(to_call, first_call, second_call)); at = at->next_node; } else { int argc = 0; @@ -117,7 +120,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, Emit::down(); for (; at; at=at->next_node) EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); Emit::up(); } @@ -134,7 +138,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, Emit::down(); } EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); } while (d > 0) { Emit::up(); d--; } } @@ -147,10 +152,13 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, int pc = VAL_PRIM_CAT; if (InterSchemas::first_operand_ref(isn->isn_clarifier)) pc = REF_PRIM_CAT; EmitInterSchemas::emit_inner(isn->child_node, - VH, sch, opaque_state, pc, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, pc, first_call, second_call, + inline_command_handler, i7_source_handler); if (InterSchemas::arity(isn->isn_clarifier) == 2) EmitInterSchemas::emit_inner(isn->child_node->next_node, - VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, + inline_command_handler, i7_source_handler); Emit::up(); if (prim_cat == REF_PRIM_CAT) { Emit::up(); } @@ -164,7 +172,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, Emit::down(); } EmitInterSchemas::emit_inner(at, - VH, sch, opaque_state, prim_cat, inline_command_handler, i7_source_handler); + VH, sch, opaque_state, prim_cat, first_call, second_call, + inline_command_handler, i7_source_handler); } while (d > 0) { Emit::up(); d--; } @@ -183,7 +192,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, for (int i = 0; ((at) && (iisn_clarifier, i), inline_command_handler, i7_source_handler); + InterSchemas::ip_prim_cat(isn->isn_clarifier, i), + first_call, second_call, inline_command_handler, i7_source_handler); last = at; at = at->next_node; } @@ -202,15 +212,18 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, inter_schema_node *var_node = oc_node->child_node; inter_schema_node *cl_node = var_node?(var_node->next_node):NULL; if ((var_node) && (cl_node)) { - EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, inline_command_handler, i7_source_handler); - EmitInterSchemas::emit_inner(cl_node, VH, sch, opaque_state, VAL_PRIM_CAT, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(cl_node, VH, sch, opaque_state, VAL_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); } else internal_error("malformed OC node"); } else { inter_schema_node *var_node = isn->child_node; while ((var_node) && (var_node->isn_type != EXPRESSION_ISNT)) var_node = var_node->child_node; if (var_node) { - EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, inline_command_handler, i7_source_handler); + EmitInterSchemas::emit_inner(var_node, VH, sch, opaque_state, REF_PRIM_CAT, + first_call, second_call, inline_command_handler, i7_source_handler); Emit::val_iname(K_value, Kinds::RunTime::I6_classname(K_object)); } else internal_error("objectloop without visible variable"); } @@ -231,7 +244,7 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, inter_symbol *lvar_s = LocalVariables::declare_this(lvar, FALSE, 8); Emit::val_symbol(K_value, lvar_s); } else { - Emit::val_symbol(K_value, EmitInterSchemas::find_identifier(t)); + Emit::val_symbol(K_value, EmitInterSchemas::find_identifier(t, first_call, second_call)); } break; } @@ -262,7 +275,8 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, (*i7_source_handler)(VH, NULL, t->material); break; case INLINE_ISTT: - (*inline_command_handler)(VH, t, opaque_state, prim_cat); + if (inline_command_handler) + (*inline_command_handler)(VH, t, opaque_state, prim_cat); break; default: internal_error("bad expression token"); @@ -273,14 +287,25 @@ void EmitInterSchemas::emit_inner(inter_schema_node *isn, value_holster *VH, if (prim_cat == REF_PRIM_CAT) { Emit::up(); } @ = -inter_symbol *EmitInterSchemas::find_identifier(inter_schema_token *t) { +inter_symbol *EmitInterSchemas::find_identifier(inter_schema_token *t, inter_symbols_table *first_call, inter_symbols_table *second_call) { if (t->as_quoted) return InterNames::to_symbol(t->as_quoted); - return EmitInterSchemas::find_identifier_text(t->material); + return EmitInterSchemas::find_identifier_text(t->material, first_call, second_call); } -inter_symbol *EmitInterSchemas::find_identifier_text(text_stream *S) { +inter_symbol *EmitInterSchemas::find_identifier_text(text_stream *S, inter_symbols_table *first_call, inter_symbols_table *second_call) { + if (first_call) { + inter_symbol *I = Emit::seek_symbol(first_call, S); + if (I) return I; + } + if (second_call) { + inter_symbol *I = Emit::seek_symbol(second_call, S); + if (I) return I; + } inter_symbol *I = Emit::seek_symbol(Emit::main_scope(), S); if (I) return I; - return InterNames::to_symbol(Hierarchy::find_by_name(S)); + I = InterNames::to_symbol(Hierarchy::find_by_name(S)); + if (I) return I; + LOG("Defeated on %S\n", S); + internal_error("unable to find identifier"); + return NULL; } - diff --git a/inform7/core-module/Chapter 27/Hierarchy.w b/inform7/core-module/Chapter 27/Hierarchy.w index 577c0f2ed..de13f35cf 100644 --- a/inform7/core-module/Chapter 27/Hierarchy.w +++ b/inform7/core-module/Chapter 27/Hierarchy.w @@ -37,14 +37,10 @@ void Hierarchy::establish(void) { @h Basics. -@e THESAME_HL from 0 -@e PLURALFOUND_HL -@e PARENT_HL +@e PARENT_HL from 0 @e CHILD_HL @e SIBLING_HL @e SELF_HL -@e THEDARK_HL -@e INFORMLIBRARY_HL @e DEBUG_HL @e TARGET_ZCODE_HL @e TARGET_GLULX_HL @@ -82,8 +78,6 @@ void Hierarchy::establish(void) { HierarchyLocations::con(CHILD_HL, I"child", Translation::same(), generic_basics); HierarchyLocations::con(SIBLING_HL, I"sibling", Translation::same(), generic_basics); HierarchyLocations::con(SELF_HL, I"self", Translation::same(), generic_basics); - HierarchyLocations::con(THEDARK_HL, I"thedark", Translation::same(), generic_basics); - HierarchyLocations::con(INFORMLIBRARY_HL, I"InformLibrary", Translation::same(), generic_basics); HierarchyLocations::con(RESPONSETEXTS_HL, I"ResponseTexts", Translation::same(), generic_basics); HierarchyLocations::con(DEBUG_HL, I"DEBUG", Translation::same(), generic_basics); HierarchyLocations::con(TARGET_ZCODE_HL, I"TARGET_ZCODE", Translation::same(), generic_basics); @@ -1055,6 +1049,10 @@ void Hierarchy::establish(void) { @ +@e THESAME_HL +@e PLURALFOUND_HL +@e THEDARK_HL +@e INFORMLIBRARY_HL @e ACT_REQUESTER_HL @e ACTION_HL @e ACTIONCURRENTLYHAPPENINGFLAG_HL @@ -1293,6 +1291,8 @@ void Hierarchy::establish(void) { location_requirement template = HierarchyLocations::this_package(Hierarchy::template()); HierarchyLocations::con(THESAME_HL, I"##TheSame", Translation::same(), template); HierarchyLocations::con(PLURALFOUND_HL, I"##PluralFound", Translation::same(), template); + HierarchyLocations::con(THEDARK_HL, I"thedark", Translation::same(), template); + HierarchyLocations::con(INFORMLIBRARY_HL, I"InformLibrary", Translation::same(), template); HierarchyLocations::con(ACT_REQUESTER_HL, I"act_requester", Translation::same(), template); HierarchyLocations::con(ACTION_HL, I"action", Translation::same(), template); HierarchyLocations::con(ACTIONCURRENTLYHAPPENINGFLAG_HL, I"ActionCurrentlyHappeningFlag", Translation::same(), template); @@ -1563,13 +1563,11 @@ package_request *Hierarchy::exotic_package(int x) { = inter_name *Hierarchy::post_process(int HL_id, inter_name *iname) { switch (HL_id) { -// case THESAME_HL: -// case PLURALFOUND_HL: case PARENT_HL: case CHILD_HL: case SIBLING_HL: - case THEDARK_HL: - case INFORMLIBRARY_HL: +// case THEDARK_HL: +// case INFORMLIBRARY_HL: case FLOAT_NAN_HL: case RESPONSETEXTS_HL: Emit::named_numeric_constant(iname, 0); @@ -1592,7 +1590,10 @@ inter_name *Hierarchy::find(int id) { } void Hierarchy::make_available(inter_name *iname) { - HierarchyLocations::make_as(-1, Emit::to_text(iname), iname); + text_stream *ma_as = Emit::get_translation(iname); + if (Str::len(ma_as) == 0) ma_as = Emit::to_text(iname); + LOG("MA: %S = $3\n", ma_as, InterNames::to_symbol(iname)); + HierarchyLocations::make_as(-1, ma_as, iname); } inter_name *Hierarchy::find_by_name(text_stream *name) { @@ -1613,15 +1614,6 @@ package_request *Hierarchy::main(void) { return main_pr; } -package_request *resources_pr = NULL; -package_request *Hierarchy::resources(void) { - if (resources_pr == NULL) - resources_pr = Packaging::request( - InterNames::explicitly_named(I"resources", Hierarchy::main()), - PackageTypes::get(I"_plain")); - return resources_pr; -} - package_request *template_pr = NULL; package_request *Hierarchy::template(void) { if (template_pr == NULL) { diff --git a/inform7/if-module/Chapter 5/Grammar Properties.w b/inform7/if-module/Chapter 5/Grammar Properties.w index 2660791cc..3887ad784 100644 --- a/inform7/if-module/Chapter 5/Grammar Properties.w +++ b/inform7/if-module/Chapter 5/Grammar Properties.w @@ -138,6 +138,7 @@ int PL::Parsing::Visibility::parsing_complete_model(int stage) { if (stage == 5) { instance *I; P_name = Properties::Valued::new_nameless(I"name", K_text); + Hierarchy::make_available(PL::Parsing::Visibility::name_name()); P_parse_name = Properties::Valued::new_nameless(I"parse_name", K_value); P_action_bitmap = Properties::Valued::new_nameless(I"action_bitmap", K_value); diff --git a/inter/codegen-module/Chapter 2/Assimilate.w b/inter/codegen-module/Chapter 2/Assimilate.w index 1027241cc..aaaca9ee2 100644 --- a/inter/codegen-module/Chapter 2/Assimilate.w +++ b/inter/codegen-module/Chapter 2/Assimilate.w @@ -45,6 +45,7 @@ void CodeGen::Assimilate::assimilate(inter_reading_state *IRS) { case DEFAULT_PLM: case CONSTANT_PLM: case FAKEACTION_PLM: + case OBJECT_PLM: case VERB_PLM: if (unchecked_kind_symbol) @; break; @@ -119,10 +120,15 @@ void CodeGen::Assimilate::assimilate(inter_reading_state *IRS) { identifier = Str::new(); WRITE_TO(identifier, "##%S", old); } + if (switch_on == OBJECT_PLM) value = NULL; if (switch_on != DEFAULT_PLM) { inter_symbol *con_name = CodeGen::Assimilate::maybe_extern(I, identifier, into_scope); Inter::Symbols::annotate_i(I, con_name, ASSIMILATED_IANN, 1); + if (switch_on == FAKEACTION_PLM) + Inter::Symbols::annotate_i(I, con_name, FAKE_ACTION_IANN, 1); + if (switch_on == OBJECT_PLM) + Inter::Symbols::annotate_i(I, con_name, OBJECT_IANN, 1); if (con_name->equated_to) { inter_symbol *external_name = con_name->equated_to; @@ -134,13 +140,8 @@ void CodeGen::Assimilate::assimilate(inter_reading_state *IRS) { switch (switch_on) { case CONSTANT_PLM: - @; - CodeGen::Link::guard(Inter::Constant::new_numerical(&ib, - Inter::SymbolsTables::id_from_symbol(I, outer, con_name), - Inter::SymbolsTables::id_from_symbol(I, outer, unchecked_kind_symbol), v1, v2, - baseline, NULL)); - break; case FAKEACTION_PLM: + case OBJECT_PLM: @; CodeGen::Link::guard(Inter::Constant::new_numerical(&ib, Inter::SymbolsTables::id_from_symbol(I, outer, con_name), @@ -341,6 +342,7 @@ void CodeGen::Assimilate::assimilate(inter_reading_state *IRS) { var_count++; inter_symbol *loc_name = Inter::SymbolsTables::create_with_unique_name(Inter::Package::local_symbols(block_name), value); + Inter::Symbols::local(loc_name); CodeGen::Link::guard(Inter::Local::new(&ib, block_name, loc_name, unchecked_kind_symbol, 0, baseline+1, NULL)); DISCARD_TEXT(value); @@ -359,7 +361,7 @@ void CodeGen::Assimilate::assimilate(inter_reading_state *IRS) { while ((L>0) && (Str::get_at(body, L) != ']')) L--; while ((L>0) && (Characters::is_whitespace(Str::get_at(body, L-1)))) L--; Str::truncate(body, L); - CodeGen::Link::entire_splat(&ib, NULL, body, baseline+2, block_name); + CodeGen::Assimilate::routine_body(&ib, block_name, baseline+2, body); } CodeGen::Link::guard(Inter::Label::new(&ib, block_name, end_name, baseline+1, NULL)); @@ -654,3 +656,33 @@ inter_symbol *CodeGen::Assimilate::computed_constant_symbol(inter_package *pack) DISCARD_TEXT(NN); return mcc_name; } + +int rb_splat_count = 1; +void CodeGen::Assimilate::routine_body(inter_reading_state *IRS, inter_symbol *block_name, inter_t offset, text_stream *body) { + if (Str::is_whitespace(body)) return; + if (Str::len(body) < 20) { + LOG("=======\n\nCandidate (%S): '%S'\n\n", block_name->symbol_name, body); + inter_schema *sch = InterSchemas::from_text(body, FALSE, 0, NULL); + + if (sch == NULL) LOG("NULL SCH\n"); + else if (sch->node_tree == NULL) { + LOG("Lint fail: Non-empty text but empty scheme\n"); + internal_error("inter schema empty"); + } else InterSchemas::log(sch); + + #ifdef CORE_MODULE + current_inter_routine = block_name; + Packaging::set_state(IRS, Packaging::enclosure()); + Emit::push_code_position(Emit::new_cip(IRS)); + value_holster VH = Holsters::new(INTER_VOID_VHMODE); + inter_symbols_table *scope1 = Inter::Package::local_symbols(block_name); + inter_symbols_table *scope2 = Inter::Packages::scope(Packaging::incarnate(Hierarchy::template())); + EmitInterSchemas::emit(&VH, sch, NULL, TRUE, FALSE, scope1, scope2, NULL, NULL); + Emit::pop_code_position(); + current_inter_routine = NULL; + return; + #endif + } + CodeGen::Link::entire_splat(IRS, NULL, body, offset, block_name); + LOG("Splat %d\n", rb_splat_count++); +} diff --git a/inter/codegen-module/Chapter 3/Inter Schemas.w b/inter/codegen-module/Chapter 3/Inter Schemas.w index fbf2e0efe..c436b51b4 100644 --- a/inter/codegen-module/Chapter 3/Inter Schemas.w +++ b/inter/codegen-module/Chapter 3/Inter Schemas.w @@ -188,8 +188,8 @@ compilation process, and never survive into the final schema: @e RAW_ISTT from 1 /* something unidentified as yet */ @e WHITE_SPACE_ISTT /* a stretch of white space */ -@e RESERVED_ISTT /* am I6 reserved word such as |while| */ -@e OPERATOR_ISTT /* an I6 operator such as |-->| or |+| */ +@e RESERVED_ISTT /* am I6 reserved word such as |while| */ +@e OPERATOR_ISTT /* an I6 operator such as |-->| or |+| */ @e DIVIDER_ISTT /* a semicolon used to divide I6 statements */ @e OPEN_ROUND_ISTT /* open round bracket */ @e CLOSE_ROUND_ISTT /* close round bracket */ @@ -398,7 +398,8 @@ we go to some trouble here. = void InterSchemas::log(inter_schema *sch) { - if (sch == NULL) LOG(""); + if (sch == NULL) LOG("\n"); + else if (sch->node_tree == NULL) LOG("\n"); else InterSchemas::log_depth(sch->node_tree, 0); } @@ -653,6 +654,7 @@ inter_schema *InterSchemas::from_text(text_stream *from, int abbreviated, int no @; @; + InterSchemas::lint(sch); if ((Log::aspect_switched_on(SCHEMA_COMPILATION_DA)) || @@ -1125,6 +1127,7 @@ language opcodes such as |@pull|. @ = int monograph = TRUE, digraph = FALSE, trigraph = FALSE; if ((Characters::isalnum(c1)) || (c1 == '_')) monograph = FALSE; + if ((c1 == '#') && (Characters::isalpha(c2))) monograph = FALSE; if ((c1 == '@') && (Characters::isalpha(c2))) monograph = FALSE; if ((c1 == '+') && (c2 == '+')) digraph = TRUE; @@ -1197,6 +1200,15 @@ inclusive; we ignore an empty token. @ = if (Str::get_at(T, 0) == '@') is = OPCODE_ISTT; + if ((Str::get_at(T, 0) == '#') && (Characters::isalpha(Str::get_at(T, 1)))) { + is = IDENTIFIER_ISTT; + LOOP_THROUGH_TEXT(P, T) { + int c = Str::get(P); + if ((c != '_') && (c != '#') && (!Characters::isalnum(c))) + is = RAW_ISTT; + } + LOG("Looks hashy! %S\n", T);; + } if (Characters::isalpha(Str::get_at(T, 0))) { is = IDENTIFIER_ISTT; LOOP_THROUGH_TEXT(P, T) { @@ -1799,6 +1811,9 @@ int InterSchemas::identify_constructs(inter_schema_node *par, inter_schema_node } else if (Str::eq(pr->material, I"string")) { subordinate_to = printstring_interp; operand1 = n; + } else if (Str::eq(pr->material, I"name")) { + subordinate_to = printname_interp; + operand1 = n; } else if (Str::eq(pr->material, I"the")) { subordinate_to = printdef_interp; operand1 = n; @@ -1966,6 +1981,10 @@ int InterSchemas::identify_constructs(inter_schema_node *par, inter_schema_node if (l->ist_type != WHITE_SPACE_ISTT) { inter_schema_node *new_isn = InterSchemas::new_node(isn->parent_schema, EXPRESSION_ISNT); new_isn->expression_tokens = l; l->next = NULL; l->owner = new_isn; + if (l->operation_primitive) { + l->ist_type = IDENTIFIER_ISTT; + l->operation_primitive = NULL; + } if (isn->child_node == NULL) isn->child_node = new_isn; else if (prev_node) prev_node->next_node = new_isn; new_isn->parent_node = isn; @@ -2136,7 +2155,7 @@ int InterSchemas::remove_empties(inter_schema_node *par, inter_schema_node *isn) if ((isn->isn_type == EXPRESSION_ISNT) && (isn->expression_tokens == NULL)) { if (prev) prev->next_node = isn->next_node; else if (par) par->child_node = isn->next_node; - else isn->parent_schema->node_tree = NULL; + else isn->parent_schema->node_tree = isn->next_node; return TRUE; } if (InterSchemas::remove_empties(isn, isn->child_node)) return TRUE; diff --git a/inter/codegen-module/Chapter 4/Code Generation.w b/inter/codegen-module/Chapter 4/Code Generation.w index 1769a1ec2..a30695c81 100644 --- a/inter/codegen-module/Chapter 4/Code Generation.w +++ b/inter/codegen-module/Chapter 4/Code Generation.w @@ -71,6 +71,7 @@ void CodeGen::to_I6(inter_repository *I, OUTPUT_STREAM) { case CONSTANT_IST: { inter_symbol *con_name = Inter::SymbolsTables::symbol_from_frame_data(P, DEFN_CONST_IFLD); + if (Inter::Symbols::read_annotation(con_name, OBJECT_IANN) == 1) break; if (Inter::Packages::container(P) == Inter::Packages::main(I)) { WRITE_TO(STDERR, "Bad constant: %S\n", con_name->symbol_name); internal_error("constant defined in main"); @@ -105,7 +106,8 @@ void CodeGen::to_I6(inter_repository *I, OUTPUT_STREAM) { case INSTANCE_IST: CodeGen::frame(TO, I, P); break; case SPLAT_IST: - if (P.data[PLM_SPLAT_IFLD] != OBJECT_PLM) CodeGen::frame(TO, I, P); + internal_error("top-level splat remaining"); +// if (P.data[PLM_SPLAT_IFLD] != OBJECT_PLM) CodeGen::frame(TO, I, P); break; case PROPERTYVALUE_IST: @; @@ -180,8 +182,8 @@ void CodeGen::to_I6(inter_repository *I, OUTPUT_STREAM) { } WRITE("%S", summations_at_eof); -// WRITE("%S", attributes_at_eof); WRITE("%S", arrays_at_eof); + WRITE("%S", main_matter); WRITE("%S", routines_at_eof); WRITE("%S", code_at_eof); @@ -190,14 +192,10 @@ void CodeGen::to_I6(inter_repository *I, OUTPUT_STREAM) { @ = if (properties_written == FALSE) { - for (int j=0; jsymbol_name); - } - return; - } + if (Inter::Symbols::read_annotation(con_name, ACTION_IANN) == 1) return; if (Str::eq(con_name->symbol_name, I"nothing")) return; - if ((Str::eq(con_name->symbol_name, I"##TheSame")) || - (Str::eq(con_name->symbol_name, I"##PluralFound")) || - (Str::eq(con_name->symbol_name, I"##Miscellany")) || - (Str::eq(con_name->symbol_name, I"##ListMiscellany"))) { + if (Inter::Symbols::read_annotation(con_name, FAKE_ACTION_IANN) == 1) { text_stream *fa = Str::duplicate(con_name->symbol_name); Str::delete_first_character(fa); Str::delete_first_character(fa); @@ -302,8 +291,23 @@ void CodeGen::constant(OUTPUT_STREAM, inter_repository *I, inter_frame P) { if (Str::eq(con_name->symbol_name, I"parent")) return; if (Str::eq(con_name->symbol_name, I"child")) return; if (Str::eq(con_name->symbol_name, I"sibling")) return; - if (Str::eq(con_name->symbol_name, I"thedark")) return; - if (Str::eq(con_name->symbol_name, I"InformLibrary")) return; + if (Str::eq(con_name->symbol_name, I"thedark")) { +// WRITE("Object thedark \"(darkness object)\";\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"InformLibrary")) { +// WRITE("Object InformLibrary \"(Inform Library)\" has proper;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"InformParser")) { +// WRITE("Object InformParser \"(Inform Parser)\" has proper;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"Compass")) { +// WRITE("Object Compass \"compass\" has concealed;\n"); + return; + } + if (Str::eq(con_name->symbol_name, I"ResponseTexts")) return; if (Str::eq(con_name->symbol_name, I"FLOAT_NAN")) return; diff --git a/inter/inter-module/Chapter 2/Bookmarks.w b/inter/inter-module/Chapter 2/Bookmarks.w index da316f4fb..de90cb4c3 100644 --- a/inter/inter-module/Chapter 2/Bookmarks.w +++ b/inter/inter-module/Chapter 2/Bookmarks.w @@ -44,7 +44,6 @@ inter_reading_state Inter::Bookmarks::from_package(inter_package *pack) { IRS.pos = pos; return IRS; } - LOG("Didn't nail it."); return IRS; } @@ -59,7 +58,6 @@ inter_reading_state Inter::Bookmarks::from_frame(inter_frame D) { IRS.pos = pos; return IRS; } - LOG("Didn't nail it."); return IRS; } diff --git a/inter/inter-module/Chapter 3/Canonical Annotations.w b/inter/inter-module/Chapter 3/Canonical Annotations.w index 9a68a6eb8..43c1bc231 100644 --- a/inter/inter-module/Chapter 3/Canonical Annotations.w +++ b/inter/inter-module/Chapter 3/Canonical Annotations.w @@ -24,6 +24,7 @@ Defining the one true set of Inter annotation codes. @e EITHER_OR_IANN @e ENCLOSING_IANN @e FAKE_ACTION_IANN +@e OBJECT_IANN @e HOLDING_IANN @e INLINE_ARRAY_IANN @e LATE_IANN @@ -76,6 +77,7 @@ void Inter::Canon::declare(void) { Inter::Defn::create_annotation(EITHER_OR_IANN, I"__either_or", FALSE); Inter::Defn::create_annotation(ENCLOSING_IANN, I"__enclosing", FALSE); Inter::Defn::create_annotation(FAKE_ACTION_IANN, I"__fake_action", FALSE); + Inter::Defn::create_annotation(OBJECT_IANN, I"__object", FALSE); Inter::Defn::create_annotation(HOLDING_IANN, I"__holding", FALSE); Inter::Defn::create_annotation(INLINE_ARRAY_IANN, I"__inline_array", FALSE); Inter::Defn::create_annotation(LATE_IANN, I"__late", FALSE);