/* ------------------------------------------------------------------------- */
/* "directs" : Directives (# commands) */
/* */
-/* Part of Inform 6.40 */
+/* Part of Inform 6.41 */
/* copyright (c) Graham Nelson 1993 - 2022 */
/* */
/* Inform is free software: you can redistribute it and/or modify */
} while (TRUE);
/* --------------------------------------------------------------------- */
- /* Array arrayname array... */
+ /* Array <arrayname> [static] <array specification> */
/* --------------------------------------------------------------------- */
- case ARRAY_CODE: make_global(TRUE, FALSE); break; /* See "tables.c" */
+ case ARRAY_CODE: make_array(); break; /* See "arrays.c" */
/* --------------------------------------------------------------------- */
/* Attribute newname [alias oldname] */
/* --------------------------------------------------------------------- */
case DEFAULT_CODE:
- if (module_switch)
- { error("'Default' cannot be used in -M (Module) mode");
- panic_mode_error_recovery(); return FALSE;
- }
-
get_next_token();
if (token_type != SYMBOL_TT)
return ebf_error_recover("name", token_text);
make_fake_action(); break; /* see "verbs.c" */
/* --------------------------------------------------------------------- */
- /* Global variable [= value / array...] */
+ /* Global <variablename> [ [=] <value> ] */
/* --------------------------------------------------------------------- */
- case GLOBAL_CODE: make_global(FALSE, FALSE); break; /* See "tables.c" */
+ case GLOBAL_CODE: make_global(); break; /* See "arrays.c" */
/* --------------------------------------------------------------------- */
/* If... */
/* --------------------------------------------------------------------- */
/* Import global <varname> [, ...] */
- /* */
- /* (Further imported goods may be allowed later.) */
/* --------------------------------------------------------------------- */
case IMPORT_CODE:
- if (!module_switch)
- { error("'Import' can only be used in -M (Module) mode");
- panic_mode_error_recovery(); return FALSE;
- }
- directives.enabled = TRUE;
- do
- { get_next_token();
- if ((token_type == DIRECTIVE_TT) && (token_value == GLOBAL_CODE))
- make_global(FALSE, TRUE);
- else error_named("'Import' cannot import things of this type:",
- token_text);
- get_next_token();
- } while ((token_type == SEP_TT) && (token_value == COMMA_SEP));
- put_token_back();
- directives.enabled = FALSE;
+ error("The 'Import' directive is no longer supported.");
break;
/* --------------------------------------------------------------------- */
case LINK_CODE:
get_next_token();
- if (token_type != DQ_TT)
- return ebf_error_recover("filename in double-quotes", token_text);
- if (strlen(token_text) >= PATHLEN-1) {
- error_numbered("'Link' filename is too long; max length is", PATHLEN-1);
- break;
- }
- link_module(token_text); /* See "linker.c" */
+ error("The 'Link' directive is no longer supported.");
break;
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
case LOWSTRING_CODE:
- if (module_switch)
- { error("'LowString' cannot be used in -M (Module) mode");
- panic_mode_error_recovery(); return FALSE;
- }
if (glulx_mode) {
error("The LowString directive has no meaning in Glulx.");
panic_mode_error_recovery(); return FALSE;
/* --------------------------------------------------------------------- */
case STATUSLINE_CODE:
- if (module_switch)
- warning("This does not set the final game's statusline");
-
directive_keywords.enabled = TRUE;
get_next_token();
directive_keywords.enabled = FALSE;
if (token_type != DQ_TT)
return ebf_error_recover("string of switches", token_text);
if (!ignore_switches_switch)
- { if (constant_made_yet)
- error("A 'Switches' directive must must come before \
-the first constant definition");
+ {
+ if (constant_made_yet) {
+ error("A 'Switches' directive must must come before the first constant definition");
+ break;
+ }
+ if (no_routines > 1)
+ {
+ /* The built-in Main__ routine is number zero. */
+ error("A 'Switches' directive must come before the first routine definition.");
+ break;
+ }
+ obsolete_warning("the Switches directive is deprecated and may produce incorrect results. Use command-line arguments or header comments.");
switches(token_text, 0); /* see "inform.c" */
}
break;
/* [on/off/NUM] {same as "assembly"} */
/* assembly [on/off/NUM] */
/* expressions [on/off/NUM] */
- /* lines [on/off/NUM] */
+ /* lines [on/off/NUM] {not supported} */
/* tokens [on/off/NUM] */
- /* linker [on/off/NUM] */
+ /* linker [on/off/NUM] {not supported} */
/* */
/* The first four trace commands immediately display a compiler table. */
/* The rest set or clear an ongoing trace. */
trace_level = &expr_trace_level; break;
case TOKENS_TK:
trace_level = &tokens_trace_level; break;
- case LINKER_TK:
- trace_level = &linker_trace_level; break;
case DICTIONARY_TK:
case SYMBOLS_TK:
case OBJECTS_TK:
case VERBS_TK:
+ /* show a table rather than changing any trace level */
trace_level = NULL; break;
case LINES_TK:
/* never implememented */
trace_level = NULL; break;
+ case LINKER_TK:
+ /* no longer implememented */
+ trace_level = NULL; break;
default:
+ /* default to "Trace assembly" */
put_token_back();
trace_level = &asm_trace_level; break;
}
HandleTraceKeyword:
- if (i == LINES_TK) {
+ if (i == LINES_TK || i == LINKER_TK) {
warning_named("Trace option is not supported:", trace_keywords.keywords[i]);
break;
}
{ error("The version number must be in the range 3 to 8");
break;
}
+ obsolete_warning("the Version directive is deprecated and may produce incorrect results. Use -vN instead, as either a command-line argument or a header comment.");
select_version(i);
/* We must now do a small dance to reset the DICT_ENTRY_BYTES
constant, which was defined at startup based on the Z-code