projects
/
inform.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to Inform v6.42
[inform.git]
/
src
/
arrays.c
diff --git
a/src/arrays.c
b/src/arrays.c
index c48cc65dfbf85fc7ed2f57a29b59ba8a23e78094..82caa7cb11ba187142d4ebf87ad480b57603dbc1 100644
(file)
--- a/
src/arrays.c
+++ b/
src/arrays.c
@@
-3,8
+3,8
@@
/* likewise global variables, which are in some ways a */
/* simpler form of the same thing. */
/* */
/* likewise global variables, which are in some ways a */
/* simpler form of the same thing. */
/* */
-/* Part of Inform 6.4
1
*/
-/* copyright (c) Graham Nelson 1993 - 202
2
*/
+/* Part of Inform 6.4
2
*/
+/* copyright (c) Graham Nelson 1993 - 202
4
*/
/* */
/* Inform is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* */
/* Inform is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
@@
-292,7
+292,7
@@
extern void make_global()
int name_length;
assembly_operand AO;
int name_length;
assembly_operand AO;
- int32 globalnum;
+
u
int32 globalnum;
int32 global_symbol;
debug_location_beginning beginning_debug_location =
get_token_location_beginning();
int32 global_symbol;
debug_location_beginning beginning_debug_location =
get_token_location_beginning();
@@
-322,7
+322,7
@@
extern void make_global()
if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
- ebf_
error("new global variable name", token_text
);
+ ebf_
curtoken_error("new global variable name"
);
panic_mode_error_recovery(); return;
}
panic_mode_error_recovery(); return;
}
@@
-413,7
+413,7
@@
extern void make_global()
4*globalnum);
}
4*globalnum);
}
- if (globalnum
< 0 || globalnum
>= global_initial_value_memlist.count)
+ if (globalnum >= global_initial_value_memlist.count)
compiler_error("Globalnum out of range");
global_initial_value[globalnum] = AO.value;
compiler_error("Globalnum out of range");
global_initial_value[globalnum] = AO.value;
@@
-456,7
+456,7
@@
extern void make_array()
if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
if (token_type != SYMBOL_TT)
{ discard_token_location(beginning_debug_location);
- ebf_
error("new array name", token_text
);
+ ebf_
curtoken_error("new array name"
);
panic_mode_error_recovery(); return;
}
panic_mode_error_recovery(); return;
}
@@
-492,7
+492,7
@@
extern void make_array()
if ((token_type == SEP_TT) && (token_value == SEMICOLON_SEP))
{
discard_token_location(beginning_debug_location);
if ((token_type == SEP_TT) && (token_value == SEMICOLON_SEP))
{
discard_token_location(beginning_debug_location);
- ebf_
error("array definition", token_text
);
+ ebf_
curtoken_error("array definition"
);
put_token_back();
return;
}
put_token_back();
return;
}
@@
-516,8
+516,7
@@
extern void make_array()
array_type = BUFFER_ARRAY;
else
{ discard_token_location(beginning_debug_location);
array_type = BUFFER_ARRAY;
else
{ discard_token_location(beginning_debug_location);
- ebf_error
- ("'->', '-->', 'string', 'table' or 'buffer'", token_text);
+ ebf_curtoken_error("'->', '-->', 'string', 'table' or 'buffer'");
panic_mode_error_recovery();
return;
}
panic_mode_error_recovery();
return;
}
@@
-632,6
+631,8
@@
extern void make_array()
put_token_back();
AO = parse_expression(ARRAY_CONTEXT);
put_token_back();
AO = parse_expression(ARRAY_CONTEXT);
+ if (AO.marker == ERROR_MV)
+ break;
if (i == 0)
{ get_next_token();
if (i == 0)
{ get_next_token();
@@
-656,7
+657,7
@@
extern void make_array()
get_next_token();
if (token_type != DQ_TT)
get_next_token();
if (token_type != DQ_TT)
- { ebf_
error("literal text in double-quotes", token_text
);
+ { ebf_
curtoken_error("literal text in double-quotes"
);
token_text = "error";
}
token_text = "error";
}
@@
-705,6
+706,7
@@
advance as part of 'Zcharacter table':", unicode);
i = 0;
while (TRUE)
{
i = 0;
while (TRUE)
{
+ assembly_operand AO;
/* This isn't the start of a statement, but it's safe to
release token texts anyway. Expressions in an array
list are independent of each other. */
/* This isn't the start of a statement, but it's safe to
release token texts anyway. Expressions in an array
list are independent of each other. */
@@
-719,11
+721,14
@@
advance as part of 'Zcharacter table':", unicode);
been missed, and the programmer is now starting
a new routine */
been missed, and the programmer is now starting
a new routine */
- ebf_
error("']'", token_text
);
+ ebf_
curtoken_error("']'"
);
put_token_back(); break;
}
put_token_back();
put_token_back(); break;
}
put_token_back();
- array_entry(i, is_static, parse_expression(ARRAY_CONTEXT));
+ AO = parse_expression(ARRAY_CONTEXT);
+ if (AO.marker == ERROR_MV)
+ break;
+ array_entry(i, is_static, AO);
i++;
}
}
i++;
}
}
@@
-864,7
+869,7
@@
extern void arrays_allocate_arrays(void)
"global variable values");
initialise_memory_list(¤t_array_name,
"global variable values");
initialise_memory_list(¤t_array_name,
- sizeof(char),
MAX_IDENTIFIER_LENGTH+1
, NULL,
+ sizeof(char),
32
, NULL,
"array name currently being defined");
}
"array name currently being defined");
}