/* checks syntax and translates such directives into */
/* specifications for the object-maker. */
/* */
-/* Copyright (c) Graham Nelson 1993 - 2020 */
-/* */
-/* This file is part of Inform. */
+/* Part of Inform 6.35 */
+/* copyright (c) Graham Nelson 1993 - 2020 */
/* */
/* Inform is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with Inform. If not, see https://gnu.org/licenses/ */
+/* along with Inform. If not, see https://gnu.org/licenses/ *
/* */
/* ------------------------------------------------------------------------- */
get_next_token();
i = token_value; name = token_text;
- if ((token_type != SYMBOL_TT) || (!(sflags[i] & UNKNOWN_SFLAG)))
+ if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
ebf_error("new attribute name", token_text);
panic_mode_error_recovery();
put_token_back();
return;
}
+ if (!(sflags[i] & UNKNOWN_SFLAG))
+ { discard_token_location(beginning_debug_location);
+ ebf_symbol_error("new attribute name", token_text, typename(stypes[i]), slines[i]);
+ panic_mode_error_recovery();
+ put_token_back();
+ return;
+ }
directive_keywords.enabled = TRUE;
get_next_token();
get_next_token();
i = token_value; name = token_text;
- if ((token_type != SYMBOL_TT) || (!(sflags[i] & UNKNOWN_SFLAG)))
+ if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
ebf_error("new property name", token_text);
panic_mode_error_recovery();
put_token_back();
return;
}
+ if (!(sflags[i] & UNKNOWN_SFLAG))
+ { discard_token_location(beginning_debug_location);
+ ebf_symbol_error("new property name", token_text, typename(stypes[i]), slines[i]);
+ panic_mode_error_recovery();
+ put_token_back();
+ return;
+ }
directive_keywords.enabled = TRUE;
get_next_token();
{ if (stypes[token_value]==INDIVIDUAL_PROPERTY_T)
this_identifier_number = svals[token_value];
else
- { char already_error[128];
- sprintf(already_error,
- "\"%s\" is a name already in use (with type %s) \
-and may not be used as a property name too",
- token_text, typename(stypes[token_value]));
- error(already_error);
+ { ebf_symbol_error("property name", token_text, typename(stypes[token_value]), slines[token_value]);
return;
}
}
warning_named("Version 3 limit of 4 values per property exceeded \
(use -v5 to get 32), so truncating property",
(char *) symbs[property_name_symbol]);
- full_object.pp[next_prop].l=4;
+ length = 8;
}
}
{ if (stypes[token_value]==INDIVIDUAL_PROPERTY_T)
this_identifier_number = svals[token_value];
else
- { char already_error[128];
- sprintf(already_error,
- "\"%s\" is a name already in use (with type %s) \
-and may not be used as a property name too",
- token_text, typename(stypes[token_value]));
- error(already_error);
+ { ebf_symbol_error("property name", token_text, typename(stypes[token_value]), slines[token_value]);
return;
}
}
}
else
{ get_next_token();
- if ((token_type != SYMBOL_TT)
- || (!(sflags[token_value] & UNKNOWN_SFLAG)))
+ if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
ebf_error("new class name", token_text);
panic_mode_error_recovery();
return;
}
+ if (!(sflags[token_value] & UNKNOWN_SFLAG))
+ { discard_token_location(beginning_debug_location);
+ ebf_symbol_error("new class name", token_text, typename(stypes[token_value]), slines[token_value]);
+ panic_mode_error_recovery();
+ return;
+ }
}
/* Each class also creates a modest object representing itself: */
if (token_type == DQ_TT) textual_name = token_text;
else
- { if ((token_type != SYMBOL_TT)
- || (!(sflags[token_value] & UNKNOWN_SFLAG)))
+ { if (token_type != SYMBOL_TT) {
ebf_error("name for new object or its textual short name",
token_text);
+ }
+ else if (!(sflags[token_value] & UNKNOWN_SFLAG)) {
+ ebf_symbol_error("new object", token_text, typename(stypes[token_value]), slines[token_value]);
+ }
else
{ internal_name_symbol = token_value;
strcpy(internal_name, token_text);