* give error with local external procedure

This commit is contained in:
peter 2001-04-13 18:03:15 +00:00
parent 0ab9a77390
commit 79b1b63dcb
4 changed files with 268 additions and 257 deletions

View File

@ -137,9 +137,9 @@ scan_f_end_of_file=02000_F_Unexpected end of file
scan_f_string_exceeds_line=02001_F_String exceeds line
% You forgot probably to include the closing ' in a string, so it occupies
% multiple lines.
scan_f_illegal_char=02002_F_illegal character $1 ($2)
scan_f_illegal_char=02002_F_illegal character "$1" ($2)
% An illegal character was encountered in the input file.
scan_f_syn_expected=02003_F_Syntax error, $1 expected but $2 found
scan_f_syn_expected=02003_F_Syntax error, "$1" expected but "$2" found
% This indicates that the compiler expected a different token than
% the one you typed. It can occur almost everywhere where you make a
% mistake against the pascal language.
@ -167,10 +167,10 @@ scan_e_illegal_char_const=02011_E_Illegal char constant
% This happens when you specify a character with its ASCII code, as in
% \var{\#96}, but the number is either illegal, or out of range. The range
% is 1-255.
scan_f_cannot_open_input=02012_F_Can't open file $1
scan_f_cannot_open_input=02012_F_Can't open file "$1"
% \fpc cannot find the program or unit source file you specified on the
% command line.
scan_f_cannot_open_includefile=02013_F_Can't open include file $1
scan_f_cannot_open_includefile=02013_F_Can't open include file "$1"
% \fpc cannot find the source file you specified in a \var{\{\$include ..\}}
% statement.
scan_e_too_much_endifs=02014_E_Too many $ENDIFs or $ELSEs
@ -282,7 +282,7 @@ scan_e_wrong_switch_toggle=02052_E_Wrong switch toggle, use ON/OFF or +/-
scan_e_resourcefiles_not_supported=02053_E_Resource files are not supported for this target
% The target you are compiling for doesn't support resource files. The
% only targets which can use resource files are Win32 and OS/2 (EMX) currently
scan_w_include_env_not_found=02054_W_Include environment $1 not found in environment
scan_w_include_env_not_found=02054_W_Include environment "$1" not found in environment
% The included environment variable can't be found in the environment, it'll
% be replaced by an empty string instead.
scan_e_invalid_maxfpureg_value=02055_E_Illegal value for FPU register limit
@ -300,6 +300,8 @@ scan_e_invalid_interface_type=02058_E_Illegal interface type specified. Valids a
#
# Parser
#
# 03174 is the last used one
#
% \section{Parser messages}
% This section lists all parser messages. The parser takes care of the
% semantics of you language, i.e. it determines if your pascal constructs
@ -879,7 +881,7 @@ parser_e_no_export_of_variables_for_target=03164_E_Exporting of variables is not
parser_e_improper_guid_syntax=03165_E_Improper GUID syntax
parser_f_interface_cant_have_variables=03166_F_An interface can't have variables
parser_f_interface_cant_have_constr_or_destr=03167_F_An interface can't have constructor or destructor
parser_w_interface_mapping_notfound=03168_W_Procedure named $1 not found that is suitable for implementing the $2.$3
parser_w_interface_mapping_notfound=03168_W_Procedure named "$1" not found that is suitable for implementing the $2.$3
parser_e_interface_id_expected=03169_E_interface identifier expected
% This happens when the compiler scans a \var{class} declaration that contains
% \var{interface} function name mapping code like this:
@ -903,6 +905,9 @@ parser_e_no_access_specifier_in_interfaces=03172_E_Access specifiers can't be us
parser_e_no_vars_in_interfaces=03173_E_An interface can't contain fields
% Declarations of fields aren't allowed in interfaces. An interface
% can contain only methods
parser_e_no_local_external=03174_E_Can't declare local procedure as EXTERNAL
% Declaring local procedures as external is not possible. Local procedures
% get hidden parameters that will make the chance on errors very high
% \end{description}
#
# Type Checking
@ -1979,4 +1984,4 @@ option_help_pages=11025_[
#
# The End...
#
#

View File

@ -249,6 +249,7 @@ const
parser_e_no_con_des_in_interfaces=03171;
parser_e_no_access_specifier_in_interfaces=03172;
parser_e_no_vars_in_interfaces=03173;
parser_e_no_local_external=03174;
type_e_mismatch=04000;
type_e_incompatible_types=04001;
type_e_not_equal_types=04002;
@ -586,9 +587,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 32693;
MsgTxtSize = 32757;
MsgIdxMax : array[1..20] of longint=(
17,59,174,37,41,41,98,14,35,41,
17,59,175,37,41,41,98,14,35,41,
30,1,1,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff

View File

@ -1014,6 +1014,9 @@ var
import_nr : word;
begin
aktprocsym.definition.forwarddef:=false;
{ forbid local external procedures }
if lexlevel>normal_function_level then
Message(parser_e_no_local_external);
{ If the procedure should be imported from a DLL, a constant string follows.
This isn't really correct, an contant string expression follows
so we check if an semicolon follows, else a string constant have to
@ -1842,7 +1845,10 @@ const
end.
{
$Log$
Revision 1.18 2001-04-13 01:22:11 peter
Revision 1.19 2001-04-13 18:03:16 peter
* give error with local external procedure
Revision 1.18 2001/04/13 01:22:11 peter
* symtable change to classes
* range check generation and errors fixed, make cycle DEBUG=1 works
* memory leaks fixed