Merge pull request #46 from alliedmodders/methodmaps-inline-2

Add support for inline native methods on methodmaps.
This commit is contained in:
David Anderson 2014-06-22 01:58:22 -07:00
commit 90e8607586
12 changed files with 401 additions and 314 deletions

View File

@ -73,7 +73,7 @@ static char *prefix[3]={ "error", "fatal error", "warning" };
char *pre; char *pre;
int idx; int idx;
if (number < 120) if (number < 160)
idx = 0; idx = 0;
else if (number < 200) else if (number < 200)
idx = 1; idx = 1;

View File

@ -256,6 +256,8 @@ typedef struct svalue_s {
int lvalue; int lvalue;
} svalue; } svalue;
#define DECLFLAG_ONLY_NEW_TYPES 0x1
/* For parsing declarations. */ /* For parsing declarations. */
typedef struct { typedef struct {
char type[sNAMEMAX + 1]; char type[sNAMEMAX + 1];

View File

@ -118,7 +118,7 @@ static int getstates(const char *funcname);
static void attachstatelist(symbol *sym, int state_id); static void attachstatelist(symbol *sym, int state_id);
static symbol *funcstub(int fnative, const funcstub_setup_t *setup); static symbol *funcstub(int fnative, const funcstub_setup_t *setup);
static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stock); static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stock);
static int declargs(symbol *sym,int chkshadow); static int declargs(symbol *sym, int chkshadow, const int *thistag);
static void doarg(char *name,int ident,int offset,int tags[],int numtags, static void doarg(char *name,int ident,int offset,int tags[],int numtags,
int fpublic,int fconst,int chkshadow,arginfo *arg); int fpublic,int fconst,int chkshadow,arginfo *arg);
static void make_report(symbol *root,FILE *log,char *sourcefile); static void make_report(symbol *root,FILE *log,char *sourcefile);
@ -221,17 +221,17 @@ int pc_compile(int argc, char *argv[])
sp_Globals = NewHashTable(); sp_Globals = NewHashTable();
if (!sp_Globals) if (!sp_Globals)
error(123); error(163);
/* allocate memory for fixed tables */ /* allocate memory for fixed tables */
inpfname=(char*)malloc(_MAX_PATH); inpfname=(char*)malloc(_MAX_PATH);
if (inpfname==NULL) if (inpfname==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
litq=(cell*)malloc(litmax*sizeof(cell)); litq=(cell*)malloc(litmax*sizeof(cell));
if (litq==NULL) if (litq==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
if (!phopt_init()) if (!phopt_init())
error(123); /* insufficient memory */ error(163); /* insufficient memory */
setopt(argc,argv,outfname,errfname,incfname,reportname,codepage); setopt(argc,argv,outfname,errfname,incfname,reportname,codepage);
strcpy(binfname,outfname); strcpy(binfname,outfname);
@ -256,7 +256,7 @@ int pc_compile(int argc, char *argv[])
lcl_tabsize=sc_tabsize; lcl_tabsize=sc_tabsize;
#if !defined NO_CODEPAGE #if !defined NO_CODEPAGE
if (!cp_set(codepage)) /* set codepage */ if (!cp_set(codepage)) /* set codepage */
error(128); /* codepage mapping file not found */ error(168); /* codepage mapping file not found */
#endif #endif
/* optionally create a temporary input file that is a collection of all /* optionally create a temporary input file that is a collection of all
* input files * input files
@ -273,7 +273,7 @@ int pc_compile(int argc, char *argv[])
tname=tempnam(NULL,"pawn"); tname=tempnam(NULL,"pawn");
#elif defined(MACOS) && !defined(__MACH__) #elif defined(MACOS) && !defined(__MACH__)
/* tempnam is not supported for the Macintosh CFM build. */ /* tempnam is not supported for the Macintosh CFM build. */
error(124,get_sourcefile(1)); error(164,get_sourcefile(1));
tname=NULL; tname=NULL;
sname=NULL; sname=NULL;
#else #else
@ -289,7 +289,7 @@ int pc_compile(int argc, char *argv[])
pc_closesrc(ftmp); pc_closesrc(ftmp);
remove(tname); remove(tname);
strcpy(inpfname,sname); /* avoid invalid filename */ strcpy(inpfname,sname); /* avoid invalid filename */
error(120,sname); error(160,sname);
} /* if */ } /* if */
pc_writesrc(ftmp,(unsigned char*)"#file \""); pc_writesrc(ftmp,(unsigned char*)"#file \"");
pc_writesrc(ftmp,(unsigned char*)sname); pc_writesrc(ftmp,(unsigned char*)sname);
@ -308,18 +308,18 @@ int pc_compile(int argc, char *argv[])
} /* if */ } /* if */
inpf_org=(FILE*)pc_opensrc(inpfname); inpf_org=(FILE*)pc_opensrc(inpfname);
if (inpf_org==NULL) if (inpf_org==NULL)
error(120,inpfname); error(160,inpfname);
freading=TRUE; freading=TRUE;
outf=(FILE*)pc_openasm(outfname); /* first write to assembler file (may be temporary) */ outf=(FILE*)pc_openasm(outfname); /* first write to assembler file (may be temporary) */
if (outf==NULL) if (outf==NULL)
error(121,outfname); error(161,outfname);
/* immediately open the binary file, for other programs to check */ /* immediately open the binary file, for other programs to check */
if (sc_asmfile || sc_listing) { if (sc_asmfile || sc_listing) {
binf=NULL; binf=NULL;
} else { } else {
binf=(FILE*)pc_openbin(binfname); binf=(FILE*)pc_openbin(binfname);
if (binf==NULL) if (binf==NULL)
error(121,binfname); error(161,binfname);
} /* if */ } /* if */
setconstants(); /* set predefined constants and tagnames */ setconstants(); /* set predefined constants and tagnames */
for (i=0; i<skipinput; i++) /* skip lines in the input file */ for (i=0; i<skipinput; i++) /* skip lines in the input file */
@ -375,7 +375,7 @@ int pc_compile(int argc, char *argv[])
plungefile(incfname,FALSE,TRUE); /* parse "default.inc" */ plungefile(incfname,FALSE,TRUE); /* parse "default.inc" */
} else { } else {
if (!plungequalifiedfile(incfname)) /* parse "prefix" include file */ if (!plungequalifiedfile(incfname)) /* parse "prefix" include file */
error(120,incfname); /* cannot read from ... (fatal error) */ error(160,incfname); /* cannot read from ... (fatal error) */
} /* if */ } /* if */
} /* if */ } /* if */
preprocess(); /* fetch first line */ preprocess(); /* fetch first line */
@ -510,7 +510,7 @@ cleanup:
pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)pc_stksize*sizeof(cell)); pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)pc_stksize*sizeof(cell));
} /* if */ } /* if */
if (flag_exceed) if (flag_exceed)
error(126,pc_amxlimit+pc_amxram); /* this causes a jump back to label "cleanup" */ error(166,pc_amxlimit+pc_amxram); /* this causes a jump back to label "cleanup" */
} /* if */ } /* if */
#endif #endif
@ -1138,14 +1138,14 @@ static void parserespf(char *filename,char *oname,char *ename,char *pname,
long size; long size;
if ((fp=fopen(filename,"r"))==NULL) if ((fp=fopen(filename,"r"))==NULL)
error(120,filename); /* error reading input file */ error(160,filename); /* error reading input file */
/* load the complete file into memory */ /* load the complete file into memory */
fseek(fp,0L,SEEK_END); fseek(fp,0L,SEEK_END);
size=ftell(fp); size=ftell(fp);
fseek(fp,0L,SEEK_SET); fseek(fp,0L,SEEK_SET);
assert(size<INT_MAX); assert(size<INT_MAX);
if ((string=(char *)malloc((int)size+1))==NULL) if ((string=(char *)malloc((int)size+1))==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
/* fill with zeros; in MS-DOS, fread() may collapse CR/LF pairs to /* fill with zeros; in MS-DOS, fread() may collapse CR/LF pairs to
* a single '\n', so the string size may be smaller than the file * a single '\n', so the string size may be smaller than the file
* size. */ * size. */
@ -1154,7 +1154,7 @@ static void parserespf(char *filename,char *oname,char *ename,char *pname,
fclose(fp); fclose(fp);
/* allocate table for option pointers */ /* allocate table for option pointers */
if ((argv=(char **)malloc(MAX_OPTIONS*sizeof(char*)))==NULL) if ((argv=(char **)malloc(MAX_OPTIONS*sizeof(char*)))==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
/* fill the options table */ /* fill the options table */
ptr=strtok(string," \t\r\n"); ptr=strtok(string," \t\r\n");
for (argc=1; argc<MAX_OPTIONS && ptr!=NULL; argc++) { for (argc=1; argc<MAX_OPTIONS && ptr!=NULL; argc++) {
@ -1163,7 +1163,7 @@ static void parserespf(char *filename,char *oname,char *ename,char *pname,
ptr=strtok(NULL," \t\r\n"); ptr=strtok(NULL," \t\r\n");
} /* for */ } /* for */
if (ptr!=NULL) if (ptr!=NULL)
error(122,"option table"); /* table overflow */ error(162,"option table"); /* table overflow */
/* parse the option table */ /* parse the option table */
parseoptions(argc,argv,oname,ename,pname,rname,codepage); parseoptions(argc,argv,oname,ename,pname,rname,codepage);
/* free allocated memory */ /* free allocated memory */
@ -1273,7 +1273,7 @@ static void setconfig(char *root)
#if !defined NO_CODEPAGE #if !defined NO_CODEPAGE
*ptr='\0'; *ptr='\0';
if (!cp_path(path,"codepage")) if (!cp_path(path,"codepage"))
error(129,path); /* codepage path */ error(169,path); /* codepage path */
#endif #endif
/* also copy the root path (for the XML documentation) */ /* also copy the root path (for the XML documentation) */
#if !defined SC_LIGHT #if !defined SC_LIGHT
@ -2086,7 +2086,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
size=needsub(&idxtag[numdim],&enumroot); /* get size; size==0 for "var[]" */ size=needsub(&idxtag[numdim],&enumroot); /* get size; size==0 for "var[]" */
#if INT_MAX < LONG_MAX #if INT_MAX < LONG_MAX
if (size > INT_MAX) if (size > INT_MAX)
error(125); /* overflow, exceeding capacity */ error(165); /* overflow, exceeding capacity */
#endif #endif
#if 0 /* We don't actually care */ #if 0 /* We don't actually care */
if (ispublic) if (ispublic)
@ -2386,7 +2386,7 @@ static int declloc(int fstatic)
idxtag[numdim] = dim_sym ? dim_sym->tag : 0; idxtag[numdim] = dim_sym ? dim_sym->tag : 0;
#if INT_MAX < LONG_MAX #if INT_MAX < LONG_MAX
if (dim[numdim] > INT_MAX) if (dim[numdim] > INT_MAX)
error(125); /* overflow, exceeding capacity */ error(165); /* overflow, exceeding capacity */
#endif #endif
} else { } else {
error(29); /* invalid expression, assumed 0 */ error(29); /* invalid expression, assumed 0 */
@ -3277,8 +3277,15 @@ int parse_typeexpr(declinfo_t *decl, const token_t *first, int flags)
lextok(&tok); lextok(&tok);
} }
if (tok.id == tLABEL || tok.id == '[') if (tok.id == tLABEL && (flags & DECLFLAG_ONLY_NEW_TYPES)) {
error(120);
return FALSE; return FALSE;
}
if (tok.id == '[') {
error(121);
return FALSE;
}
switch (tok.id) { switch (tok.id) {
case tINT: case tINT:
@ -3306,7 +3313,9 @@ int parse_typeexpr(declinfo_t *decl, const token_t *first, int flags)
else if (decl->tag == 0) else if (decl->tag == 0)
error(98, "_", "int"); error(98, "_", "int");
} }
break;
default: default:
error(122);
return FALSE; return FALSE;
} }
@ -3443,20 +3452,26 @@ methodmap_method_t *parse_method(methodmap_t *map)
if (!is_bind) { if (!is_bind) {
// All we know at this point is that we do NOT have a method bind. Keep // All we know at this point is that we do NOT have a method bind. Keep
// pattern matching for an inline constructor, destructor, or method. // pattern matching for an inline constructor, destructor, or method.
if (!got_symbol) { if (!got_symbol && matchtoken('~')) {
// We never saw an initial symbol, so it should be a destructor. If we // ::= '~' ident
// don't see a '~', the current token (which is not a symbol) will fail is_dtor = TRUE;
// the needsymbol() check, and we'll bail out.
is_dtor = matchtoken('~');
if (!needsymbol(&ident)) if (!needsymbol(&ident))
return NULL; return NULL;
} else if (matchtoken('(')) { } else if (got_symbol && matchtoken('(')) {
// There's no type expression. this is probably a constructor. // ::= ident '('
// Push the '(' token back for declargs().
is_ctor = TRUE; is_ctor = TRUE;
lexpush();
} else { } else {
// The first token of the type expression is either the symbol we
// predictively parsed earlier, or it's been pushed back into the
// lex buffer.
const token_t *first = got_symbol ? &ident.tok : NULL;
// Parse for type expression, priming it with the token we predicted // Parse for type expression, priming it with the token we predicted
// would be an identifier. // would be an identifier.
if (!parse_decl(&decl, &ident.tok, 0)) if (!parse_decl(&decl, first, DECLFLAG_ONLY_NEW_TYPES))
return NULL; return NULL;
// Now, we should get an identifier. // Now, we should get an identifier.
@ -3477,6 +3492,10 @@ methodmap_method_t *parse_method(methodmap_t *map)
if (is_dtor) { if (is_dtor) {
if (strcmp(ident.name, map->name) != 0) if (strcmp(ident.name, map->name) != 0)
error(114, "destructor", spectype, map->name); error(114, "destructor", spectype, map->name);
// Make sure the final name has "~" in it.
strcpy(ident.name, "~");
strcat(ident.name, map->name);
} else if (is_ctor) { } else if (is_ctor) {
if (strcmp(ident.name, map->name) != 0) if (strcmp(ident.name, map->name) != 0)
error(114, "constructor", spectype, map->name); error(114, "constructor", spectype, map->name);
@ -3484,28 +3503,35 @@ methodmap_method_t *parse_method(methodmap_t *map)
symbol *target = NULL; symbol *target = NULL;
if (is_bind) { if (is_bind) {
// Find an existing symbol.
target = findglb(bindsource.name, sGLOBAL); target = findglb(bindsource.name, sGLOBAL);
if (!target) if (!target)
error(17, bindsource.name); error(17, bindsource.name);
else if (target->ident != iFUNCTN) else if (target->ident != iFUNCTN)
error(10); error(10);
// if (decl.usage & uCONST)
// error(112, map->name);
// funcstub_setup_t setup;
// if (is_dtor)
// setup.return_tag = -1;
// else if (is_ctor)
// setup.return_tag = map->tag;
// else
// setup.return_tag = pc_addtag(decl.tag);
// setup.this_tag = map->tag;
// if (is_native)
// target = funcstub(TRUE, &setup);
} else { } else {
error(10); funcstub_setup_t setup;
if (is_dtor)
setup.return_tag = -1;
else if (is_ctor)
setup.return_tag = map->tag;
else
setup.return_tag = decl.tag;
if (is_ctor)
setup.this_tag = 0;
else
setup.this_tag = map->tag;
// Build a new symbol. Construct a temporary name including the class.
char fullname[METHOD_NAMEMAX + 1];
strcpy(fullname, map->name);
strcat(fullname, ".");
strcat(fullname, ident.name);
setup.name = fullname;
if (is_native)
target = funcstub(TRUE, &setup);
} }
if (!target) if (!target)
@ -3530,10 +3556,6 @@ methodmap_method_t *parse_method(methodmap_t *map)
error(119); error(119);
return NULL; return NULL;
} }
// Make sure the final name has "~" in it.
strcpy(ident.name, "~");
strcat(ident.name, map->name);
} }
// Verify constructor targets. // Verify constructor targets.
@ -3553,8 +3575,6 @@ methodmap_method_t *parse_method(methodmap_t *map)
methodmap_method_t *method = (methodmap_method_t *)calloc(1, sizeof(methodmap_method_t)); methodmap_method_t *method = (methodmap_method_t *)calloc(1, sizeof(methodmap_method_t));
strcpy(method->name, ident.name); strcpy(method->name, ident.name);
method->target = target; method->target = target;
if (is_dtor)
map->dtor = method;
// If the symbol is a constructor, we bypass the initial argument checks. // If the symbol is a constructor, we bypass the initial argument checks.
if (is_ctor) { if (is_ctor) {
@ -3587,6 +3607,9 @@ methodmap_method_t *parse_method(methodmap_t *map)
if (!ok) if (!ok)
error(108, spectype, map->name); error(108, spectype, map->name);
if (is_dtor)
map->dtor = method;
return method; return method;
} }
@ -3668,7 +3691,7 @@ static void domethodmap(LayoutSpec spec)
methods = (methodmap_method_t **)realloc(map->methods, sizeof(methodmap_method_t *) * (map->nummethods + 1)); methods = (methodmap_method_t **)realloc(map->methods, sizeof(methodmap_method_t *) * (map->nummethods + 1));
if (!methods) { if (!methods) {
error(123); error(163);
return; return;
} }
map->methods = methods; map->methods = methods;
@ -4043,7 +4066,7 @@ static void decl_enum(int vclass)
enumsym->usage |= uENUMROOT; enumsym->usage |= uENUMROOT;
/* start a new list for the element names */ /* start a new list for the element names */
if ((enumroot=(constvalue*)malloc(sizeof(constvalue)))==NULL) if ((enumroot=(constvalue*)malloc(sizeof(constvalue)))==NULL)
error(123); /* insufficient memory (fatal error) */ error(163); /* insufficient memory (fatal error) */
memset(enumroot,0,sizeof(constvalue)); memset(enumroot,0,sizeof(constvalue));
} else { } else {
enumsym=NULL; enumsym=NULL;
@ -4193,7 +4216,7 @@ static void attachstatelist(symbol *sym, int state_id)
constvalue *stateptr; constvalue *stateptr;
if (sym->states==NULL) { if (sym->states==NULL) {
if ((sym->states=(constvalue*)malloc(sizeof(constvalue)))==NULL) if ((sym->states=(constvalue*)malloc(sizeof(constvalue)))==NULL)
error(123); /* insufficient memory (fatal error) */ error(163); /* insufficient memory (fatal error) */
memset(sym->states,0,sizeof(constvalue)); memset(sym->states,0,sizeof(constvalue));
} /* if */ } /* if */
/* see whether the id already exists (add new state only if it does not /* see whether the id already exists (add new state only if it does not
@ -4549,7 +4572,7 @@ static symbol *funcstub(int fnative, const funcstub_setup_t *setup)
int tok,tag,fpublic; int tok,tag,fpublic;
char *str; char *str;
cell val,size; cell val,size;
char symbolname[sNAMEMAX+1]; char symbolname[METHOD_NAMEMAX+1];
int idxtag[sDIMEN_MAX]; int idxtag[sDIMEN_MAX];
int dim[sDIMEN_MAX]; int dim[sDIMEN_MAX];
int numdim; int numdim;
@ -4585,7 +4608,7 @@ static symbol *funcstub(int fnative, const funcstub_setup_t *setup)
error(9); /* invalid array size */ error(9); /* invalid array size */
#if INT_MAX < LONG_MAX #if INT_MAX < LONG_MAX
if (size > INT_MAX) if (size > INT_MAX)
error(125); /* overflow, exceeding capacity */ error(165); /* overflow, exceeding capacity */
#endif #endif
dim[numdim++]=(int)size; dim[numdim++]=(int)size;
} /* while */ } /* while */
@ -4594,6 +4617,7 @@ static symbol *funcstub(int fnative, const funcstub_setup_t *setup)
if (tag == pc_tag_string && numdim && dim[numdim-1]) if (tag == pc_tag_string && numdim && dim[numdim-1])
dim[numdim-1] = (size + sizeof(cell)-1) / sizeof(cell); dim[numdim-1] = (size + sizeof(cell)-1) / sizeof(cell);
if (!setup || !setup->name) {
tok=lex(&val,&str); tok=lex(&val,&str);
fpublic=(tok==tPUBLIC) || (tok==tSYMBOL && str[0]==PUBLIC_CHAR); fpublic=(tok==tPUBLIC) || (tok==tSYMBOL && str[0]==PUBLIC_CHAR);
if (fnative) { if (fnative) {
@ -4616,6 +4640,9 @@ static symbol *funcstub(int fnative, const funcstub_setup_t *setup)
} /* if */ } /* if */
strcpy(symbolname,str); strcpy(symbolname,str);
} /* if */ } /* if */
} else {
strcpy(symbolname, setup->name);
}
needtoken('('); /* only functions may be native/forward */ needtoken('('); /* only functions may be native/forward */
sym=fetchfunc(symbolname,tag);/* get a pointer to the function entry */ sym=fetchfunc(symbolname,tag);/* get a pointer to the function entry */
@ -4629,7 +4656,11 @@ static symbol *funcstub(int fnative, const funcstub_setup_t *setup)
} /* if */ } /* if */
sym->usage|=uFORWARD; sym->usage|=uFORWARD;
declargs(sym,FALSE); const int *thistag = NULL;
if (setup && setup->this_tag)
thistag = &setup->this_tag;
declargs(sym, FALSE, thistag);
/* "declargs()" found the ")" */ /* "declargs()" found the ")" */
sc_attachdocumentation(sym); /* attach any documenation to the function */ sc_attachdocumentation(sym); /* attach any documenation to the function */
if (!operatoradjust(opertok,sym,symbolname,tag)) if (!operatoradjust(opertok,sym,symbolname,tag))
@ -4782,7 +4813,7 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stoc
error(235,symbolname); error(235,symbolname);
#endif #endif
/* declare all arguments */ /* declare all arguments */
argcnt=declargs(sym,TRUE); argcnt=declargs(sym, TRUE, NULL);
opererror=!operatoradjust(opertok,sym,symbolname,tag); opererror=!operatoradjust(opertok,sym,symbolname,tag);
if (strcmp(symbolname,uMAINFUNC)==0 || strcmp(symbolname,uENTRYFUNC)==0) { if (strcmp(symbolname,uMAINFUNC)==0 || strcmp(symbolname,uENTRYFUNC)==0) {
if (argcnt>0) if (argcnt>0)
@ -4959,7 +4990,7 @@ static int argcompare(arginfo *a1,arginfo *a2)
* This routine adds an entry in the local symbol table for each argument * This routine adds an entry in the local symbol table for each argument
* found in the argument list. It returns the number of arguments. * found in the argument list. It returns the number of arguments.
*/ */
static int declargs(symbol *sym,int chkshadow) static int declargs(symbol *sym, int chkshadow, const int *thistag)
{ {
#define MAXTAGS 16 #define MAXTAGS 16
char *ptr; char *ptr;
@ -4982,6 +5013,22 @@ static int declargs(symbol *sym,int chkshadow)
numtags=0; numtags=0;
fconst=FALSE; fconst=FALSE;
fpublic = (sym->usage & (uPUBLIC|uSTOCK))!=0; fpublic = (sym->usage & (uPUBLIC|uSTOCK))!=0;
if (thistag) {
// Allocate space for a new argument, then terminate.
sym->dim.arglist = (arginfo *)realloc(sym->dim.arglist, (argcnt + 2) * sizeof(arginfo));
memset(&sym->dim.arglist[argcnt + 1], 0, sizeof(arginfo));
arginfo *argptr = &sym->dim.arglist[argcnt];
memset(argptr, 0, sizeof(*argptr));
strcpy(argptr->name, "this");
argptr->ident = iVARIABLE;
argptr->tags = malloc(sizeof(int));
argptr->tags[0] = *thistag;
argptr->numtags = 1;
argcnt++;
}
/* the '(' parantheses has already been parsed */ /* the '(' parantheses has already been parsed */
if (!matchtoken(')')){ if (!matchtoken(')')){
do { /* there are arguments; process them */ do { /* there are arguments; process them */
@ -5046,7 +5093,7 @@ static int declargs(symbol *sym,int chkshadow)
/* redimension the argument list, add the entry */ /* redimension the argument list, add the entry */
sym->dim.arglist=(arginfo*)realloc(sym->dim.arglist,(argcnt+2)*sizeof(arginfo)); sym->dim.arglist=(arginfo*)realloc(sym->dim.arglist,(argcnt+2)*sizeof(arginfo));
if (sym->dim.arglist==0) if (sym->dim.arglist==0)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
memset(&sym->dim.arglist[argcnt+1],0,sizeof(arginfo)); /* keep the list terminated */ memset(&sym->dim.arglist[argcnt+1],0,sizeof(arginfo)); /* keep the list terminated */
sym->dim.arglist[argcnt]=arg; sym->dim.arglist[argcnt]=arg;
} else { } else {
@ -5075,7 +5122,7 @@ static int declargs(symbol *sym,int chkshadow)
/* redimension the argument list, add the entry iVARARGS */ /* redimension the argument list, add the entry iVARARGS */
sym->dim.arglist=(arginfo*)realloc(sym->dim.arglist,(argcnt+2)*sizeof(arginfo)); sym->dim.arglist=(arginfo*)realloc(sym->dim.arglist,(argcnt+2)*sizeof(arginfo));
if (sym->dim.arglist==0) if (sym->dim.arglist==0)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
memset(&sym->dim.arglist[argcnt+1],0,sizeof(arginfo)); /* keep the list terminated */ memset(&sym->dim.arglist[argcnt+1],0,sizeof(arginfo)); /* keep the list terminated */
sym->dim.arglist[argcnt].ident=iVARARGS; sym->dim.arglist[argcnt].ident=iVARARGS;
sym->dim.arglist[argcnt].hasdefault=FALSE; sym->dim.arglist[argcnt].hasdefault=FALSE;
@ -5084,7 +5131,7 @@ static int declargs(symbol *sym,int chkshadow)
sym->dim.arglist[argcnt].numtags=numtags; sym->dim.arglist[argcnt].numtags=numtags;
sym->dim.arglist[argcnt].tags=(int*)malloc(numtags*sizeof tags[0]); sym->dim.arglist[argcnt].tags=(int*)malloc(numtags*sizeof tags[0]);
if (sym->dim.arglist[argcnt].tags==NULL) if (sym->dim.arglist[argcnt].tags==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
memcpy(sym->dim.arglist[argcnt].tags,tags,numtags*sizeof tags[0]); memcpy(sym->dim.arglist[argcnt].tags,tags,numtags*sizeof tags[0]);
} else { } else {
if (argcnt>oldargcnt || sym->dim.arglist[argcnt].ident!=iVARARGS) if (argcnt>oldargcnt || sym->dim.arglist[argcnt].ident!=iVARARGS)
@ -5179,7 +5226,7 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags,
size=needsub(&arg->idxtag[arg->numdim],&enumroot);/* may be zero here, it is a pointer anyway */ size=needsub(&arg->idxtag[arg->numdim],&enumroot);/* may be zero here, it is a pointer anyway */
#if INT_MAX < LONG_MAX #if INT_MAX < LONG_MAX
if (size > INT_MAX) if (size > INT_MAX)
error(125); /* overflow, exceeding capacity */ error(165); /* overflow, exceeding capacity */
#endif #endif
arg->dim[arg->numdim]=(int)size; arg->dim[arg->numdim]=(int)size;
arg->numdim+=1; arg->numdim+=1;
@ -5261,7 +5308,7 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags,
cell val; cell val;
tokeninfo(&val,&name); tokeninfo(&val,&name);
if ((arg->defvalue.size.symname=duplicatestring(name)) == NULL) if ((arg->defvalue.size.symname=duplicatestring(name)) == NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
arg->defvalue.size.level=0; arg->defvalue.size.level=0;
if (size_tag_token==uSIZEOF || size_tag_token==uCOUNTOF) { if (size_tag_token==uSIZEOF || size_tag_token==uCOUNTOF) {
while (matchtoken('[')) { while (matchtoken('[')) {
@ -5287,7 +5334,7 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags,
arg->numtags=numtags; arg->numtags=numtags;
arg->tags=(int*)malloc(numtags*sizeof tags[0]); arg->tags=(int*)malloc(numtags*sizeof tags[0]);
if (arg->tags==NULL) if (arg->tags==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
memcpy(arg->tags,tags,numtags*sizeof tags[0]); memcpy(arg->tags,tags,numtags*sizeof tags[0]);
argsym=findloc(name); argsym=findloc(name);
if (argsym!=NULL) { if (argsym!=NULL) {
@ -6035,7 +6082,7 @@ static constvalue *insert_constval(constvalue *prev,constvalue *next,const char
constvalue *cur; constvalue *cur;
if ((cur=(constvalue*)malloc(sizeof(constvalue)))==NULL) if ((cur=(constvalue*)malloc(sizeof(constvalue)))==NULL)
error(123); /* insufficient memory (fatal error) */ error(163); /* insufficient memory (fatal error) */
memset(cur,0,sizeof(constvalue)); memset(cur,0,sizeof(constvalue));
if (name!=NULL) { if (name!=NULL) {
assert(strlen(name)<=sNAMEMAX); assert(strlen(name)<=sNAMEMAX);
@ -7283,7 +7330,7 @@ static void addwhile(int *ptr)
ptr[wqLOOP]=getlabel(); ptr[wqLOOP]=getlabel();
ptr[wqEXIT]=getlabel(); ptr[wqEXIT]=getlabel();
if (wqptr>=(wq+wqTABSZ-wqSIZE)) if (wqptr>=(wq+wqTABSZ-wqSIZE))
error(122,"loop table"); /* loop table overflow (too many active loops)*/ error(162,"loop table"); /* loop table overflow (too many active loops)*/
k=0; k=0;
while (k<wqSIZE){ /* copy "ptr" to while queue table */ while (k<wqSIZE){ /* copy "ptr" to while queue table */
*wqptr=*ptr; *wqptr=*ptr;

View File

@ -96,7 +96,7 @@ SC_FUNC void pushstk(stkitem val)
assert(newsize>stktop); assert(newsize>stktop);
newstack=(stkitem*)malloc(newsize*sizeof(stkitem)); newstack=(stkitem*)malloc(newsize*sizeof(stkitem));
if (newstack==NULL) if (newstack==NULL)
error(122,"parser stack"); /* stack overflow (recursive include?) */ error(162,"parser stack"); /* stack overflow (recursive include?) */
/* swap the stacks */ /* swap the stacks */
memcpy(newstack,stack,stkidx*sizeof(stkitem)); memcpy(newstack,stack,stkidx*sizeof(stkitem));
if (stack!=NULL) if (stack!=NULL)
@ -171,7 +171,7 @@ static char *extensions[] = { ".inc", ".p", ".pawn" };
PUSHSTK_I(fline); PUSHSTK_I(fline);
inpfname=duplicatestring(name);/* set name of include file */ inpfname=duplicatestring(name);/* set name of include file */
if (inpfname==NULL) if (inpfname==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
inpf=fp; /* set input file pointer to include file */ inpf=fp; /* set input file pointer to include file */
fnumber++; fnumber++;
fline=0; /* set current line number to 0 */ fline=0; /* set current line number to 0 */
@ -275,7 +275,7 @@ static void doinclude(int silent)
result=plungefile(name,(c!='>'),TRUE); result=plungefile(name,(c!='>'),TRUE);
if (!result && !silent) if (!result && !silent)
error(120,name); /* cannot read from ... (fatal error) */ error(160,name); /* cannot read from ... (fatal error) */
} }
/* readline /* readline
@ -889,7 +889,7 @@ static int command(void)
ret=CMD_IF; ret=CMD_IF;
assert(iflevel>=0); assert(iflevel>=0);
if (iflevel>=sCOMP_STACK) if (iflevel>=sCOMP_STACK)
error(122,"Conditional compilation stack"); /* table overflow */ error(162,"Conditional compilation stack"); /* table overflow */
iflevel++; iflevel++;
if (SKIPPING) if (SKIPPING)
break; /* break out of switch */ break; /* break out of switch */
@ -978,7 +978,7 @@ static int command(void)
free(inpfname); free(inpfname);
inpfname=duplicatestring(pathname); inpfname=duplicatestring(pathname);
if (inpfname==NULL) if (inpfname==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
fline=0; fline=0;
} /* if */ } /* if */
} /* if */ } /* if */
@ -998,7 +998,7 @@ static int command(void)
/* nothing */; /* save start of expression */ /* nothing */; /* save start of expression */
preproc_expr(&val,NULL); /* get constant expression (or 0 on error) */ preproc_expr(&val,NULL); /* get constant expression (or 0 on error) */
if (!val) if (!val)
error(130,str); /* assertion failed */ error(170,str); /* assertion failed */
check_empty(lptr); check_empty(lptr);
} /* if */ } /* if */
break; break;
@ -1022,7 +1022,7 @@ static int command(void)
name[i]='\0'; name[i]='\0';
} /* if */ } /* if */
if (!cp_set(name)) if (!cp_set(name))
error(128); /* codepage mapping file not found */ error(168); /* codepage mapping file not found */
} else if (strcmp(str,"compress")==0) { } else if (strcmp(str,"compress")==0) {
cell val; cell val;
preproc_expr(&val,NULL); preproc_expr(&val,NULL);
@ -1288,7 +1288,7 @@ static int command(void)
/* store matched pattern */ /* store matched pattern */
pattern=(char*)malloc(count+1); pattern=(char*)malloc(count+1);
if (pattern==NULL) if (pattern==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
lptr=start; lptr=start;
count=0; count=0;
while (lptr!=end) { while (lptr!=end) {
@ -1322,7 +1322,7 @@ static int command(void)
/* store matched substitution */ /* store matched substitution */
substitution=(char*)malloc(count+1); /* +1 for '\0' */ substitution=(char*)malloc(count+1); /* +1 for '\0' */
if (substitution==NULL) if (substitution==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
lptr=start; lptr=start;
count=0; count=0;
while (lptr!=end) { while (lptr!=end) {
@ -1373,7 +1373,7 @@ static int command(void)
while (*lptr<=' ' && *lptr!='\0') while (*lptr<=' ' && *lptr!='\0')
lptr++; lptr++;
if (!SKIPPING) if (!SKIPPING)
error(131,lptr); /* user error */ error(171,lptr); /* user error */
break; break;
default: default:
error(31); /* unknown compiler directive */ error(31); /* unknown compiler directive */
@ -1538,7 +1538,7 @@ static int substpattern(unsigned char *line,size_t buffersize,char *pattern,char
len=(int)(e-s); len=(int)(e-s);
args[arg]=(unsigned char*)malloc(len+1); args[arg]=(unsigned char*)malloc(len+1);
if (args[arg]==NULL) if (args[arg]==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
strlcpy((char*)args[arg],(char*)s,len+1); strlcpy((char*)args[arg],(char*)s,len+1);
/* character behind the pattern was matched too */ /* character behind the pattern was matched too */
if (*e==*p) { if (*e==*p) {
@ -2326,10 +2326,10 @@ SC_FUNC int needtoken(int token)
strcpy(s1,sc_tokens[token-tFIRST]); /* multi-character symbol */ strcpy(s1,sc_tokens[token-tFIRST]); /* multi-character symbol */
if (!freading) if (!freading)
strcpy(s2,"-end of file-"); strcpy(s2,"-end of file-");
else if (current_token()->id < 256) else if (last_token()->id < 256)
sprintf(s2,"%c",(char)current_token()->id); sprintf(s2,"%c",(char)last_token()->id);
else else
strcpy(s2, sc_tokens[current_token()->id - tFIRST]); strcpy(s2, sc_tokens[last_token()->id - tFIRST]);
error(1,s1,s2); /* expected ..., but found ... */ error(1,s1,s2); /* expected ..., but found ... */
return FALSE; return FALSE;
} /* if */ } /* if */
@ -2376,7 +2376,7 @@ static void chk_grow_litq(void)
litmax+=sDEF_LITMAX; litmax+=sDEF_LITMAX;
p=(cell *)realloc(litq,litmax*sizeof(cell)); p=(cell *)realloc(litq,litmax*sizeof(cell));
if (p==NULL) if (p==NULL)
error(122,"literal table"); /* literal table overflow (fatal error) */ error(162,"literal table"); /* literal table overflow (fatal error) */
litq=p; litq=p;
} /* if */ } /* if */
} }
@ -2569,7 +2569,7 @@ static symbol *add_symbol(symbol *root,symbol *entry,int sort)
root=root->next; root=root->next;
if ((newsym=(symbol *)malloc(sizeof(symbol)))==NULL) { if ((newsym=(symbol *)malloc(sizeof(symbol)))==NULL) {
error(123); error(163);
return NULL; return NULL;
} /* if */ } /* if */
memcpy(newsym,entry,sizeof(symbol)); memcpy(newsym,entry,sizeof(symbol));
@ -2968,7 +2968,7 @@ SC_FUNC symbol *addsym(const char *name,cell addr,int ident,int vclass,int tag,i
/* create an empty referrer list */ /* create an empty referrer list */
if ((refer=(symbol**)malloc(sizeof(symbol*)))==NULL) { if ((refer=(symbol**)malloc(sizeof(symbol*)))==NULL) {
error(123); /* insufficient memory */ error(163); /* insufficient memory */
return NULL; return NULL;
} /* if */ } /* if */
*refer=NULL; *refer=NULL;

View File

@ -2040,7 +2040,7 @@ restart:
*/ */
sym=fetchfunc(lastsymbol,0); sym=fetchfunc(lastsymbol,0);
if (sym==NULL) if (sym==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
markusage(sym,uREAD); markusage(sym,uREAD);
} else { } else {
return error(12); /* invalid function call */ return error(12); /* invalid function call */
@ -2192,7 +2192,7 @@ static int primary(value *lval)
assert(sc_status==statFIRST); assert(sc_status==statFIRST);
sym=fetchfunc(st,0); sym=fetchfunc(st,0);
if (sym==NULL) if (sym==NULL)
error(123); /* insufficient memory */ error(163); /* insufficient memory */
} /* if */ } /* if */
assert(sym!=NULL); assert(sym!=NULL);
assert(sym->ident==iFUNCTN || sym->ident==iREFFUNC); assert(sym->ident==iFUNCTN || sym->ident==iREFFUNC);

View File

@ -86,7 +86,7 @@ static short lastfile;
* the error reporting is enabled only in the second pass (and only when * the error reporting is enabled only in the second pass (and only when
* actually producing output). Fatal errors may never be ignored. * actually producing output). Fatal errors may never be ignored.
*/ */
if ((errflag || sc_status!=statWRITE) && (number<120 || number>=200)) if ((errflag || sc_status!=statWRITE) && (number<160 || number>=200))
return 0; return 0;
/* also check for disabled warnings */ /* also check for disabled warnings */
@ -97,13 +97,13 @@ static short lastfile;
return 0; return 0;
} /* if */ } /* if */
if (number<120){ if (number<160){
msg=errmsg[number-1]; msg=errmsg[number-1];
pre=prefix[0]; pre=prefix[0];
errflag=TRUE; /* set errflag (skip rest of erroneous expression) */ errflag=TRUE; /* set errflag (skip rest of erroneous expression) */
errnum++; errnum++;
} else if (number<200){ } else if (number<200){
msg=fatalmsg[number-120]; msg=fatalmsg[number-160];
pre=prefix[1]; pre=prefix[1];
errnum++; /* a fatal error also counts as an error */ errnum++; /* a fatal error also counts as an error */
} else { } else {
@ -141,7 +141,7 @@ static short lastfile;
} /* if */ } /* if */
va_end(argptr); va_end(argptr);
if ((number>=120 && number<200) || errnum>25){ if ((number>=160 && number<200) || errnum>25){
if (strlen(errfname)==0) { if (strlen(errfname)==0) {
va_start(argptr,number); va_start(argptr,number);
pc_error(0,"\nCompilation aborted.",NULL,0,0,argptr); pc_error(0,"\nCompilation aborted.",NULL,0,0,argptr);
@ -162,7 +162,7 @@ static short lastfile;
if (number<200) if (number<200)
errorcount++; errorcount++;
if (errorcount>=3) if (errorcount>=3)
error(127); /* too many error/warning messages on one line */ error(167); /* too many error/warning messages on one line */
return 0; return 0;
} }

View File

@ -32,13 +32,13 @@ SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned ch
/*-*SCPACK start of pair table, do not change or remove this line */ /*-*SCPACK start of pair table, do not change or remove this line */
unsigned char errstr_table [][2] = { unsigned char errstr_table [][2] = {
{101,32}, {116,32}, {111,110}, {115,32}, {105,110}, {97,114}, {100,32}, {116,105}, {37,115}, {101,114}, {101,110}, {97,108}, {110,111}, {135,130}, {34,136}, {142,34}, {101,32}, {116,32}, {111,110}, {115,32}, {105,110}, {97,114}, {100,32}, {116,105}, {37,115}, {101,114}, {101,110}, {97,108}, {110,111}, {135,130}, {34,136}, {142,34},
{117,110}, {111,114}, {114,101}, {97,110}, {121,32}, {115,116}, {100,101}, {115,105}, {97,116}, {140,129}, {32,143}, {109,98}, {109,138}, {41,10}, {101,134}, {141,32}, {114,101}, {117,110}, {111,114}, {97,110}, {121,32}, {115,116}, {100,101}, {115,105}, {97,116}, {140,129}, {32,143}, {109,98}, {109,138}, {41,10}, {101,134}, {116,104},
{98,108}, {144,99}, {116,104}, {102,161}, {114,97}, {111,108}, {117,115}, {145,32}, {118,139}, {97,32}, {115,121}, {170,155}, {171,165}, {103,32}, {137,32}, {103,117}, {141,32}, {98,108}, {117,115}, {145,99}, {102,163}, {114,97}, {111,108}, {146,32}, {115,121}, {118,139}, {97,32}, {168,155}, {171,166}, {103,32}, {101,120}, {137,32},
{101,120}, {175,156}, {133,164}, {133,177}, {102,132}, {105,134}, {115,151}, {97,160}, {99,104}, {163,159}, {168,181}, {111,102}, {105,131}, {115,10}, {132,186}, {101,100}, {103,117}, {176,156}, {133,165}, {133,177}, {105,131}, {102,132}, {105,134}, {115,151}, {97,161}, {99,104}, {164,160}, {169,182}, {101,100}, {111,102}, {162,129}, {115,10},
{101,131}, {166,129}, {172,154}, {109,193}, {104,97}, {99,130}, {118,133}, {99,147}, {187,32}, {105,183}, {198,201}, {109,97}, {116,111}, {99,116}, {98,128}, {112,146}, {132,187}, {109,190}, {104,97}, {101,131}, {172,154}, {109,97}, {99,130}, {118,133}, {189,32}, {105,184}, {199,201}, {116,97}, {109,101}, {116,111}, {98,128}, {112,144},
{178,148}, {199,153}, {150,180}, {116,97}, {109,101}, {179,129}, {44,32}, {130,32}, {133,97}, {149,152}, {102,105}, {118,128}, {154,10}, {101,10}, {109,152}, {194,157}, {99,147}, {178,148}, {44,32}, {150,181}, {133,97}, {179,129}, {208,153}, {130,32}, {99,116}, {118,128}, {101,10}, {149,152}, {102,105}, {117,108}, {97,115}, {154,10},
{110,32}, {40,223}, {100,105}, {117,108}, {99,111}, {97,115}, {202,128}, {197,149}, {34,32}, {139,32}, {119,105}, {151,122}, {136,10}, {98,101}, {108,111}, {111,112}, {109,152}, {196,157}, {110,32}, {40,225}, {100,105}, {99,111}, {202,128}, {198,149}, {34,32}, {139,32}, {119,105}, {99,108}, {151,122}, {108,128}, {136,10}, {147,32},
{108,128}, {163,141}, {102,145}, {132,32}, {140,32}, {147,32}, {211,173}, {132,173}, {222,184}, {195,206}, {196,219}, {58,220}, {100,111}, {149,114}, {109,112} {132,173}, {194,217}, {98,101}, {111,112}, {116,121}, {37,131}, {164,141}, {102,146}, {132,32}, {140,32}, {203,173}, {224,185}, {193,206}, {58,223}, {100,111}
}; };
/*-*SCPACK end of pair table, do not change or remove this line */ /*-*SCPACK end of pair table, do not change or remove this line */
@ -157,168 +157,173 @@ static char *errmsg[] = {
/*111*/ "expected identifier - did you forget a type?\n", /*111*/ "expected identifier - did you forget a type?\n",
/*112*/ "constructor function must return tag %s\n", /*112*/ "constructor function must return tag %s\n",
/*113*/ "cannot define constructor for \"%s\"; already exists as a %s\n", /*113*/ "cannot define constructor for \"%s\"; already exists as a %s\n",
/*114*/ "%s must have the same name as %s \"%s\"\n", /*114*/ "missing type, or %s must have the same name as %s \"%s\"\n",
/*115*/ "cannot use delete, %s %s has no destructor\n", /*115*/ "cannot use delete, %s %s has no destructor\n",
/*116*/ "no methodmap or class was found for %s\n", /*116*/ "no methodmap or class was found for %s\n",
/*117*/ "no destructor was found for %s %s\n", /*117*/ "no destructor was found for %s %s\n",
/*118*/ "destructors must be native functions\n", /*118*/ "destructors must be native functions\n",
/*119*/ "destructors cannot have extra arguments\n", /*119*/ "destructors cannot have extra arguments\n",
/*120*/ "methodmap and class signatures must use new-style declarations\n",
/*121*/ "this syntax is not yet supported\n",
/*122*/ "expected type expression\n",
#else #else
"\260pe\315\236\314k\212:\232\326bu\201fo\220\206\217\012", "\256pe\330\236\315k\212:\232\322bu\201fo\221\206\217\012",
"\202l\224\251s\204g\360\331e\234\201(\247\260\317\266\202) \307 f\245\356w ea\270 \042c\345e\042\012", "\202l\224\252s\204g\355\333e\234\201(\247\256\317\267\202) \320 f\246low ea\271 \042c\336e\042\012",
"\226cl\330\237\310\251\356c\351\346\303appe\205 \363\251\344\376o\220\206\240ock\012", "\226\353\324\240\310\252loc\351\346\301appe\205 \370\252\345mpo\221\206\241ock\012",
"\361\232 \274\231i\376le\234t\277\012", "\366\232 \264\231imple\234t\274\012",
"\271\313\224\231\372\263t\275", "\272\305\224\231\361\263t\277",
"\371a\266gn\236\314 \365\262y\012", "\374a\267gn\236\315 \357\262y\012",
"\357\211\230\247\321\316\222\322\277\012", "\363\211\230\247\326\316\220\323\274\012",
"\371\251\347\223\201\260\317\266\202; \345sum\236z\211o\012", "\374\252\347\223\201\256\317\267\202; \336sum\236z\211o\012",
"\276\320\353\200(nega\207ve\326z\211o \247ou\201\310bo\220ds\235", "\300\321\354\200(nega\207ve\322z\211o \247ou\201\310bo\221ds\235",
"\276\271\247\226cl\330\215\012", "\300\272\247\226\353\324\215\012",
"\276out\227d\200\361\275", "\300out\227d\200\366\277",
"\276\271c\213l\326\231\251\272add\222s\275", "\300\272c\213l\322\231\252\273add\220s\277",
"\364\212tr\224po\204\201(\364pu\240ic \361s\235", "\371\212tr\224po\204\201(\371pu\241ic \366s\235",
"\276\331e\234t; \231\363s\352t\270\012", "\300\333e\234t; \231\370s\352t\271\012",
"\042\226fa\343t\350c\345\200\371\242\200l\345\201c\345\200\363s\352t\270 \331e\234t\012", "\042\226fa\335t\350c\336\200\374\237\200l\336\201c\336\200\370s\352t\271 \333e\234t\012",
"m\343\207p\360\226fa\343t\203\363\042s\352t\270\042\012", "m\335\207p\355\226fa\335t\203\370\042s\352t\271\042\012",
"\220\322\236\302\012", "\221\323\236\304\012",
"\204i\207\213iza\237d\230\251\260ce\277\203\226cl\205\236\353\335", "\204i\207\213iza\240d\230\252\256ce\274\203\226\353\205\236\354\332",
"\231\251la\355l\373", "\231\252la\362l\375",
"\276\254 nam\200\217\012", "\300\254 nam\200\217\012",
"\254 \213\222ad\224\322\277\373", "\254 \213\220ad\224\323\274\375",
"\371l\250u\200(n\202-\347\223t\235", "\374l\251u\200(n\202-\347\223t\235",
"\320a\266gn\234\201\371\227\376\360a\266gn\234t\012", "\321a\267gn\234\201\374\227mp\355a\267gn\234t\012",
"\042b\222ak\350\247\042\305t\204ue\350\274ou\201\310\305t\260t\012", "\042b\220ak\350\247\042\306t\204ue\350\264ou\201\310\306t\256t\012",
"\271head\367\342ff\211\203from pro\314typ\335", "\272head\360\344ff\211\203from pro\315\364p\332",
"\364\370\367\042#if...\042\012", "\371\373\360\042#if...\042\012",
"\276\270\330\315\256\347\223t\012", "\300\271\324\330\257\347\223t\012",
"\276subscrip\201(\231\365\320\247\314o m\223\224subscripts)\373", "\300subscrip\201(\231\357\321\247\315o m\223\224subscripts)\375",
"\276\260\317\266\202\326\345sum\236z\211o\012", "\300\256\317\267\202\322\336sum\236z\211o\012",
"\344\376o\220\206\331e\234\201\231c\356s\236a\201\242\200\212\206\310\332\360(\225\205t\236a\201l\204\200%d\235", "\345mpo\221\206\333e\234\201\231\353os\236a\201\237\200\212\206\310\334\355(\225\205t\236a\201l\204\200%d\235",
"\220k\214w\340\342\222c\207v\335", "\221k\214w\342\344\220c\207v\332",
"\320\204\226x ou\201\310bo\220d\203(\346\217\235", "\321\204\226x ou\201\310bo\221d\203(\346\217\235",
"\320\371\204\226x\236(\346\217\235", "\321\374\204\226x\236(\346\217\235",
"\325\374\300\231\372\251\226fa\343\201\250u\200(\325%d\235", "\325\376\303\231\361\252\226fa\335\201\251u\200(\325%d\235",
"\325typ\200mis\370 (\325%d\235", "\325\364p\200mis\373 (\325%d\235",
"e\376t\224\331e\234t\012", "empt\224\333e\234t\012",
"\276\375\367(po\266\240\224n\202-t\211m\204\230\236\375\204g\235", "\300\225r\360(po\267\241\224n\202-t\211m\204\230\236\225r\204g\235",
"\260t\244 \270\330\315\211\203\327l\204\335", "\256t\245 \271\324\330\211\203\327l\204\332",
"\347\223\201\254 \304\203\364\353\335", "\347\223\201\254 \302\203\371\354\332",
"duplic\230\200\042c\345e\350la\355l (\250u\200%d\235", "duplic\230\200\042c\336e\350la\362l (\251u\200%d\235",
"\276ellip\227s\326\320\353\200\274\231k\214wn\012", "\300ellip\227s\322\321\354\200\264\231k\214wn\012",
"\276\344\233\204a\237\310cl\345\203speci\332\211\275", "\300\345\233\204a\240\310\353\336\203speci\334\211\277",
"\270\330\315\256\347\223\201\260ce\277\203r\223g\200f\247pack\236\375\204g\012", "\271\324\330\257\347\223\201\256ce\274\203r\223g\200f\247pack\236\225r\204g\012",
"po\227\215\351p\330\324t\211\203\303\317c\277\200\213l nam\236p\330\324t\211\275", "po\227\215\351p\324\314t\211\203\301\317c\274\200\213l nam\236p\324\314t\211\277",
"\314o m\223\224\271\263t\275", "\315o m\223\224\272\263t\277",
"\220k\214w\340\320\353\200(\346\217\235", "\221k\214w\342\321\354\200(\346\217\235",
"\320\353\300\374 \231\370\326\247\226\225\204a\237\320\274\314o sm\213l\012", "\321\354\303\376 \231\373\322\247\226\225\204a\240\321\264\315o sm\213l\012",
"\320(\203\374 \231\370\012", "\321(\203\376 \231\373\012",
"\276l\204\200\305t\204ua\215\012", "\300l\204\200\306t\204ua\215\012",
"\276r\223g\335", "\300r\223g\332",
"\276subscript\326\246\200\042[ ]\350\357\211\230\221\203\327\313j\247\342\234\227\202\275", "\300subscript\322\242\200\042[ ]\350\363\211\230\222\203\327\305j\247\344\234\227\202\277",
"m\343\207-\342\234\227\202\351\262y\203\371f\343l\224\204i\207\213iz\277\012", "m\335\207-\344\234\227\202\351\262y\203\374f\335l\224\204i\207\213iz\274\012",
"\260ce\277\367\313ximum nu\233\256\310\342\234\227\202\275", "\256ce\274\360\305ximum nu\233\257\310\344\234\227\202\277",
"\220\370\236c\356s\367b\244c\200(\042}\042\235", "\221\373\236\353os\360b\245c\200(\042}\042\235",
"\225\205\201\310\271bod\224\352\242ou\201\271head\211\012", "\225\205\201\310\272bod\224\352\237ou\201\272head\211\012",
"\262ys\326\356c\351\312\300\223\206\271\263t\203\321\316pu\240ic (\346\217\235", "\262ys\322loc\351\312\303\223\206\272\263t\203\326\316pu\241ic (\346\217\235",
"\220\264ish\236\260\317\266\327\355\362\200\344\376il\256\342\222c\207v\335", "\221\265ish\236\256\317\267\327\362\367\200\345mpil\257\344\220c\207v\332",
"duplic\230\200\263t; sam\200\325\274p\345s\236t\352c\335", "duplic\230\200\263t; sam\200\325\264p\336s\236t\352c\332",
"\271\325\313\224\231\372\251\226fa\343\201\250u\200(\346\217\235", "\272\325\305\224\231\361\252\226fa\335\201\251u\200(\346\217\235",
"m\343\207p\360\042#else\350\342\222c\207v\300\355twe\212 \042#if ... #\212\342f\042\012", "m\335\207p\355\042#else\350\344\220c\207v\303\362twe\212 \042#if ... #\212\344f\042\012",
"\042#elseif\350\342\222c\207\333f\245\356w\203\365\042#else\350\342\222c\207v\335", "\042#elseif\350\344\220c\207\331f\246low\203\357\042#else\350\344\220c\207v\332",
"nu\233\256\310\357\211\223d\203\374\300\231\332\201\242\200\357\211\230\221\012", "nu\233\257\310\363\211\223d\203\376\303\231\334\201\237\200\363\211\230\222\012",
"\271\222s\343\201\366\310\357\211\230\221\232 \371\217\012", "\272\220s\335\201\372\310\363\211\230\222\232 \374\217\012",
"\321\270\223g\200\317\322\236\357\211\230\221\275", "\326\271\223g\200\317\323\236\363\211\230\222\277",
"\271\325\313\224\202l\224\372\251s\204g\360\366(\325%d\235", "\272\325\305\224\202l\224\361\252s\204g\355\372(\325%d\235",
"\271\325\313\224\231\316\251\222f\211\212c\200\325\247\365\320(\325\217\235", "\272\325\305\224\231\316\252\220f\211\212c\200\325\247\357\321(\325\217\235",
"\346\321\316bo\242 \251\222f\211\212c\200\223\206\365\320(\346\217\235", "\346\326\316bo\237 \252\220f\211\212c\200\223\206\357\321(\346\217\235",
"\276\244\215\351nu\233\256\317ci\227\327\363#p\244g\313\012", "\300\245\215\351nu\233\257\317ci\227\327\370#p\245g\305\012",
"\244\215\351nu\233\256\362\313\201\213\222ad\224\322\277\012", "\245\215\351nu\233\257\367\305\201\213\220ad\224\323\274\012",
"\244\215\351nu\233\256supp\221\201wa\203\231\212\267\277\012", "\245\215\351nu\233\257supp\222\201wa\203\231\212\270\274\012",
"\246\211-\322\236\357\211\230\247\371\226cl\205\236\355\362\200\246\200(\361\232\235", "\242\211-\323\236\363\211\230\247\374\226\353\205\236\362\367\200\242\200(\366\232\235",
"\042\353e\273\350\357\211\230\247\274\276\327\042\361\350\254\275", "\042\354e\275\350\363\211\230\247\264\300\327\042\366\350\254\277",
"\271\325\371\365\320(\325\217\235", "\272\325\374\357\321(\325\217\235",
"#\322\200p\230t\211\340\303\225\205\201\352\242 \365\213p\304\355\207c \270\330\315\211\012", "#\323\200p\230t\211\342\301\225\205\201\352\237 \357\213p\302\362\207c \271\324\330\211\012",
"\204pu\201l\204\200\314o l\202\255(aft\256subs\207tu\215s\235", "\204pu\201l\204\200\315o l\202\255(aft\257subs\207tu\215s\235",
"\252n\323x \211r\247\363\242\200\260\317\266\202\326\247\276\271c\213l\012", "\250n\313x \211r\247\370\237\200\256\317\267\202\322\247\300\272c\213l\012",
"m\213\362m\236UTF-8 \212\344d\204g\326\247c\221rupt\236\332le: \354", "m\213\367m\236UTF-8 \212\345d\204g\322\247c\222rupt\236\334le: \356",
"\271\246\300bo\242 \042\222turn\350\223\206\042\222tur\340<\250ue>\042\012", "\272\242\303bo\237 \042\220turn\350\223\206\042\220tur\342<\251ue>\042\012",
"\204\305\227\225\212\201\222tur\340typ\300(\320& n\202-\262y\235", "\204\306\227\225\212\201\220tur\342\364p\303(\321& n\202-\262y\235",
"\220k\214w\340\254\326\247\231\251\347\223\201\254 \341", "\221k\214w\342\254\322\247\231\252\347\223\201\254 \343",
"\321\323k\200\251\366a\203\251\226fa\343\201\250u\200f\247\365\204\226x\236\320p\330\324t\256\341", "\326\313k\200\252\372a\203\252\226fa\335\201\251u\200f\247\357\204\226x\236\321p\324\314t\257\343",
"\246\211-\322\236\357\211\230\221\203\223\206na\207\333\361\203\313\224\231\372\331e\275", "\242\211-\323\236\363\211\230\222\203\223\206na\207\331\366\203\305\224\231\361\333e\277",
"\251\271\247\346\313\224\202l\224\355l\202\255\314 \251s\204g\360au\314\336\327\341", "\252\272\247\346\305\224\202l\224\362l\202\255\315 \252s\204g\355au\315\340\327\343",
"\331\200\305fli\315: \202\200\310\242\200\331\300\274\213\222ad\224a\266gn\236\314 a\214\242\256i\376le\234\323\237\341", "\333\200\306fli\330: \202\200\310\237\200\333\303\264\213\220ad\224a\267gn\236\315 a\214\237\257imple\234\313\240\343",
"\364\331\300\205\200\322\236f\247\302\012", "\371\333\303\205\200\323\236f\247\304\012",
"\220k\214w\340au\314\336\202\334", "\221k\214w\342au\315\340\202\337",
"\220k\214w\340\331\200\217 f\247au\314\336\202\334", "\221k\214w\342\333\200\217 f\247au\315\340\202\337",
"pu\240ic \312\300\223\206\356c\351\312\300\313\224\231\372\331\300\341", "pu\241ic \312\303\223\206loc\351\312\303\305\224\231\361\333\303\343",
"\331\200\312\300\313\224\231\316\204i\207\213iz\236\341", "\333\200\312\303\305\224\231\316\204i\207\213iz\236\343",
"pu\240ic \361\203\313\224\231\222tur\340\262y\203\341", "pu\241ic \366\203\305\224\231\220tur\342\262y\203\343",
"a\233i\257ou\203\347\223t; \366ov\211rid\200\274\222qui\222\206\341", "a\233i\260ou\203\347\223t; \372ov\211rid\200\264\220qui\220\206\343",
"nu\233\256\310\263t\203\374\300\231\370 \322i\215\012", "nu\233\257\310\263t\203\376\303\231\373 \323i\215\012",
"\260pe\315\236\366nam\200id\212\207\332\211\012", "\256pe\330\236\372nam\200id\212\207\334\211\012",
"\271\212um\211a\237\222qui\222\203\220iqu\200\323g\012", "\272\212um\211a\240\220qui\220\203\221iqu\200\313g\012",
"\321\372\222qui\222\206p\330\324t\211\203aft\256\357\215\351p\330\324t\211\275", "\326\361\220qui\220\206p\324\314t\211\203aft\257\363\215\351p\324\314t\211\277",
"\344\343\206\231\264\206\324\233\211\232 \363\375uc\201\217\012", "\345\335\206\231\265\206\314\233\211\232 \370\225ruc\201\217\012",
"\302 \374\300\231\372\251\370\367typ\335", "\304 \376\303\231\361\252\373\360\364p\332",
"typ\200\217 sho\343\206\316\217 \363new-\225y\360\226cl\330\215\275", "\364p\200\217 sho\335\206\316\217 \370new-\225y\355\226\353\324\215\277",
"\226\375u\315\221\203\321\222tur\340\250ue\275", "\365sho\335\206\231\361\357\256plici\201\220tur\342\364p\332",
"\271pro\314typ\300\374 \231\370\012", "\272pro\315\364p\303\376 \231\373\012",
"specif\224ei\242\256\213l \342\234\227\202\203\247\202l\224\242\200l\345\201\342\234\227\202\012", "specif\224ei\237\257\213l \344\234\227\202\203\247\202l\224\237\200l\336\201\344\234\227\202\012",
"\321\264\206%\203\354", "\326\265\206\365\356",
"%\203wa\203\213\222ad\224\322\236\327\242\274\354", "\365wa\203\213\220ad\224\323\236\327\237\264\356",
"\321\264\206\223\224\324\242od\203f\247\354", "\326\265\206\223\224\314\237od\203f\247\356",
"\321\264\206\324\242o\206\210.\354", "\326\265\206\314\237o\206\210.\356",
"\321c\213l \324\242od\203\327\365\262y\012", "\326c\213l \314\237od\203\327\357\262y\012",
"\321c\213l \324\242od\203\327\251\361\012", "\326c\213l \314\237od\203\327\252\366\012",
"\324\242o\206\303\372\251\332rs\201\325\344\376a\207\240\200\352\242 \242\200%\203typ\200(\210\235", "\314\237o\206\301\361\252\334rs\201\325\345mpa\207\241\200\352\237 \237\200\365\364p\200(\210\235",
"%\203nam\200\303\225\205\201\352\242 \365upp\211c\345\200lett\211\012", "\365nam\200\301\225\205\201\352\237 \357upp\211c\336\200lett\211\012",
"%\203\304\203\213\222ad\224\355\212 \322\236(\317vio\246l\224se\212 a\203\210\235", "\365\302\203\213\220ad\224\362\212 \323\236(\317vio\242l\224se\212 a\203\210\235",
"\260pe\315\236id\212\207\332\256- d\265you \362ge\201\251type?\012", "\256pe\330\236id\212\207\334\257- d\266you \367ge\201\252\364pe?\012",
"\347ru\315\247\271\303\222tur\340\366\354", "\347ru\330\247\272\301\220tur\342\372\356",
"\321\322\200\347ru\315\247\362\232; \213\222ad\224\260i\225\203a\203\251\354", "\326\323\200\347ru\330\247\367\232; \213\220ad\224\256i\225\203a\203\252\356",
"\226\375u\315\247\303\372\242\200sam\200nam\200a\203%\203\217\012", "miss\360\364pe\322\247\365\301\361\237\200sam\200nam\200a\203\365\217\012",
"\321\246\200\226lete\326%\203%\203\304\203\364\226\375u\315\221\012", "\326\242\200\226lete\322\365\365\302\203\371\226\225ru\330\222\012",
"\364\324\242od\313p \247cl\345\203wa\203fo\220\206f\247\354", "\371\314\237od\305p \247\353\336\203wa\203fo\221\206f\247\356",
"\364\226\375u\315\247wa\203fo\220\206f\247%\203\354", "\371\226\225ru\330\247wa\203fo\221\206f\247\365\356",
"\226\375u\315\221\203\371na\207\333\361\275", "\226\225ru\330\222\203\374na\207\331\366\277",
"\226\375u\315\221\203\321\372\260t\244 \263t\275" "\226\225ru\330\222\203\326\361\256t\245 \263t\277",
"\314\237od\305p \223\206\353\336\203\227gn\230u\220\203\301\242\200new-\225y\355\226\353\324\215\277",
"\237\264\250n\313x \264\231ye\201supp\222t\274\012"
#endif #endif
}; };
static char *fatalmsg[] = { static char *fatalmsg[] = {
#ifdef SCPACK #ifdef SCPACK
/*120*/ "cannot read from file: \"%s\"\n", /*160*/ "cannot read from file: \"%s\"\n",
/*121*/ "cannot write to file: \"%s\"\n", /*161*/ "cannot write to file: \"%s\"\n",
/*122*/ "table overflow: \"%s\"\n", /*162*/ "table overflow: \"%s\"\n",
/* table can be: loop table /* table can be: loop table
* literal table * literal table
* staging buffer * staging buffer
* option table (response file) * option table (response file)
* peephole optimizer table * peephole optimizer table
*/ */
/*123*/ "insufficient memory\n", /*163*/ "insufficient memory\n",
/*124*/ "invalid assembler instruction \"%s\"\n", /*164*/ "invalid assembler instruction \"%s\"\n",
/*125*/ "numeric overflow, exceeding capacity\n", /*165*/ "numeric overflow, exceeding capacity\n",
/*126*/ "compiled script exceeds the maximum memory size (%ld bytes)\n", /*166*/ "compiled script exceeds the maximum memory size (%ld bytes)\n",
/*127*/ "too many error messages on one line\n", /*167*/ "too many error messages on one line\n",
/*128*/ "codepage mapping file not found\n", /*168*/ "codepage mapping file not found\n",
/*129*/ "invalid path: \"%s\"\n", /*169*/ "invalid path: \"%s\"\n",
/*130*/ "assertion failed: %s\n", /*170*/ "assertion failed: %s\n",
/*131*/ "user error: %s\n", /*171*/ "user error: %s\n",
#else #else
"\321\222a\206from \332le\373", "\326\220a\206from \334le\375",
"\321writ\200\314 \332le\373", "\326writ\200\315 \334le\375",
"t\267\200ov\211f\356w\373", "t\270\200ov\211flow\375",
"\204suf\332ci\212\201\324m\221y\012", "\204suf\334ci\212\201\314m\222y\012",
"\276\345se\233l\256\204\375uc\215\334", "\300\336se\233l\257\204\225ruc\215\337",
"num\211ic ov\211f\356w\326\260ce\277\367capacity\012", "num\211ic ov\211flow\322\256ce\274\360capaci\364\012",
"\344\376il\236scrip\201\260ce\277\203\242\200\313ximum \324m\221\224\353\200(%l\206bytes\235", "\345mpil\236scrip\201\256ce\274\203\237\200\305ximum \314m\222\224\354\200(%l\206bytes\235",
"\314o m\223\224\211r\247\324ssag\300\327\202\200l\204\335", "\315o m\223\224\211r\247\314ssag\303\327\202\200l\204\332",
"\344\226pag\200\313pp\367\332\360\231fo\220d\012", "\345\226pag\200\305pp\360\334\355\231fo\221d\012",
"\276p\230h\373", "\300p\230h\375",
"\345s\211\237fail\277: \354", "\336s\211\240fail\274: \356",
"\246\256\211r\221: \354" "\242\257\211r\222: \356"
#endif #endif
}; };
@ -362,43 +367,43 @@ static char *warnmsg[] = {
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n", /*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n" /*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
#else #else
"\302 \274tr\241\230\236\314 %\206\270\330\315\211\275", "\304 \264tr\243\230\236\315 %\206\271\324\330\211\277",
"\222\322i\237\310\347\223t/\313cro \341", "\220\323i\240\310\347\223t/\305cro \343",
"nu\233\256\310\263t\203\374\300\231\370 \322i\215\012", "nu\233\257\310\263t\203\376\303\231\373 \323i\215\012",
"\254 \274nev\256\246\277\373", "\254 \264nev\257\242\274\375",
"\254 \274a\266gn\236\251\250u\200\242a\201\274nev\256\246\277\373", "\254 \264a\267gn\236\252\251u\200\237a\201\264nev\257\242\274\375",
"\222d\220d\223\201\344\226: \347\223\201\260\317\266\327\274z\211o\012", "\220d\221d\223\201\345\226: \347\223\201\256\317\267\327\264z\211o\012",
"\222d\220d\223\201te\225: \347\223\201\260\317\266\327\274n\202-z\211o\012", "\220d\221d\223\201te\225: \347\223\201\256\317\267\327\264n\202-z\211o\012",
"\220k\214w\340#p\244g\313\012", "\221k\214w\342#p\245g\305\012",
"\271\352\242 \366\222s\343\201\246\236\355\362\200\322i\215\326\362c\367\222p\205s\335", "\272\352\237 \372\220s\335\201\242\236\362\367\200\323i\215\322\367c\360\220p\205s\332",
"\361\232 sho\343\206\222tur\340\251\250u\335", "\366\232 sho\335\206\220tur\342\252\251u\332",
"po\266\240\200\246\200\310\254 \355\362\200\204i\207\213iza\215\373", "po\267\241\200\242\200\310\254 \362\367\200\204i\207\213iza\215\375",
"po\266\240\224\220\204t\212\226\206a\266gn\234t\012", "po\267\241\224\221\204t\212\226\206a\267gn\234t\012",
"po\266\240\224\220\204t\212\226\206bit\352s\200\357\211a\215\012", "po\267\241\224\221\204t\212\226\206bit\352s\200\363\211a\215\012",
"\366mis\370\012", "\372mis\373\012",
"po\266\240\224\251\042\347\350\320\325wa\203\204t\212\226d\373", "po\267\241\224\252\042\347\350\321\325wa\203\204t\212\226d\375",
"\260\317\266\327\304\203\364effe\315\012", "\256\317\267\327\302\203\371effe\330\012",
"ne\225\236\344m\234t\012", "ne\225\236\345m\234t\012",
"\356os\200\204d\212\323\215\012", "loos\200\204d\212\313\215\012",
"\245\206\225y\360pro\314typ\300\246\236\352\242 \357\215\351semic\245umn\275", "\246\206\225y\355pro\315\364p\303\242\236\352\237 \363\215\351semic\246umn\277",
"\356c\351\346\217 s\304\374w\203\251\346a\201\251\317c\277\367level\012", "loc\351\346\217 s\302\376w\203\252\346a\201\252\317c\274\360level\012",
"\260\317\266\327\352\242 \366ov\211rid\200\303appe\205 \355twe\212 p\205\212\242ese\275", "\256\317\267\327\352\237 \372ov\211rid\200\301appe\205 \362twe\212 p\205\212\237ese\277",
"la\355l nam\200\217 s\304\374w\203\366na\324\012", "la\362l nam\200\217 s\302\376w\203\372na\314\012",
"nu\233\256\310\342git\203\260ce\277\203\244\215\351nu\233\256\317ci\227\202\012", "nu\233\257\310\344git\203\256ce\274\203\245\215\351nu\233\257\317ci\227\202\012",
"\222d\220d\223\201\042\353e\273\042: \325\353\200\274\213way\2031 \341", "\220d\221d\223\201\042\354e\275\042: \325\354\200\264\213way\2031 \343",
"\204\226t\211m\204\230\200\320\353\200\363\042\353e\273\350\260\317\266\327\341", "\204\226t\211m\204\230\200\321\354\200\370\042\354e\275\350\256\317\267\327\343",
"\220\222a\270\267\200\344\226\012", "\221\220a\271\270\200\345\226\012",
"\251\346\274a\266gn\236\314 itself \341", "\252\346\264a\267gn\236\315 itself \343",
"m\221\200\204i\207\213iz\211\203\242\365\212um \332eld\275", "m\222\200\204i\207\213iz\211\203\237\357\212um \334eld\277",
"l\212g\242 \310\204i\207\213iz\256\260ce\277\203\353\200\310\242\200\212um \332eld\012", "l\212g\237 \310\204i\207\213iz\257\256ce\274\203\354\200\310\237\200\212um \334eld\012",
"\204\226x \366mis\370 \341", "\204\226x \372mis\373 \343",
"\364i\376le\234\323\237f\247\331\200\217 \363\361\232\326\364f\213l-back\012", "\371imple\234\313\240f\247\333\200\217 \370\366\232\322\371f\213l-back\012",
"\331\200speci\332ca\237\327\362w\205\206\226cl\330\237\274ig\214\222d\012", "\333\200speci\334ca\240\327\367w\205\206\226\353\324\240\264ig\214\220d\012",
"outpu\201\332\360\274writt\212\326bu\201\352\242 \344\376ac\201\212\344d\367\342s\267\277\012", "outpu\201\334\355\264writt\212\322bu\201\352\237 \345mpac\201\212\345d\360\344s\270\274\012",
"\331\200\346\217 s\304\374w\203\251g\356b\351\312\335", "\333\200\346\217 s\302\376w\203\252glob\351\312\332",
"\302 \274m\205k\236a\203\226\317c\230\277: \354", "\304 \264m\205k\236a\203\226\317c\230\274: \356",
"pu\240ic \271lack\203\362w\205\206\226cl\330\237\341", "pu\241ic \272lack\203\367w\205\206\226\353\324\240\343",
"\220k\214w\340p\330\324t\256\363subs\207tu\237(\204c\221\222c\201#\322\200p\230t\211n\235" "\221k\214w\342p\324\314t\257\370subs\207tu\240(\204c\222\220c\201#\323\200p\230t\211n\235"
#endif #endif
}; };

View File

@ -197,7 +197,7 @@ AddToHashTable(HashTable *ht, symbol *sym)
he = (HashEntry *)malloc(sizeof(HashEntry)); he = (HashEntry *)malloc(sizeof(HashEntry));
if (!he) if (!he)
error(123); error(163);
he->sym = sym; he->sym = sym;
he->next = NULL; he->next = NULL;
*hep = he; *hep = he;

View File

@ -0,0 +1,8 @@
methodmap X {
public native Float X();
public native String Z();
public native T:Z();
}
public main() {
}

View File

@ -0,0 +1,3 @@
type "Float" should be "float" in new-style declarations
type "String" should be "char" in new-style declarations
methodmap and class signatures must use new-style declarations

View File

@ -0,0 +1,17 @@
methodmap Handle {
public native Handle();
public native ~Handle();
public native Handle Clone();
public native int Size();
public native float SizeF();
public native bool Ok(x, y, z);
};
public main() {
new Handle:handle = Handle();
handle.Clone();
new x = handle.Size();
new Float:f = handle.SizeF();
new bool:b = handle.Ok(1, 2, 3);
delete handle;
}

View File

@ -14,7 +14,6 @@ def run_tests(args):
failed = False failed = False
for test in tests: for test in tests:
print('Testing {0}...'.format(test))
if test.startswith('fail-'): if test.startswith('fail-'):
kind = 'fail' kind = 'fail'
elif test.startswith('warn-'): elif test.startswith('warn-'):
@ -41,27 +40,33 @@ def run_tests(args):
status = 'fail' status = 'fail'
if status == 'ok' and kind != 'pass': if status == 'ok' and kind != 'pass':
lines = []
with open(os.path.join(testdir, test + '.txt')) as fp: with open(os.path.join(testdir, test + '.txt')) as fp:
text = fp.read().strip() for line in fp:
if text not in stdout: lines.append(line.strip())
print('Expected to find text in stdout: >>>') for line in lines:
print(text) if line not in stdout:
print('<<<') sys.stderr.write('Expected to find text in stdout: >>>\n')
sys.stderr.write(text)
sys.stderr.write('<<<\n')
status = 'fail' status = 'fail'
break
if status == 'fail': if status == 'fail':
print('Test {0} ... FAIL'.format(test))
failed = True failed = True
print('FAILED! Dumping stdout/stderr:') sys.stderr.write('FAILED! Dumping stdout/stderr:\n')
print(stdout) sys.stderr.write(stdout)
print(stderr) sys.stderr.write(stderr)
else: else:
print('... OK!') print('Test {0} ... OK'.format(test))
except Exception as exn: except Exception as exn:
raise raise
sys.stderr.write('FAILED! {0}\n'.format(exn.message)) sys.stderr.write('FAILED! {0}\n'.format(exn.message))
if failed: if failed:
sys.stderr.write('One or more tests failed!\n')
sys.exit(1) sys.exit(1)
def main(): def main():