diff --git a/README.md b/README.md index 248d9af32..4155cb470 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inform 7 -v10.1.0-alpha.1+6U55 'Krypton' (12 March 2022) +v10.1.0-alpha.1+6U56 'Krypton' (13 March 2022) ## About Inform 7 diff --git a/build.txt b/build.txt index b92aa50cb..388ad17b9 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: alpha.1 -Build Date: 12 March 2022 -Build Number: 6U55 +Build Date: 13 March 2022 +Build Number: 6U56 diff --git a/docs/bytecode-module/2-ann.html b/docs/bytecode-module/2-ann.html index e7542f0c2..b92d85810 100644 --- a/docs/bytecode-module/2-ann.html +++ b/docs/bytecode-module/2-ann.html @@ -449,7 +449,7 @@ we then want to impose these on some new symbol:
-void SymbolAnnotation::copy_set_to_symbol(inter_annotation_set *set, inter_symbol *S) { +void SymbolAnnotation::copy_set_to_symbol(inter_annotation_set *set, inter_symbol *S) { if (set) { S->annotations.boolean_annotations |= set->boolean_annotations; if (set->other_annotations) { @@ -465,7 +465,7 @@ if true, because if false then they are indistinguishable from not being there a-void SymbolAnnotation::write_annotations(OUTPUT_STREAM, inter_tree_node *F, inter_symbol *S) { +void SymbolAnnotation::write_annotations(OUTPUT_STREAM, inter_tree_node *F, inter_symbol *S) { if (S) SymbolAnnotation::write_set(OUT, &(S->annotations), F); } diff --git a/docs/bytecode-module/2-bkm.html b/docs/bytecode-module/2-bkm.html index 8940f3460..7c0269f55 100644 --- a/docs/bytecode-module/2-bkm.html +++ b/docs/bytecode-module/2-bkm.html @@ -200,7 +200,7 @@ equal to P.-inter_package *InterBookmark::package(inter_bookmark *IBM) { +inter_package *InterBookmark::package(inter_bookmark *IBM) { if (IBM == NULL) return NULL; inter_package *pack = IBM->R->package; if ((IBM->placement_wrt_R == AS_FIRST_CHILD_OF_NODEPLACEMENT) || @@ -215,12 +215,12 @@ equal to P.-inter_tree *InterBookmark::tree(inter_bookmark *IBM) { +inter_tree *InterBookmark::tree(inter_bookmark *IBM) { if (IBM == NULL) return NULL; return IBM->R->tree; } -inter_warehouse *InterBookmark::warehouse(inter_bookmark *IBM) { +inter_warehouse *InterBookmark::warehouse(inter_bookmark *IBM) { return InterTree::warehouse(InterBookmark::tree(IBM)); } @@ -230,7 +230,7 @@ equal to P. return 0; } -inter_symbols_table *InterBookmark::scope(inter_bookmark *IBM) { +inter_symbols_table *InterBookmark::scope(inter_bookmark *IBM) { inter_package *pack = InterBookmark::package(IBM); if (pack) return InterPackage::scope(pack); return InterTree::global_scope(InterBookmark::tree(IBM)); diff --git a/docs/bytecode-module/2-in.html b/docs/bytecode-module/2-in.html index 576f45858..6849793fb 100644 --- a/docs/bytecode-module/2-in.html +++ b/docs/bytecode-module/2-in.html @@ -119,7 +119,7 @@ of access matters more. struct warehouse_floor_space W; } inter_tree_node;-
§2. Do not call this directly in order to create a node.
@@ -204,7 +204,7 @@ call those creator functions, not these. return P; } -inter_tree_node *Inode::new_with_2_data_fields(inter_bookmark *IBM, int S, +inter_tree_node *Inode::new_with_2_data_fields(inter_bookmark *IBM, int S, inter_ti V1, inter_ti V2, inter_error_location *eloc, inter_ti level) { inter_tree *I = InterBookmark::tree(IBM); inter_tree_node *P = Inode::new_node(InterTree::warehouse(I), I, 4, @@ -216,7 +216,7 @@ call those creator functions, not these. return P; } -inter_tree_node *Inode::new_with_3_data_fields(inter_bookmark *IBM, int S, +inter_tree_node *Inode::new_with_3_data_fields(inter_bookmark *IBM, int S, inter_ti V1, inter_ti V2, inter_ti V3, inter_error_location *eloc, inter_ti level) { inter_tree *I = InterBookmark::tree(IBM); inter_tree_node *P = Inode::new_node(InterTree::warehouse(I), I, 5, @@ -229,7 +229,7 @@ call those creator functions, not these. return P; } -inter_tree_node *Inode::new_with_4_data_fields(inter_bookmark *IBM, int S, +inter_tree_node *Inode::new_with_4_data_fields(inter_bookmark *IBM, int S, inter_ti V1, inter_ti V2, inter_ti V3, inter_ti V4, inter_error_location *eloc, inter_ti level) { inter_tree *I = InterBookmark::tree(IBM); @@ -478,7 +478,7 @@ we are in, which in turn depends on the node). return InterWarehouse::get_symbols_table(Inode::warehouse(F), ID); } -text_stream *Inode::ID_to_text(inter_tree_node *F, inter_ti ID) { +text_stream *Inode::ID_to_text(inter_tree_node *F, inter_ti ID) { return InterWarehouse::get_text(Inode::warehouse(F), ID); } @@ -496,7 +496,7 @@ to identify it as occurring at a particular node. We can get one thus:-inter_error_message *Inode::error(inter_tree_node *F, text_stream *err, text_stream *quote) { +inter_error_message *Inode::error(inter_tree_node *F, text_stream *err, text_stream *quote) { inter_error_message *iem = CREATE(inter_error_message); inter_error_location *eloc = Inode::get_error_location(F); if (eloc) diff --git a/docs/bytecode-module/2-it.html b/docs/bytecode-module/2-it.html index c9befcae0..661ec0ee1 100644 --- a/docs/bytecode-module/2-it.html +++ b/docs/bytecode-module/2-it.html @@ -176,7 +176,7 @@ making use of the tree structure between them. return F->next_itn; } -inter_tree_node *InterTree::first_child(inter_tree_node *F) { +inter_tree_node *InterTree::first_child(inter_tree_node *F) { if (F == NULL) return NULL; return F->first_child_itn; } diff --git a/docs/bytecode-module/2-pck.html b/docs/bytecode-module/2-pck.html index 05d077868..0d59d233c 100644 --- a/docs/bytecode-module/2-pck.html +++ b/docs/bytecode-module/2-pck.html @@ -244,7 +244,7 @@ extracted from the bytecode of its -inter_symbols_table *InterPackage::scope(inter_package *pack) { +inter_symbols_table *InterPackage::scope(inter_package *pack) { if (pack == NULL) return NULL; return pack->package_scope; } @@ -275,7 +275,7 @@ equal to the special root package.-inter_package *InterPackage::container(inter_tree_node *P) { +inter_package *InterPackage::container(inter_tree_node *P) { if (P == NULL) return NULL; inter_package *pack = Inode::get_package(P); if (InterPackage::is_a_root_package(pack)) return NULL; diff --git a/docs/bytecode-module/2-st.html b/docs/bytecode-module/2-st.html index 9eb70cd61..d10eba957 100644 --- a/docs/bytecode-module/2-st.html +++ b/docs/bytecode-module/2-st.html @@ -291,7 +291,7 @@ elsewhere in the tree, then we return that other symbol.-inter_symbol *InterSymbolsTable::symbol_from_name(inter_symbols_table *T, text_stream *name) { +inter_symbol *InterSymbolsTable::symbol_from_name(inter_symbols_table *T, text_stream *name) { return InterSymbolsTable::search_inner(T, name, FALSE, 0, TRUE); }@@ -387,7 +387,7 @@ to access this: one following equations, the other not.-inter_symbol *InterSymbolsTable::symbol_from_ID_at_node(inter_tree_node *P, int x) { +inter_symbol *InterSymbolsTable::symbol_from_ID_at_node(inter_tree_node *P, int x) { return InterSymbolsTable::symbol_from_ID(InterPackage::scope_of(P), P->W.instruction[x]); } @@ -395,7 +395,7 @@ to access this: one following equations, the other not. return InterSymbolsTable::symbol_from_ID(Inode::globals(P), P->W.instruction[x]); } -inter_symbol *InterSymbolsTable::symbol_from_ID_in_package(inter_package *owner, inter_ti ID) { +inter_symbol *InterSymbolsTable::symbol_from_ID_in_package(inter_package *owner, inter_ti ID) { return InterSymbolsTable::symbol_from_ID(InterPackage::scope(owner), ID); }@@ -422,7 +422,7 @@ symbols table.-inter_ti InterSymbolsTable::id_from_symbol_not_creating(inter_tree *I, +inter_ti InterSymbolsTable::id_from_symbol_not_creating(inter_tree *I, inter_package *P, inter_symbol *S) { if (S == NULL) internal_error("no symbol"); inter_symbols_table *T = InterPackage::scope(P); @@ -514,14 +514,14 @@ collision with the original p-inter_ti InterSymbolsTable::id_from_symbol(inter_tree *I, inter_package *P, inter_symbol *S) { +inter_ti InterSymbolsTable::id_from_symbol(inter_tree *I, inter_package *P, inter_symbol *S) { if (S == NULL) internal_error("no symbol"); inter_symbols_table *P_table = InterPackage::scope(P); if (P_table == NULL) P_table = InterTree::global_scope(I); return InterSymbolsTable::id_from_symbol_in_table(P_table, S); } -inter_ti InterSymbolsTable::id_from_symbol_in_table(inter_symbols_table *P_table, inter_symbol *S) { +inter_ti InterSymbolsTable::id_from_symbol_in_table(inter_symbols_table *P_table, inter_symbol *S) { if (S == NULL) internal_error("no symbol"); if (P_table == NULL) internal_error("no table"); inter_symbols_table *SP_table = S->owning_table; @@ -566,7 +566,7 @@ them on a package-by-package basis, so it is an error to call this function if-inter_ti InterSymbolsTable::id_at_bookmark(inter_bookmark *IBM, +inter_ti InterSymbolsTable::id_at_bookmark(inter_bookmark *IBM, inter_symbol *S) { return InterSymbolsTable::id_from_symbol(InterBookmark::tree(IBM), InterBookmark::package(IBM), S); @@ -589,7 +589,7 @@ for packages as a special case of URLs for symbols.define MAX_URL_SYMBOL_NAME_DEPTH 512-void InterSymbolsTable::write_symbol_URL(OUTPUT_STREAM, inter_symbol *S) { +void InterSymbolsTable::write_symbol_URL(OUTPUT_STREAM, inter_symbol *S) { inter_package *chain[MAX_URL_SYMBOL_NAME_DEPTH]; int chain_length = 0; inter_package *P = InterSymbolsTable::package(S->owning_table); @@ -614,7 +614,7 @@ means a symbol named this/tha-inter_symbol *InterSymbolsTable::URL_to_symbol(inter_tree *I, text_stream *URL) { +inter_symbol *InterSymbolsTable::URL_to_symbol(inter_tree *I, text_stream *URL) { if (Str::get_first_char(URL) == '/') { inter_package *at_P = I->root_package; TEMPORARY_TEXT(C) @@ -647,7 +647,7 @@ not use the function if that is able to cause problems.-void InterSymbolsTable::remove_symbol(inter_symbol *S) { +void InterSymbolsTable::remove_symbol(inter_symbol *S) { int index = (int) S->symbol_ID - (int) SYMBOL_BASE_VAL; Wiring::wire_to(S, NULL); S->owning_table->symbol_array[index] = NULL; @@ -656,7 +656,7 @@ not use the function if that is able to cause problems.-void InterSymbolsTable::log(OUTPUT_STREAM, void *vst) { +void InterSymbolsTable::log(OUTPUT_STREAM, void *vst) { inter_symbols_table *ST = (inter_symbols_table *) vst; if (ST == NULL) WRITE("<null-stable>"); else { diff --git a/docs/bytecode-module/2-sym.html b/docs/bytecode-module/2-sym.html index 4ca8b17a4..3fe688918 100644 --- a/docs/bytecode-module/2-sym.html +++ b/docs/bytecode-module/2-sym.html @@ -204,7 +204,7 @@ do make some effort, by packing various flags into a single define SYMBOL_TYPE_STATUS_MASK 0x00000007-int InterSymbol::get_type(inter_symbol *S) { +int InterSymbol::get_type(inter_symbol *S) { return S->symbol_status & SYMBOL_TYPE_STATUS_MASK; } @@ -324,7 +324,7 @@ execution of code can jump. Their names must begin with a return FALSE; } -void InterSymbol::make_local(inter_symbol *S) { +void InterSymbol::make_local(inter_symbol *S) { InterSymbol::set_type(S, LOCAL_ISYMT); S->definition = NULL; } @@ -340,7 +340,7 @@ See The Wiring. return FALSE; } -void InterSymbol::make_plug(inter_symbol *S) { +void InterSymbol::make_plug(inter_symbol *S) { InterSymbol::set_type(S, PLUG_ISYMT); S->definition = NULL; } @@ -350,7 +350,7 @@ See The Wiring. return FALSE; } -void InterSymbol::make_socket(inter_symbol *S) { +void InterSymbol::make_socket(inter_symbol *S) { InterSymbol::set_type(S, SOCKET_ISYMT); S->definition = NULL; } @@ -467,7 +467,7 @@ in the current package. So:--text_stream *InterSymbol::identifier(inter_symbol *S) { +text_stream *InterSymbol::identifier(inter_symbol *S) { if (S == NULL) return NULL; return S->identifier; } diff --git a/docs/bytecode-module/2-tw.html b/docs/bytecode-module/2-tw.html index 7809a66b2..cb7eb3916 100644 --- a/docs/bytecode-module/2-tw.html +++ b/docs/bytecode-module/2-tw.html @@ -241,11 +241,11 @@ saves redundantly storing a type field in -inter_ti InterWarehouse::create_text(inter_warehouse *warehouse, inter_package *owner) { +inter_ti InterWarehouse::create_text(inter_warehouse *warehouse, inter_package *owner) { return InterWarehouse::create_ref(warehouse, STORE_POINTER_text_stream(Str::new()), owner); } -inter_ti InterWarehouse::create_text_at(inter_bookmark *IBM, text_stream *text) { +inter_ti InterWarehouse::create_text_at(inter_bookmark *IBM, text_stream *text) { inter_warehouse *warehouse = InterBookmark::warehouse(IBM); inter_ti text_ID = InterWarehouse::create_text(warehouse, InterBookmark::package(IBM)); text_stream *to = InterWarehouse::get_text(warehouse, text_ID); @@ -253,7 +253,7 @@ saves redundantly storing a type field inreturn text_ID; } -text_stream *InterWarehouse::get_text(inter_warehouse *warehouse, inter_ti n) { +text_stream *InterWarehouse::get_text(inter_warehouse *warehouse, inter_ti n) { general_pointer gp = InterWarehouse::get_ref(warehouse, n); if (gp.run_time_type_code != text_stream_CLASS) return NULL; return RETRIEVE_POINTER_text_stream(gp); @@ -424,7 +424,7 @@ in order to cache the results of those two calculations. int extent; } warehouse_floor_space;+
- The structure warehouse_floor_space is accessed in 2/it, 2/in, 2/bkm, 2/np, 2/pck, 2/st, 2/sym, 2/ann, 2/trn, 3/ic, 3/iibf, 3/iitf, 3/vi, 3/ivp, 3/idt, 3/mtd, 4/tac, 4/tcc, 4/tcc2, 4/tic, 4/tic2, 4/tpc, 4/tpc3, 4/tpc4, 4/tpc5, 4/tpc6, 4/tpc7, 4/ttc, 4/tvc, 5/tac, 5/tcc, 5/tcc2, 5/tec, 5/tic, 5/tlc, 5/tlc2, 5/tlc3, 5/trc2, 5/tsc and here.
- The structure warehouse_floor_space is accessed in 2/it, 2/in, 2/bkm, 2/np, 2/pck, 2/st, 2/sym, 2/ann, 2/trn, 3/ic, 3/iibf, 3/iitf, 3/vi, 3/ivp, 3/idt, 3/mtd, 4/tac, 4/tcc, 4/tcc2, 4/tic, 4/tic2, 4/tpc, 4/tpc3, 4/tpc4, 4/tpc5, 4/tpc6, 4/tpc7, 4/ttc, 4/tvc, 5/tac, 5/tcc, 5/tcc2, 5/tec, 5/tic, 5/tlc, 5/tlc2, 5/tlc3, 5/trc, 5/trc2, 5/tsc, 5/tvc and here.
§15. We provide an API of just two functions to handle all this. Firstly, InterWarehouse::make_floor_space makes room for an instruction of n words. (This is the frame extent, and does not include the PREFRAME_SIZE.) diff --git a/docs/bytecode-module/2-tw2.html b/docs/bytecode-module/2-tw2.html index 5bf4be544..8f40173ff 100644 --- a/docs/bytecode-module/2-tw2.html +++ b/docs/bytecode-module/2-tw2.html @@ -125,12 +125,12 @@ can wire to at most one other.
-int Wiring::is_wired(inter_symbol *S) { +int Wiring::is_wired(inter_symbol *S) { if (Wiring::wired_to(S)) return TRUE; return FALSE; } -inter_symbol *Wiring::wired_to(inter_symbol *S) { +inter_symbol *Wiring::wired_to(inter_symbol *S) { if (S) return S->wiring.connects_to; return NULL; } @@ -249,7 +249,7 @@ made.-void Wiring::wire_to_name(inter_symbol *S, text_stream *T) { +void Wiring::wire_to_name(inter_symbol *S, text_stream *T) { if (S == NULL) internal_error("null symbol cannot be wired"); if (InterSymbol::is_metadata_key(S)) internal_error("metadata keys cannot be wired"); if (Str::len(T) == 0) internal_error("symbols cannot be wired to the empty name"); @@ -257,12 +257,12 @@ made. S->wiring.wants_to_connect_to = Str::duplicate(T); } -int Wiring::is_wired_to_name(inter_symbol *S) { +int Wiring::is_wired_to_name(inter_symbol *S) { if ((S) && (Str::len(S->wiring.wants_to_connect_to) > 0)) return TRUE; return FALSE; } -text_stream *Wiring::wired_to_name(inter_symbol *S) { +text_stream *Wiring::wired_to_name(inter_symbol *S) { if (S) return S->wiring.wants_to_connect_to; return NULL; } @@ -449,7 +449,7 @@ should only be used immediately after the symbol has been created.-void Wiring::make_socket_to(inter_symbol *S, inter_symbol *defn) { +void Wiring::make_socket_to(inter_symbol *S, inter_symbol *defn) { Wiring::wire_to(S, defn); InterSymbol::make_socket(S); } @@ -477,7 +477,7 @@ should only be used immediately after the symbol has been created. return plug; } -void Wiring::make_plug_wanting_identifier(inter_symbol *S, text_stream *wanted) { +void Wiring::make_plug_wanting_identifier(inter_symbol *S, text_stream *wanted) { Wiring::wire_to_name(S, wanted); InterSymbol::make_plug(S); } diff --git a/docs/bytecode-module/3-ic.html b/docs/bytecode-module/3-ic.html index ccef37460..d4b7da1d9 100644 --- a/docs/bytecode-module/3-ic.html +++ b/docs/bytecode-module/3-ic.html @@ -565,7 +565,7 @@ handled differently by each construct.VOID_METHOD_TYPE(CONSTRUCT_WRITE_MTID, inter_construct *IC, text_stream *OUT, - inter_tree_node *P, inter_error_message **E) + inter_tree_node *P) inter_error_message *InterInstruction::write_construct_text(OUTPUT_STREAM, inter_tree_node *P) { if (P->W.instruction[ID_IFLD] == NOP_IST) return NULL; @@ -578,10 +578,11 @@ handled differently by each construct. inter_error_message *E = InterInstruction::get_construct(P, &IC); if (E) return E; for (inter_ti L=0; L<P->W.instruction[LEVEL_IFLD]; L++) WRITE("\t"); - VOID_METHOD_CALL(IC, CONSTRUCT_WRITE_MTID, OUT, P, &E); + VOID_METHOD_CALL(IC, CONSTRUCT_WRITE_MTID, OUT, P); WRITE("\n"); - if (P->W.instruction[ID_IFLD] == PACKAGE_IST) PackageInstruction::write_plugs_and_sockets(OUT, P); - return E; + if (P->W.instruction[ID_IFLD] == PACKAGE_IST) + PackageInstruction::write_plugs_and_sockets(OUT, P); + return NULL; }§19. A much less elegant presentation is just to dump the hexadecimal bytecode, diff --git a/docs/bytecode-module/3-idt.html b/docs/bytecode-module/3-idt.html index dfceaa0e0..c657fc17c 100644 --- a/docs/bytecode-module/3-idt.html +++ b/docs/bytecode-module/3-idt.html @@ -372,7 +372,7 @@ only with a typename can we have an arity other than the default (e.g. a return InterTypes::unchecked(); } -inter_type InterTypes::from_TID_in_field(inter_tree_node *P, int field) { +inter_type InterTypes::from_TID_in_field(inter_tree_node *P, int field) { return InterTypes::from_TID(InterPackage::scope(Inode::get_package(P)), P->W.instruction[field]); } @@ -648,7 +648,7 @@ useful error message in response to a semisimple but not simple piece of syntax.
-inter_type InterTypes::parse_simple(inter_symbols_table *T, inter_error_location *eloc, +inter_type InterTypes::parse_simple(inter_symbols_table *T, inter_error_location *eloc, text_stream *text, inter_error_message **E) { if (Str::len(text) > 0) { inter_semisimple_type_description parsed_description; diff --git a/docs/bytecode-module/3-ie.html b/docs/bytecode-module/3-ie.html index 86a73cbf0..418d55df3 100644 --- a/docs/bytecode-module/3-ie.html +++ b/docs/bytecode-module/3-ie.html @@ -136,7 +136,7 @@ of ways.) return iem; } -inter_error_message *InterErrors::plain(text_stream *err, inter_error_location *eloc) { +inter_error_message *InterErrors::plain(text_stream *err, inter_error_location *eloc) { inter_error_message *iem = CREATE(inter_error_message); iem->error_body = Str::duplicate(err); iem->error_quote = NULL; diff --git a/docs/bytecode-module/3-iitf.html b/docs/bytecode-module/3-iitf.html index c272ac113..1afa746ab 100644 --- a/docs/bytecode-module/3-iitf.html +++ b/docs/bytecode-module/3-iitf.html @@ -246,7 +246,7 @@ scope; the name must currently be free, or an error is generated.-inter_symbol *TextualInter::new_symbol(inter_error_location *eloc, inter_symbols_table *T, +inter_symbol *TextualInter::new_symbol(inter_error_location *eloc, inter_symbols_table *T, text_stream *name, inter_error_message **E) { *E = NULL; inter_symbol *S = InterSymbolsTable::symbol_from_name(T, name); @@ -265,7 +265,7 @@ enables us to tell if it's, e.g., a variable, defined by <-inter_symbol *TextualInter::find_symbol(inter_bookmark *IBM, inter_error_location *eloc, +inter_symbol *TextualInter::find_symbol(inter_bookmark *IBM, inter_error_location *eloc, text_stream *name, inter_ti construct, inter_error_message **E) { return TextualInter::find_symbol_in_table(InterBookmark::scope(IBM), eloc, name, construct, E); } @@ -486,7 +486,7 @@ the filter test.§11. Notation for text literals.
-void TextualInter::write_text(OUTPUT_STREAM, text_stream *S) { +void TextualInter::write_text(OUTPUT_STREAM, text_stream *S) { WRITE("\""); LOOP_THROUGH_TEXT(P, S) { wchar_t c = Str::get(P); @@ -499,7 +499,7 @@ the filter test. WRITE("\""); } -inter_error_message *TextualInter::parse_literal_text(text_stream *parsed_text, +inter_error_message *TextualInter::parse_literal_text(text_stream *parsed_text, text_stream *S, int from, int to, inter_error_location *eloc) { inter_error_message *E = NULL; int literal_mode = FALSE; @@ -537,7 +537,7 @@ outer structure:-void TextualInter::write_pair(OUTPUT_STREAM, inter_tree_node *P, inter_pair pair, int hex) { +void TextualInter::write_pair(OUTPUT_STREAM, inter_tree_node *P, inter_pair pair, int hex) { inter_tree *I = Inode::tree(P); if (InterValuePairs::is_number(pair)) Print numeric literal syntax12.1 @@ -552,7 +552,7 @@ outer structure: else WRITE("<invalid-value-type>"); } -inter_error_message *TextualInter::parse_pair(text_stream *line, inter_error_location *eloc, +inter_error_message *TextualInter::parse_pair(text_stream *line, inter_error_location *eloc, inter_bookmark *IBM, inter_type type_wanted, text_stream *S, inter_pair *pair) { inter_symbols_table *scope = InterBookmark::scope(IBM); inter_tree *I = InterBookmark::tree(IBM); @@ -873,7 +873,7 @@ therefore used typelessly.-void TextualInter::write_optional_type_marker(OUTPUT_STREAM, inter_tree_node *P, int field) { +void TextualInter::write_optional_type_marker(OUTPUT_STREAM, inter_tree_node *P, int field) { inter_type type = InterTypes::from_TID_in_field(P, field); if (type.type_name) { WRITE("("); TextualInter::write_symbol_from(OUT, P, field); WRITE(") "); diff --git a/docs/bytecode-module/3-ivp.html b/docs/bytecode-module/3-ivp.html index 8acfef601..563b80b73 100644 --- a/docs/bytecode-module/3-ivp.html +++ b/docs/bytecode-module/3-ivp.html @@ -324,7 +324,7 @@ expects to find a definition in some other tree when linking takes place.-inter_pair InterValuePairs::symbolic(inter_bookmark *IBM, inter_symbol *S) { +inter_pair InterValuePairs::symbolic(inter_bookmark *IBM, inter_symbol *S) { return InterValuePairs::symbolic_in(InterBookmark::package(IBM), S); } @@ -438,7 +438,7 @@ which return inter_pair to signal-inter_pair InterValuePairs::undef(void) { +inter_pair InterValuePairs::undef(void) { inter_pair pair; pair.data_format = UNDEF_IVAL; pair.data_content = 0; @@ -460,7 +460,7 @@ following functions:-inter_pair InterValuePairs::get(inter_tree_node *P, int field) { +inter_pair InterValuePairs::get(inter_tree_node *P, int field) { inter_pair pair; pair.data_format = P->W.instruction[field]; pair.data_content = P->W.instruction[field+1]; diff --git a/docs/bytecode-module/3-vi.html b/docs/bytecode-module/3-vi.html index 9552de4aa..c24873e44 100644 --- a/docs/bytecode-module/3-vi.html +++ b/docs/bytecode-module/3-vi.html @@ -296,7 +296,7 @@ or FUNCTION_ITCONC-inter_error_message *VerifyingInter::TID_field(inter_package *owner, inter_tree_node *P, +inter_error_message *VerifyingInter::TID_field(inter_package *owner, inter_tree_node *P, int field) { inter_ti TID = P->W.instruction[field]; if (TID == 0) return NULL; @@ -308,7 +308,7 @@ or FUNCTION_ITCONC-inter_error_message *VerifyingInter::text_field(inter_package *owner, inter_tree_node *P, +inter_error_message *VerifyingInter::text_field(inter_package *owner, inter_tree_node *P, int field) { inter_ti text_ID = P->W.instruction[field]; inter_warehouse *W = InterTree::warehouse(Inode::tree(P)); @@ -357,7 +357,7 @@ the context of the current package:-inter_error_message *VerifyingInter::data_pair_fields(inter_package *owner, +inter_error_message *VerifyingInter::data_pair_fields(inter_package *owner, inter_tree_node *P, int first_field, inter_type type) { return InterValuePairs::verify(owner, P, InterValuePairs::get(P, first_field), type); } diff --git a/docs/bytecode-module/4-tac.html b/docs/bytecode-module/4-tac.html index a2ffa4558..419206b29 100644 --- a/docs/bytecode-module/4-tac.html +++ b/docs/bytecode-module/4-tac.html @@ -151,8 +151,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void AppendInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void AppendInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *S = InterSymbolsTable::symbol_from_ID_at_node(P, SYMBOL_APPEND_IFLD); text_stream *content = Inode::ID_to_text(P, P->W.instruction[CONTENT_APPEND_IFLD]); WRITE("append %S ", InterSymbol::identifier(S)); diff --git a/docs/bytecode-module/4-tcc.html b/docs/bytecode-module/4-tcc.html index 1607b3e60..4b9d5a14a 100644 --- a/docs/bytecode-module/4-tcc.html +++ b/docs/bytecode-module/4-tcc.html @@ -141,8 +141,7 @@ compulsory words ID_IFLD-void CommentInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void CommentInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { text_stream *S = Inode::ID_to_text(P, P->W.instruction[TEXT_COMMENT_IFLD]); if (Str::len(S) > 0) WRITE("#%S", S); } diff --git a/docs/bytecode-module/4-tcc2.html b/docs/bytecode-module/4-tcc2.html index 09ecef91a..ab3eb660d 100644 --- a/docs/bytecode-module/4-tcc2.html +++ b/docs/bytecode-module/4-tcc2.html @@ -341,8 +341,7 @@ can therefore be calculated as half of (the instruction extent minus §6. Writing to textual Inter syntax.-void ConstantInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void ConstantInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *con_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_CONST_IFLD); int hex = FALSE; if (SymbolAnnotation::get_b(con_name, HEX_IANN)) hex = TRUE; diff --git a/docs/bytecode-module/4-tdc.html b/docs/bytecode-module/4-tdc.html index 9ba3ba0d4..93d3fee83 100644 --- a/docs/bytecode-module/4-tdc.html +++ b/docs/bytecode-module/4-tdc.html @@ -143,8 +143,7 @@ say, int32.§5. Writing to textual Inter syntax.
-void DefaultValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void DefaultValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *typename = InterSymbolsTable::symbol_from_ID_at_node(P, TYPE_DEF_IFLD); WRITE("defaultvalue %S = ", InterSymbol::identifier(typename)); TextualInter::write_pair(OUT, P, InterValuePairs::get(P, VAL1_DEF_IFLD), FALSE); diff --git a/docs/bytecode-module/4-tic.html b/docs/bytecode-module/4-tic.html index 2b16bd100..a7726c0a2 100644 --- a/docs/bytecode-module/4-tic.html +++ b/docs/bytecode-module/4-tic.html @@ -141,8 +141,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void InsertInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void InsertInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { text_stream *insertion = InsertInstruction::insertion(P); WRITE("insert "); TextualInter::write_text(OUT, insertion); diff --git a/docs/bytecode-module/4-tic2.html b/docs/bytecode-module/4-tic2.html index 307b99fb4..b1de28746 100644 --- a/docs/bytecode-module/4-tic2.html +++ b/docs/bytecode-module/4-tic2.html @@ -206,8 +206,7 @@ the typename_s that it has a new instance.§5. Writing to textual Inter syntax.
-void InstanceInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void InstanceInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *instance_s = InstanceInstruction::instance(P); inter_symbol *typename_s = InterSymbolsTable::symbol_from_ID_at_node(P, TYPE_INST_IFLD); WRITE("instance %S %S = ", InterSymbol::identifier(instance_s), InterSymbol::identifier(typename_s)); diff --git a/docs/bytecode-module/4-tnc.html b/docs/bytecode-module/4-tnc.html index c918611da..f5d0f9878 100644 --- a/docs/bytecode-module/4-tnc.html +++ b/docs/bytecode-module/4-tnc.html @@ -109,8 +109,7 @@ all the same, purely so that a stack backtrace will show it.-void NopInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void NopInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { WRITE("nop"); }diff --git a/docs/bytecode-module/4-tpc.html b/docs/bytecode-module/4-tpc.html index 7cf5561bf..e0586b3fb 100644 --- a/docs/bytecode-module/4-tpc.html +++ b/docs/bytecode-module/4-tpc.html @@ -239,8 +239,7 @@ a binary Inter file.§7. Writing to textual Inter syntax.
-void PackageInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PackageInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_package *pack = PackageInstruction::at_this_head(P); inter_symbol *ptype_name = InterSymbolsTable::global_symbol_from_ID_at_node(P, PTYPE_PACKAGE_IFLD); @@ -260,13 +259,13 @@ to ensure that any in the symbols table are recorded in the textual output: int L = (int) (P->W.instruction[LEVEL_IFLD] + 1); LOOP_OVER_SYMBOLS_TABLE(S, locals) { if (InterSymbol::is_plug(S)) { - PlugInstruction::write_declaration(OUT, S, L); + PlugInstruction::write_declaration(OUT, S, L); WRITE("\n"); } } LOOP_OVER_SYMBOLS_TABLE(S, locals) { if (InterSymbol::is_socket(S)) { - PlugInstruction::write_declaration(OUT, S, L); + PlugInstruction::write_declaration(OUT, S, L); WRITE("\n"); } } diff --git a/docs/bytecode-module/4-tpc2.html b/docs/bytecode-module/4-tpc2.html index a1413af04..314309c33 100644 --- a/docs/bytecode-module/4-tpc2.html +++ b/docs/bytecode-module/4-tpc2.html @@ -122,8 +122,7 @@ compulsory words ID_IFLD§4. Writing to textual Inter syntax.-void PackageTypeInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PackageTypeInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *ptype_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_PTYPE_IFLD); WRITE("packagetype %S", InterSymbol::identifier(ptype_name)); } diff --git a/docs/bytecode-module/4-tpc3.html b/docs/bytecode-module/4-tpc3.html index 272b17b87..033bb8e75 100644 --- a/docs/bytecode-module/4-tpc3.html +++ b/docs/bytecode-module/4-tpc3.html @@ -224,8 +224,7 @@ messages if we report early.§5. Writing to textual Inter syntax.
-void PermissionInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PermissionInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *prop_s = PermissionInstruction::property(P); inter_symbol *owner_s = PermissionInstruction::owner(P); inter_symbol *storage_s = PermissionInstruction::storage(P); diff --git a/docs/bytecode-module/4-tpc4.html b/docs/bytecode-module/4-tpc4.html index 7f4b18dae..5a50cf6e5 100644 --- a/docs/bytecode-module/4-tpc4.html +++ b/docs/bytecode-module/4-tpc4.html @@ -147,8 +147,7 @@ whereas the content is parsed as a double-quoted literal.§5. Writing to textual Inter syntax.
-void PragmaInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PragmaInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { WRITE("pragma %S ", PragmaInstruction::target(P)); TextualInter::write_text(OUT, PragmaInstruction::content(P)); } diff --git a/docs/bytecode-module/4-tpc5.html b/docs/bytecode-module/4-tpc5.html index 7742d446d..b8959bfa6 100644 --- a/docs/bytecode-module/4-tpc5.html +++ b/docs/bytecode-module/4-tpc5.html @@ -183,8 +183,7 @@ a primitive ins§5. Writing to textual Inter syntax.
-void PrimitiveInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PrimitiveInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *prim_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_PRIM_IFLD); WRITE("primitive %S", InterSymbol::identifier(prim_name)); for (int i=SIGNATURE_PRIM_IFLD; i<P->W.extent-1; i++) { diff --git a/docs/bytecode-module/4-tpc6.html b/docs/bytecode-module/4-tpc6.html index 3e51af36f..577bfdb30 100644 --- a/docs/bytecode-module/4-tpc6.html +++ b/docs/bytecode-module/4-tpc6.html @@ -158,8 +158,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void PropertyInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PropertyInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *prop_name = InterSymbolsTable::symbol_from_ID_at_node(P, DEFN_PROP_IFLD); WRITE("property "); TextualInter::write_optional_type_marker(OUT, P, TYPE_PROP_IFLD); diff --git a/docs/bytecode-module/4-tpc7.html b/docs/bytecode-module/4-tpc7.html index b78bab854..f6b5d7d1d 100644 --- a/docs/bytecode-module/4-tpc7.html +++ b/docs/bytecode-module/4-tpc7.html @@ -229,8 +229,7 @@ value to the list of properties of the owner.§5. Writing to textual Inter syntax.
-void PropertyValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void PropertyValueInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *prop_s = PropertyValueInstruction::property(P); inter_symbol *owner_s = PropertyValueInstruction::owner(P); WRITE("propertyvalue %S %S = ", diff --git a/docs/bytecode-module/4-ttc.html b/docs/bytecode-module/4-ttc.html index d2f99714e..317ffb117 100644 --- a/docs/bytecode-module/4-ttc.html +++ b/docs/bytecode-module/4-ttc.html @@ -224,8 +224,7 @@ length is flexible: there can be any number of operands from 0 upwards.§5. Writing to textual Inter syntax.
-void TypenameInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void TypenameInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *typename_s = TypenameInstruction::typename(P); WRITE("typename %S ", InterSymbol::identifier(typename_s)); inter_symbol *super = TypenameInstruction::super(typename_s); diff --git a/docs/bytecode-module/4-tvc.html b/docs/bytecode-module/4-tvc.html index 414293a6d..a64f11f54 100644 --- a/docs/bytecode-module/4-tvc.html +++ b/docs/bytecode-module/4-tvc.html @@ -166,8 +166,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void VariableInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void VariableInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_symbol *var_s = VariableInstruction::variable(P); WRITE("variable "); TextualInter::write_optional_type_marker(OUT, P, TYPE_VAR_IFLD); diff --git a/docs/bytecode-module/5-tac.html b/docs/bytecode-module/5-tac.html index 886986cfd..3798c1bc5 100644 --- a/docs/bytecode-module/5-tac.html +++ b/docs/bytecode-module/5-tac.html @@ -152,8 +152,7 @@ is required to be one of these:§5. Writing to textual Inter syntax.
-void AssemblyInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void AssemblyInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { inter_ti which = AssemblyInstruction::which_marker(P); switch (which) { case ASM_ARROW_ASMMARKER: WRITE("assembly store_to"); break; diff --git a/docs/bytecode-module/5-tcc.html b/docs/bytecode-module/5-tcc.html index 6a28b69a1..dd042aedb 100644 --- a/docs/bytecode-module/5-tcc.html +++ b/docs/bytecode-module/5-tcc.html @@ -163,8 +163,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void CastInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void CastInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { WRITE("cast "); TextualInter::write_compulsory_type_marker(OUT, P, TO_KIND_CAST_IFLD); WRITE(" <- "); diff --git a/docs/bytecode-module/5-tcc2.html b/docs/bytecode-module/5-tcc2.html index 619b2f60c..a3a576b08 100644 --- a/docs/bytecode-module/5-tcc2.html +++ b/docs/bytecode-module/5-tcc2.html @@ -137,8 +137,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void CodeInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void CodeInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { WRITE("code"); }diff --git a/docs/bytecode-module/5-tec.html b/docs/bytecode-module/5-tec.html index 653c8f37d..dd8feca7a 100644 --- a/docs/bytecode-module/5-tec.html +++ b/docs/bytecode-module/5-tec.html @@ -135,8 +135,7 @@ compulsory words ID_IFLD§5. Writing to textual Inter syntax.-void EvaluationInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { +void EvaluationInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { WRITE("evaluation"); }diff --git a/docs/bytecode-module/5-tic.html b/docs/bytecode-module/5-tic.html index 0c4a209d6..99f5abd14 100644 --- a/docs/bytecode-module/5-tic.html +++ b/docs/bytecode-module/5-tic.html @@ -382,9 +382,8 @@ The default is 0, which means §8. Writing to textual Inter syntax.-void InvInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P, - inter_error_message **E) { - switch (P->W.instruction[METHOD_INV_IFLD]) { +void InvInstruction::write(inter_construct *IC, OUTPUT_STREAM, inter_tree_node *P) { + switch (InvInstruction::method(P)) { case PRIMITIVE_INVMETH: WRITE("inv %S", InterSymbol::identifier(InvInstruction::primitive(P))); break; @@ -401,30 +400,42 @@ The default is 0, which means §9. Access functions.-inter_symbol *InvInstruction::function(inter_tree_node *P) { +inter_ti InvInstruction::method(inter_tree_node *P) { + if (P->W.instruction[ID_IFLD] == INV_IST) return P->W.instruction[METHOD_INV_IFLD]; + return 0; +} + +inter_symbol *InvInstruction::function(inter_tree_node *P) { if ((P->W.instruction[ID_IFLD] == INV_IST) && - (P->W.instruction[METHOD_INV_IFLD] == FUNCTION_INVMETH)) + (InvInstruction::method(P) == FUNCTION_INVMETH)) return InterSymbolsTable::symbol_from_ID_at_node(P, INVOKEE_INV_IFLD); return NULL; } -inter_symbol *InvInstruction::primitive(inter_tree_node *P) { +inter_symbol *InvInstruction::primitive(inter_tree_node *P) { if ((P->W.instruction[ID_IFLD] == INV_IST) && - (P->W.instruction[METHOD_INV_IFLD] == PRIMITIVE_INVMETH)) + (InvInstruction::method(P) == PRIMITIVE_INVMETH)) return InterSymbolsTable::global_symbol_from_ID_at_node(P, INVOKEE_INV_IFLD); return NULL; } + +text_stream *InvInstruction::opcode(inter_tree_node *P) { + if ((P->W.instruction[ID_IFLD] == INV_IST) && + (InvInstruction::method(P) == OPCODE_INVMETH)) + return Inode::ID_to_text(P, P->W.instruction[INVOKEE_INV_IFLD]); + return NULL; +}-§10. In Transmigration, it's necessary to change primitive invocations so that -they refer to primitives in the destination tree, not the origin. So: +
§10. In Transmigration and for various other reasons, it's necessary to change +an invocation into a primitive, or a different primitive. So:
-void InvInstruction::write_primitive(inter_tree *I, inter_tree_node *P, inter_symbol *prim) { - if ((P->W.instruction[ID_IFLD] == INV_IST) && - (P->W.instruction[METHOD_INV_IFLD] == PRIMITIVE_INVMETH)) +void InvInstruction::write_primitive(inter_tree *I, inter_tree_node *P, inter_symbol *prim) { + if (P->W.instruction[ID_IFLD] == INV_IST) { + P->W.instruction[METHOD_INV_IFLD] = PRIMITIVE_INVMETH; P->W.instruction[INVOKEE_INV_IFLD] = InterSymbolsTable::id_from_symbol(I, NULL, prim); - else internal_error("wrote primitive to non-primitive invocation"); + } else internal_error("wrote primitive to non-invocation"); }