Merge pull request #67 from alliedmodders/glbdecls

Add support for new-style declarations in globals.
This commit is contained in:
David Anderson 2014-07-04 17:21:26 -07:00
commit 5d753c2697
13 changed files with 712 additions and 755 deletions

View File

@ -108,7 +108,7 @@ public Plugin:myinfo;
*
* @noreturn
*/
forward OnPluginStart();
forward void OnPluginStart();
/**
* @deprecated Use AskPluginLoad2() instead.
@ -167,7 +167,7 @@ forward OnGameFrame();
* @note This used to be OnServerLoad(), which is now deprecated.
* Plugins still using the old forward will work.
*/
forward OnMapStart();
forward void OnMapStart();
/**
* Called right before a map ends.
@ -184,7 +184,7 @@ forward OnMapEnd();
*
* @noreturn
*/
forward OnConfigsExecuted();
forward void OnConfigsExecuted();
/**
* This is called once, right after OnMapStart() but any time before

View File

@ -1200,4 +1200,4 @@ public Native_GetNominatedMapList(Handle:plugin, numParams)
}
return;
}
}

View File

@ -36,7 +36,7 @@
#include <sourcemod>
#include "include/nextmap.inc"
public Plugin:myinfo =
public Plugin myinfo =
{
name = "Nextmap",
author = "AlliedModders LLC",
@ -46,13 +46,13 @@ public Plugin:myinfo =
};
new g_MapPos = -1;
new Handle:g_MapList = INVALID_HANDLE;
new g_MapListSerial = -1;
int g_MapPos = -1;
Handle g_MapList = INVALID_HANDLE;
int g_MapListSerial = -1;
new g_CurrentMapStartTime;
int g_CurrentMapStartTime;
public APLRes:AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
decl String:game[128];
GetGameFolderName(game, sizeof(game));
@ -73,7 +73,7 @@ public APLRes:AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
}
public OnPluginStart()
public void OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("nextmap.phrases");
@ -89,12 +89,12 @@ public OnPluginStart()
SetNextMap(currentMap);
}
public OnMapStart()
public void OnMapStart()
{
g_CurrentMapStartTime = GetTime();
}
public OnConfigsExecuted()
public void OnConfigsExecuted()
{
decl String:lastMap[64], String:currentMap[64];
GetNextMap(lastMap, sizeof(lastMap));
@ -109,7 +109,7 @@ public OnConfigsExecuted()
}
}
public Action:Command_List(int client, int args)
public Action Command_List(int client, int args)
{
PrintToConsole(client, "Map Cycle:");
@ -124,7 +124,7 @@ public Action:Command_List(int client, int args)
return Plugin_Handled;
}
FindAndSetNextMap()
void FindAndSetNextMap()
{
if (ReadMapList(g_MapList,
g_MapListSerial,
@ -169,7 +169,7 @@ FindAndSetNextMap()
SetNextMap(mapName);
}
public Action:Command_MapHistory(int client, int args)
public Action Command_MapHistory(int client, int args)
{
new mapCount = GetMapHistorySize();
@ -202,7 +202,7 @@ public Action:Command_MapHistory(int client, int args)
return Plugin_Handled;
}
FormatTimeDuration(char[] buffer, int maxlen, int time)
int FormatTimeDuration(char[] buffer, int maxlen, int time)
{
new days = time / 86400;
new hours = (time / 3600) % 24;

View File

@ -258,20 +258,19 @@ typedef struct svalue_s {
int lvalue;
} svalue;
#define TYPEFLAG_ONLY_NEW 0x01 // Only new-style types are allowed.
#define TYPEFLAG_ARGUMENT 0x02 // The declaration is for an argument.
#define TYPEFLAG_VARIABLE 0x04 // The declaration is for a variable.
#define TYPEFLAG_ENUMROOT 0x08 // Multi-dimensional arrays should have an enumroot.
#define TYPEFLAG_NO_POSTDIMS 0x10 // Do not parse post-fix dimensions.
#define TYPEFLAG_RETURN 0x20 // Return type.
#define TYPEMASK_NAMED_DECL (TYPEFLAG_ARGUMENT | TYPEFLAG_VARIABLE)
#define DECLFLAG_ONLY_NEW 0x01 // Only new-style types are allowed.
#define DECLFLAG_ARGUMENT 0x02 // The declaration is for an argument.
#define DECLFLAG_VARIABLE 0x04 // The declaration is for a variable.
#define DECLFLAG_ENUMROOT 0x08 // Multi-dimensional arrays should have an enumroot.
#define DECLFLAG_MAYBE_FUNCTION 0x10 // Might be a named function.
#define DECLMASK_NAMED_DECL (DECLFLAG_ARGUMENT | DECLFLAG_VARIABLE | DECLFLAG_MAYBE_FUNCTION)
typedef struct {
// Array information.
int numdim;
int dim[sDIMEN_MAX];
int idxtag[sDIMEN_MAX];
cell array_size;
cell size;
constvalue *enumroot;
// Type information.
@ -286,6 +285,9 @@ typedef struct {
typedef struct {
char name[sNAMEMAX + 1];
typeinfo_t type;
int is_new; // New-style declaration.
int has_postdims; // Dimensions, if present, were in postfix position.
int opertok; // Operator token, if applicable.
} declinfo_t;
/* "while" statement queue (also used for "for" and "do - while" loops) */
@ -516,8 +518,9 @@ typedef enum s_optmark {
#define OBJECTTAG 0x10000000Lu
#define ENUMTAG 0x08000000Lu
#define METHODMAPTAG 0x04000000Lu
#define STRUCTTAG 0x02000000Lu
#define TAGMASK (~PUBLICTAG)
#define TAGTYPEMASK (FUNCTAG | OBJECTTAG | ENUMTAG | METHODMAPTAG)
#define TAGTYPEMASK (FUNCTAG | OBJECTTAG | ENUMTAG | METHODMAPTAG | STRUCTTAG)
#define TAGFLAGMASK (FIXEDTAG | TAGTYPEMASK)
#define CELL_MAX (((ucell)1 << (sizeof(cell)*8-1)) - 1)
@ -598,7 +601,7 @@ void sp_fdbg_ntv_hook(int index, symbol *sym);
/* function prototypes in SC1.C */
SC_FUNC void set_extension(char *filename,char *extension,int force);
SC_FUNC symbol *fetchfunc(char *name,int tag);
SC_FUNC symbol *fetchfunc(char *name);
SC_FUNC char *operator_symname(char *symname,char *opername,int tag1,int tag2,int numtags,int resulttag);
SC_FUNC char *funcdisplayname(char *dest,char *funcname);
SC_FUNC int constexpr(cell *val,int *tag,symbol **symptr);
@ -651,7 +654,8 @@ SC_FUNC symbol *addsym(const char *name,cell addr,int ident,int vclass,int tag,
SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int tag,
int dim[],int numdim,int idxtag[]);
SC_FUNC symbol *addvariable2(const char *name,cell addr,int ident,int vclass,int tag,
int dim[],int numdim,int idxtag[],int slength);
int dim[],int numdim,int idxtag[],int slength);
SC_FUNC symbol *addvariable3(declinfo_t *decl,cell addr,int vclass,int slength);
SC_FUNC int getlabel(void);
SC_FUNC char *itoh(ucell val);

File diff suppressed because it is too large Load Diff

View File

@ -1949,7 +1949,7 @@ char *sc_tokens[] = {
"...", "..", "::",
"assert",
"*begin", "break",
"case", "cellsof", "chars", "class", "const", "continue",
"case", "cellsof", "char", "class", "const", "continue",
"decl", "default", "defined", "delete", "do",
"else", "*end", "enum", "exit",
"for", "forward", "funcenum", "functag",
@ -3021,6 +3021,22 @@ SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int
return addvariable2(name,addr,ident,vclass,tag,dim,numdim,idxtag,0);
}
SC_FUNC symbol *addvariable3(declinfo_t *decl,cell addr,int vclass,int slength)
{
typeinfo_t *type = &decl->type;
return addvariable2(
decl->name,
addr,
type->ident,
vclass,
type->tag,
type->dim,
type->numdim,
type->idxtag,
slength
);
}
SC_FUNC symbol *addvariable2(const char *name,cell addr,int ident,int vclass,int tag,
int dim[],int numdim,int idxtag[],int slength)
{

View File

@ -2129,7 +2129,7 @@ restart:
/* could be a "use before declaration"; in that case, create a stub
* function so that the usage can be marked.
*/
sym=fetchfunc(lastsymbol,0);
sym=fetchfunc(lastsymbol);
if (sym==NULL)
error(163); /* insufficient memory */
markusage(sym,uREAD);
@ -2281,7 +2281,7 @@ static int primary(value *lval)
* call" syntax. So assume that the symbol refers to a function.
*/
assert(sc_status==statFIRST);
sym=fetchfunc(st,0);
sym=fetchfunc(st);
if (sym==NULL)
error(163); /* insufficient memory */
} /* if */

View File

@ -31,14 +31,14 @@ SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned ch
#define SCPACK_TABLE errstr_table
/*-*SCPACK start of pair table, do not change or remove this line */
unsigned char errstr_table [][2] = {
{101,32}, {116,32}, {111,110}, {115,32}, {100,32}, {105,110}, {97,114}, {116,105}, {37,115}, {101,114}, {110,111}, {97,110}, {101,110}, {97,108}, {135,130}, {34,136},
{143,34}, {114,101}, {111,114}, {117,110}, {121,32}, {138,129}, {97,116}, {115,105}, {115,116}, {101,132}, {100,101}, {109,140}, {32,144}, {41,10}, {109,98}, {116,104},
{114,97}, {117,115}, {146,32}, {147,99}, {142,32}, {98,108}, {102,163}, {111,108}, {101,120}, {118,141}, {97,32}, {115,121}, {171,158}, {172,167}, {99,139}, {103,32},
{134,160}, {116,121}, {115,10}, {174,149}, {112,101}, {103,117}, {181,155}, {137,32}, {134,182}, {116,111}, {102,133}, {115,151}, {99,104}, {105,132}, {97,165}, {105,131},
{161,129}, {166,164}, {169,189}, {109,192}, {104,97}, {109,101}, {111,102}, {99,116}, {133,194}, {109,97}, {101,100}, {99,130}, {37,131}, {176,148}, {173,156}, {44,32},
{117,108}, {99,111}, {98,128}, {118,134}, {112,145}, {198,32}, {105,190}, {211,214}, {116,97}, {101,131}, {130,32}, {154,186}, {134,97}, {102,105}, {118,128}, {184,129},
{110,32}, {111,112}, {97,115}, {136,10}, {156,10}, {128,144}, {152,150}, {109,150}, {100,105}, {119,105}, {225,137}, {101,10}, {206,157}, {34,32}, {40,236}, {99,108},
{97,131}, {203,152}, {139,32}, {141,32}, {196,222}, {101,108}, {177,112}, {151,122}, {108,128}, {166,142}, {133,32}, {159,32}, {216,175}, {133,175}, {231,188}
{101,32}, {116,32}, {111,110}, {115,32}, {100,32}, {105,110}, {97,114}, {116,105}, {37,115}, {101,114}, {110,111}, {97,110}, {101,110}, {97,108}, {135,130}, {114,101},
{34,136}, {144,34}, {111,114}, {117,110}, {121,32}, {138,129}, {115,105}, {115,116}, {97,116}, {100,101}, {101,132}, {109,140}, {32,145}, {41,10}, {109,98}, {116,104},
{114,97}, {147,99}, {117,115}, {146,32}, {98,108}, {161,142}, {102,165}, {111,108}, {101,120}, {118,141}, {97,32}, {115,121}, {116,121}, {99,139}, {171,158}, {134,160},
{174,167}, {112,101}, {173,149}, {115,10}, {103,32}, {103,117}, {181,155}, {137,32}, {134,182}, {116,111}, {102,133}, {105,132}, {115,150}, {104,97}, {169,187}, {111,102},
{99,104}, {105,131}, {162,129}, {44,32}, {166,32}, {97,164}, {133,190}, {109,194}, {109,101}, {99,116}, {175,148}, {109,97}, {101,100}, {117,108}, {99,130}, {37,131},
{97,142}, {176,156}, {191,32}, {99,111}, {98,128}, {101,131}, {118,134}, {112,143}, {130,32}, {105,197}, {214,217}, {118,128}, {110,32}, {153,186}, {102,105}, {184,129},
{100,105}, {99,108}, {111,112}, {97,115}, {136,10}, {156,10}, {128,145}, {109,152}, {151,152}, {116,97}, {119,105}, {108,128}, {97,131}, {226,137}, {101,10}, {209,157},
{34,32}, {189,219}, {40,239}, {172,112}, {150,122}, {206,151}, {139,32}, {141,32}, {172,177}, {110,97}, {101,108}, {243,128}, {139,132}, {102,146}, {133,32}
};
/*-*SCPACK end of pair table, do not change or remove this line */
@ -184,146 +184,155 @@ static char *errmsg[] = {
/*138*/ "const was specified twice\n",
/*139*/ "could not find type \"%s\"\n",
/*140*/ "new-style array types cannot specify dimension sizes as part of their type\n",
/*141*/ "natives, forwards, and public functions cannot return arrays\n",
/*142*/ "invalid type declaration\n",
/*143*/ "new-style declarations should not have \"new\"\n",
/*144*/ "void cannot be used as a variable type\n",
/*145*/ "invalid type expression\n",
#else
"\250\264\307\231\271k\214:\234\317bu\201fo\223\204\220\012",
"\202l\224\252s\205g\370\346e\233\201(\242\250\324\273\202) \256 f\247low ea\274 \042c\342e\042\012",
"\232\357\334\244\325\252loc\363\327\200\303ap\264\206 \372\252\321mpo\223\204\245ock\012",
"\371\234 \277\225imple\233t\312\012",
"\301\311\224\225\364\270t\262",
"\303\322a\273gn\231\271 \362\260y\012",
"\352\226\242\263\322\221\333\312\012",
"\303\322\252\361\213\201\250\324\273\202; \342sum\231z\211o\012",
"\310\315\367\200(nega\207ve\317z\211o \242ou\201\325bo\223ds\235",
"\310\301\242\232\357\334\216\012",
"\310out\227d\200\371\262",
"\310\301c\215l\317\225\252\302add\221s\262",
"\212 \214tr\224po\205\201(\212 pu\245ic \371s\235",
"\310\346e\233t; \225\372s\351t\274\012",
"\042\232fa\320t\355c\342\200\303\322\237\200l\342\201c\342\200\372s\351t\274 \346e\233t\012",
"m\320\207p\370\232fa\320t\203\372\042s\351t\274\042\012",
"\223\333\231\316\012",
"\205i\207\215iza\244d\226\252\250ce\312\203\232\357\206\231\367\353",
"\225\252lab\365:\344",
"\310\255 nam\345\012",
"\255 \215\221ad\224\333\312:\344",
"\303\322l\251u\200(n\202-\361\213t\235",
"\315a\273gn\233\201\303\322\227mp\370a\273gn\233t\012",
"\042b\221ak\355\242\042\313t\205ue\355\277ou\201\325\313t\250t\012",
"\301head\375\350ff\211\203from pro\271\261\264\012",
"\212 \376\375\042#if...\042\012",
"\310\274\334\307\267\361\213t\012",
"\310subscrip\201(\225\362\315\242\271o m\213\224subscripts):\344",
"\310\250\324\273\202\317\342sum\231z\211o\012",
"\321mpo\223\204\346e\233\201\225\357os\231a\201\237\200\214\204\325\335\370(\230\206t\231a\201l\205\200%d\235",
"\223k\212w\340\350\221c\207v\353",
"\315\205\232x ou\201\325bo\223d\203(\327\345\235",
"\315\303\322\205\232x\231(\327\345\235",
"\337do\331\225\364\252\232fa\320\201\251u\200(\337%d\235",
"\337\366\200mis\376 (\337%d\235",
"empt\224\346e\233t\012",
"\310\230r\375(po\273\245\224n\202-t\211m\205\226\231\230r\205g\235",
"\250t\240 \274\334\307\211\203\332l\205\353",
"\361\213\201\255 \304\203\212 \367\353",
"duplic\226\200\042c\342e\355lab\365 (\251u\200%d\235",
"\310\365lip\227s\317\315\367\200\277\225k\212wn\012",
"\310\321\236\205a\244\325\357\342\203s\264ci\335\211\262",
"\274\334\307\267\361\213\201\250ce\312\203r\213g\200f\242pack\231\230r\205g\012",
"po\227\216\363p\334\305t\211\203\303\324c\312\200\215l nam\231p\334\305t\211\262",
"\271o m\213\224\301\270t\262",
"\223k\212w\340\315\367\200(\327\345\235",
"\315\367\331do \225\376\317\242\232\230\205a\244\315\277\271o sm\215l\012",
"\315(\203do \225\376\012",
"\310l\205\200\313t\205ua\216\012",
"\310r\213g\353",
"\310subscript\317\241\200\042[ ]\355\352\226\222\203\332\311j\242\350\233\227\202\262",
"m\320\207-\350\233\227\202\363\260y\203\303\322f\320l\224\205i\207\215iz\312\012",
"\250ce\312\375\311ximum nu\236\267\325\350\233\227\202\262",
"\223\376\231\357os\375b\240c\200(\042}\042\235",
"\230\206\201\325\301bod\224\351\237ou\201\301head\211\012",
"\260ys\317loc\363\327\331\213\204\301\270t\203\263\322pu\245ic (\327\345\235",
"\223\272ish\231\250\324\273\332bef\222\200\321mpil\267\350\221c\207v\353",
"duplic\226\200\270t; sam\200\337\277p\342s\231t\351c\353",
"\301\337\311\224\225\364\252\232fa\320\201\251u\200(\327\345\235",
"m\320\207p\370\042#\365se\355\350\221c\207v\331betwe\214 \042#if ... #\214\350f\042\012",
"\042#\365seif\355\350\221c\207\336f\247low\203\362\042#\365se\355\350\221c\207v\353",
"nu\236\267\325\352\213d\203do\331\225\335\201\237\200\352\226\222\012",
"\301\221s\320\201\374\325\352\226\222\234 \303\322\220\012",
"\263\274\213g\200\324\333\231\352\226\222\262",
"\301\337\311\224\202l\224\364\252s\205g\370\374(\337%d\235",
"\301\337\311\224\225\322\252\221f\211\214c\200\337\242\362\315(\337\220\235",
"\327\200\263\322bo\373\252\221f\211\214c\200\213\204\362\315(\327\345\235",
"\310\240\216\363nu\236\267\324ci\227\332\372#p\240g\311\012",
"\240\216\363nu\236\267f\222\311\201\215\221ad\224\333\312\012",
"\240\216\363nu\236\267supp\222\201w\360\225\214\276\312\012",
"\241\211-\333\231\352\226\242\303\322\232\357\206\231bef\222\200\241\200(\371\234\235",
"\042\367e\306\355\352\226\242\277\310\332\042\371\355\255\262",
"\301\337\303\322\362\315(\337\220\235",
"#\333\200p\226t\211\340\303\230\206\201\351\373\362\215p\304be\207c \274\334\307\211\012",
"\205pu\201l\205\200\271o l\202\257(aft\267subs\207tu\216s\235",
"\253n\330x \211r\242\372\237\200\250\324\273\202\317\242\310\301c\215l\012",
"m\215f\222m\231UTF-8 \214\321d\205g\317\242c\222rupt\231\335le: \343",
"\301\241\331bo\373\042\221turn\355\213\204\042\221tur\340<\251ue>\042\012",
"\205\313\227\230\214\201\221tur\340\261\264\203(\315& n\202-\260y\235",
"\223k\212w\340\255\317\242\225\252\361\213\201\255 \356",
"\263\330k\200\252\374\360\252\232fa\320\201\251u\200f\242\362\205\232x\231\315p\334\305t\267\356",
"\241\211-\333\231\352\226\222\203\213\204na\207\336\371\203\311\224\225\364\346e\262",
"\252\301\242\327\200\311\224\202l\224b\365\202\257\271 \252s\205g\370au\271\347\332\356",
"\346\200\313fli\307: \202\200\325\237\200\346\331\277\215\221ad\224a\273gn\231\271 a\212\237\267imple\233\330\244\356",
"\212 \346\331\206\200\333\231f\242\316\012",
"\223k\212w\340au\271\347\202\344",
"\223k\212w\340\346\345 f\242au\271\347\202\344",
"pu\245ic \327\331\213\204loc\363\327\331\311\224\225\364\346\331\356",
"\346\200\327\331\311\224\225\322\205i\207\215iz\231\356",
"pu\245ic \371\203\311\224\225\221tur\340\260y\203\356",
"a\236i\265ou\203\361\213t; \374ov\211rid\200\277\221qui\221\204\356",
"nu\236\267\325\270t\203do\331\225\376 \333i\216\012",
"\250\264\307\231\374nam\200id\214\207\335\211\012",
"\301\214um\211a\244\221qui\221\203\223iqu\200\330g\012",
"\263\364\221qui\221\204p\334\305t\211\203aft\267\341\216\363p\334\305t\211\262",
"\321\320\204\225\272\204\305\236\211\234 \372\230ruc\201\220\012",
"\316 do\331\225\364\252\376\375\261\264\012",
"\366\345 sho\320\204\322\220 \372new-\230y\370\232\357\334\216\262",
"\314sho\320\204\225\364\362\250plici\201\221tur\340\261\264\012",
"\301pro\271\261\264\203do \225\376\012",
"s\264cif\224ei\237\267\215l \350\233\227\202\203\242\202l\224\237\200l\342\201\350\233\227\202\012",
"\263\272\204\314\343",
"\314w\360\215\221ad\224\333\231\332\237\277\343",
"\263\272\204\213\224\305\237od\203f\242\343",
"\263\272\204\305\237o\204\242pr\352t\224\210.\343",
"\263c\215l \305\237od\203\332\362\260y\012",
"\263c\215l \305\237od\203\332\252\371\012",
"\305\237o\204\303\364\252\335rs\201\337\321mpa\207\245\200\351\373\237\200\314\366\200(\210\235",
"\314nam\200\303\230\206\201\351\373\362upp\211c\342\200lett\211\012",
"\314\304\203\215\221ad\224be\214 \333\231(\324vio\241l\224se\214 \360\210\235",
"\250\264\307\231id\214\207\335\267- d\275you f\222ge\201\252\261\264?\012",
"\361ru\307\242\301\303\221tur\340\374\343",
"\263\333\200\361ru\307\242f\222\234; \215\221ad\224\250i\230\203\360\252\343",
"miss\375\261\264\317\242\314\303\364\237\200sam\200nam\200\360\314\220\012",
"\263\241\200\232lete\317\314\314\304\203\212 \232\230ru\307\222\012",
"\212 \305\237od\311p \242\357\342\203w\360fo\223\204f\242\343",
"\212 \232\230ru\307\242w\360fo\223\204f\242\314\343",
"\232\230ru\307\222\203\303\322na\207\336\371\262",
"\232\230ru\307\222\203\263\364\250t\240 \270t\262",
"\305\237od\311p \213\204\357\342\203\227gn\226u\221\203\303\241\200new-\230y\370\366\200\232\357\334\216\262",
"\263s\264cif\224\315\350\233\227\202\203\332bo\373\366\200\213\204na\305\012",
"\250\264\307\231\366\200\250\324\273\202\012",
"f\320ly-qu\215i\335\231nam\345 \277\271o l\202g\317wo\320\204\322tr\243\226\231\271\344",
"\223\250\264\307\231\271k\214\317\250\264\307\231\305\237o\204\242pr\352\261\012",
"\250\264\307\231\042na\207ve\355\242\042get\042\012",
"\314f\242\314\215\221ad\224\250i\230\262",
"pr\352t\224gett\211\203\263accep\201\250t\240 \270t\262",
"\314\303\364\237\200sam\200\221tur\340\366\200\360pr\352t\224\314(\210\235",
"\263mix \305\237od\311p\203\213\204\357\342s\331\351\373\205h\211it\213c\353",
"\263\321\211c\200\371\203\271 \251ue\262",
"\263\321\211c\200objec\201\366\200\314\271 n\202-objec\201\366\200\343",
"\263\321\211c\200n\202-objec\201\366\200\314\271 objec\201\366\200\343",
"\263\321\211c\200\223\221l\226\231objec\201\261\264\203\314\213\204\343",
"\366\200mis\376 (\314\213\204\210\235",
"\263\241\200\362objec\201\372\252m\320\207-\374s\365e\307\222\012",
"\260y\203\206\200\225supp\222t\231\360\221tur\340\261\264\262",
"\263mix \221f\211\214c\200\213\204\315\261\264\262",
"\313s\201w\360s\264ci\335\231t\351c\353",
"\321\320\204\225\272\204\366\345\012"
"\250\261\311\232\271k\214:\234\303bu\201fo\223\204\221\012",
"\202l\224\252s\205g\353\350e\233\201(\243\250\327\274\202) \255 f\247low ea\300 \042c\343e\042\012",
"\231\341\206\320 \322\252loc\367\332\200\307ap\261\206 \376\252\323mpo\223\204\244ock\012",
"\246\234 \301\225imple\233t\314\012",
"\304\313\224\225\361\270t\263",
"\307\324a\274gn\232\271 \366\257y\012",
"\355\230\243\262\324\217\335\314\012",
"\307\324\252\365\213\201\250\327\274\202; \343sum\232z\211o\012",
"\306\312\364\200(nega\207ve\303z\211o \243ou\201\322bo\223ds\235",
"\306\304\243\231\341\206\320\012",
"\306out\226d\200\246\263",
"\306\304c\215l\303\225\252\276add\217s\263",
"\212 \214tr\224po\205\201(\212 pu\244ic \246s\235",
"\306\350e\233t; \225\376s\352t\300\012",
"\042\231fa\315t\360c\343\200\307\324\237\200l\343\201c\343\200\376s\352t\300 \350e\233t\012",
"m\315\207p\353\231fa\315t\203\376\042s\352t\300\042\012",
"\223\335\232\321\012",
"\205i\207\215iz\320 d\230\252\250ce\314\203\231\341\206\232\364\356",
"\225\252lab\372:\345",
"\306\260 \371m\346\012",
"\260 \215\217ad\224\335\314:\345",
"\307\324l\251u\200(n\202-\365\213t\235",
"\312a\274gn\233\201\307\324\226mp\353a\274gn\233t\012",
"\042b\217ak\360\243\042\316t\205ue\360\301ou\201\322\316t\250t\012",
"\304head\205\264\340ff\211\203from pro\271\370\012",
"\212 \347\300\205\264\042#if...\042\012",
"\306\300\206a\311\267\365\213t\012",
"\306subscrip\201(\225\366\312\243\271o m\213\224subscripts):\345",
"\306\250\327\274\202\303\343sum\232z\211o\012",
"\323mpo\223\204\350e\233\201\225\341os\232a\201\237\200\214\204\322\336\353(\227\206t\232a\201l\205\200%d\235",
"\223k\212w\334\340\217c\207v\356",
"\312\205\231x ou\201\322bo\223d\203(\332\346\235",
"\312\307\324\205\231x\232(\332\346\235",
"\337do\325\225\361\252\231fa\315\201\251u\200(\337%d\235",
"\337\373mis\347\300 (\337%d\235",
"empt\224\350e\233t\012",
"\306\227r\205\264(po\274\244\224n\202-t\211m\205\230\232\227r\205g\235",
"\250t\240 \300\206a\311\211\203\330l\205\356",
"\365\213\201\260 \275\203\212 \364\356",
"duplic\230\200\042c\343e\360lab\372 (\251u\200%d\235",
"\306\372lip\226s\303\312\364\200\301\225k\212wn\012",
"\306\323\236\205\320 \322\341\343\203s\261ci\336\211\263",
"\300\206a\311\267\365\213\201\250ce\314\203r\213g\200f\243pack\232\227r\205g\012",
"po\226\216\367p\206a\310t\211\203\307\327c\314\200\215l \371m\232p\206a\310t\211\263",
"\271o m\213\224\304\270t\263",
"\223k\212w\334\312\364\200(\332\346\235",
"\312\364\325do \225\347\300\303\243\231\227\205\320 \312\301\271o sm\215l\012",
"\312(\203do \225\347\300\012",
"\306l\205\200\316t\205u\320\012",
"\306r\213g\356",
"\306subscript\303\242\200\042[ ]\360\355\230\222\203\330\313j\243\340\233\226\202\263",
"m\315\207-\340\233\226\202\367\257y\203\307\324f\315l\224\205i\207\215iz\314\012",
"\250ce\314\205\264\313ximum nu\236\267\322\340\233\226\202\263",
"\223\347\300\232\341os\205\264b\240c\200(\042}\042\235",
"\227\206\201\322\304bod\224\352\237ou\201\304head\211\012",
"\257ys\303loc\367\332\325\374\304\270t\203\262\324pu\244ic (\332\346\235",
"\223\272ish\232\250\327\274\330be\375\200\323mpil\267\340\217c\207v\356",
"duplic\230\200\270t; sam\200\337\301p\343s\232t\352c\356",
"\304\337\313\224\225\361\252\231fa\315\201\251u\200(\332\346\235",
"m\315\207p\353\042#\372se\360\340\217c\207v\325betwe\214 \042#if ... #\214\340f\042\012",
"\042#\372seif\360\340\217c\207\333f\247low\203\366\042#\372se\360\340\217c\207v\356",
"nu\236\267\322\355\213d\203do\325\225\336\201\237\200\355\230\222\012",
"\304\217s\315\201\351\264\322\355\230\222\234 \307\324\221\012",
"\262\300\213g\200\327\335\232\355\230\222\263",
"\304\337\313\224\202l\224\361\252s\205g\353\351\264(\337%d\235",
"\304\337\313\224\225\324\252\217f\211\214c\200\337\243\366\312(\337\221\235",
"\332\200\262\324bo\237 \252\217f\211\214c\200\374\366\312(\332\346\235",
"\306\240\216\367nu\236\267\327ci\226\330\376#p\240g\313\012",
"\240\216\367nu\236\267\375\313\201\215\217ad\224\335\314\012",
"\240\216\367nu\236\267supp\222\201w\354\225\214\305\314\012",
"\242\211-\335\232\355\230\243\307\324\231\341\206\232be\375\200\242\200(\246\234\235",
"\042\364e\277\360\355\230\243\301\306\330\042\246\360\260\263",
"\304\337\307\324\366\312(\337\221\235",
"#\335\200p\230t\211\334\307\227\206\201\352\237 \366\215p\275be\207c \300\206a\311\211\012",
"\205pu\201l\205\200\271o l\202\264(aft\267subs\207tu\216s\235",
"\253n\351x \211r\243\376\237\200\250\327\274\202\303\243\306\304c\215l\012",
"m\215\375m\232UTF-8 \214\323d\205g\303\243c\222rupt\232\336le: \344",
"\304\242\325bo\237 \042\217turn\360\374\042\217tur\334<\251ue>\042\012",
"\205\316\226\227\214\201\217tur\334\370\203(\312& n\202-\257y\235",
"\223k\212w\334\260\303\243\225\252\365\213\201\260 \362",
"\262\351k\200\252\351\264\354\252\231fa\315\201\251u\200f\243\366\205\231x\232\312p\206a\310t\267\362",
"\242\211-\335\232\355\230\222\203\374\371\207\333\246\203\313\224\225\361\350e\263",
"\252\304\243\332\200\313\224\202l\224b\372\202\264\271 \252s\205g\353au\271\347\330\362",
"\350\200\316fli\311: \202\200\322\237\200\350\325\301\215\217ad\224a\274gn\232\271 a\212\237\267imple\233t\320 \362",
"\212 \350\325\206\200\335\232f\243\321\012",
"\223k\212w\334au\271\347\202\345",
"\223k\212w\334\350\346 f\243au\271\347\202\345",
"pu\244ic \332\325\374loc\367\332\325\313\224\225\361\350\325\362",
"\350\200\332\325\313\224\225\324\205i\207\215iz\232\362",
"pu\244ic \246\203\313\224\225\217tur\334\257y\203\362",
"a\236i\265ou\203\365\213t; \351\264ov\211rid\200\301\217qui\217\204\362",
"nu\236\267\322\270t\203do\325\225\347\300 \335i\216\012",
"\250\261\311\232\351\264\371m\200id\214\207\336\211\012",
"\304\214um\211\320 \217qui\217\203\223iqu\200\351g\012",
"\262\361\217qui\217\204p\206a\310t\211\203aft\267\342\216\367p\206a\310t\211\263",
"\323\315\204\225\272\204\310\236\211\234 \376\227ruc\201\221\012",
"\321 do\325\225\361\252\347\300\205\264\370\012",
"\363\346 sho\315\204\324\221 \376new-\227y\353\231\341\206\320\263",
"\317sho\315\204\225\361\366\250plici\201\217tur\334\370\012",
"\304pro\271\370\203do \225\347\300\012",
"s\261cif\224ei\237\267\215l \340\233\226\202\203\243\202l\224\237\200l\343\201\340\233\226\202\012",
"\262\272\204\317\344",
"\317w\354\215\217ad\224\335\232\330\237\301\344",
"\262\272\204\213\224\310\237od\203f\243\344",
"\262\272\204\310\237o\204\243pr\355t\224\210.\344",
"\262c\215l \310\237od\203\330\366\257y\012",
"\262c\215l \310\237od\203\330\252\246\012",
"\310\237o\204\307\361\252\336rs\201\337\323mpa\207\244\200\352\237 \237\200\317\373(\210\235",
"\317\371m\200\307\227\206\201\352\237 \366upp\211c\343\200lett\211\012",
"\317\275\203\215\217ad\224be\214 \335\232(\327vio\242l\224se\214 \354\210\235",
"\250\261\311\232id\214\207\336\267- d\273you \375ge\201\252\370?\012",
"\365ru\311\243\304\307\217tur\334\351\264\344",
"\262\335\200\365ru\311\243\375\234; \215\217ad\224\250i\227\203\354\252\344",
"miss\205\264\370\303\243\317\307\361\237\200sam\200\371m\200\354\317\221\012",
"\262\242\200\231lete\303\317\317\275\203\212 \231\227ru\311\222\012",
"\212 \310\237od\313p \243\341\343\203w\354fo\223\204f\243\344",
"\212 \231\227ru\311\243w\354fo\223\204f\243\317\344",
"\231\227ru\311\222\203\307\324\371\207\333\246\263",
"\231\227ru\311\222\203\262\361\250t\240 \270t\263",
"\310\237od\313p \374\341\343\203\226gn\230u\217\203\307\242\200new-\227y\353\373\231\341\206\320\263",
"\262s\261cif\224\312\340\233\226\202\203\330bo\237 \373\374\371\310\012",
"\250\261\311\232\373\250\327\274\202\012",
"f\315ly-qu\215i\336\232\371m\346 \301\271o l\202g\303wo\315\204\324tr\241\230\232\271\345",
"\223\250\261\311\232\271k\214\303\250\261\311\232\310\237o\204\243pr\355\254\012",
"\250\261\311\232\042\371\207ve\360\243\042get\042\012",
"\317f\243\317\215\217ad\224\250i\227\263",
"pr\355t\224gett\211\203\262accep\201\250t\240 \270t\263",
"\317\307\361\237\200sam\200\217tur\334\373\354pr\355t\224\317(\210\235",
"\262mix \310\237od\313p\203\374\341\343s\325\352\237 \205h\211it\213c\356",
"\262\323\211c\200\246\203\271 \251ue\263",
"\262\323\211c\200objec\201\373\317\271 n\202-objec\201\373\344",
"\262\323\211c\200n\202-objec\201\373\317\271 objec\201\373\344",
"\262\323\211c\200\223\217l\230\232objec\201\370\203\317\374\344",
"\373mis\347\300 (\317\374\210\235",
"\262\242\200\366objec\201\376\252m\315\207-\351\264s\372e\311\222\012",
"\257y\203\206\200\225supp\222t\232\354\217tur\334\370\263",
"\262mix \217f\211\214c\200\374\312\370\263",
"\316s\201w\354s\261ci\336\232t\352c\356",
"\323\315\204\225\272\204\363\346\012",
"new-\227y\353\312\370\203\262s\261cif\224\340\233\226\330\364\325\354p\206\201\322\237eir \370\012",
"\371\207ves\303\375w\206ds\303\374pu\244ic \246\203\262\217tur\334\257y\263",
"\306\373\231\341\206\320\012",
"new-\227y\353\231\341\206\320\203sho\315\204\225\361\042new\042\012"
#endif
};
@ -348,18 +357,18 @@ static char *fatalmsg[] = {
/*170*/ "assertion failed: %s\n",
/*171*/ "user error: %s\n",
#else
"\263\221a\204from \335le:\344",
"\263writ\200\271 \335le:\344",
"t\276\200ov\211flow:\344",
"\205suf\335ci\214\201\305m\222y\012",
"\310\342se\236l\267\205\230ruc\216\344",
"num\211ic ov\211flow\317\250ce\312\375capaci\261\012",
"\321mpil\231scrip\201\250ce\312\203\237\200\311ximum \305m\222\224\367\200(%l\204bytes\235",
"\271o m\213\224\211r\242\305ssag\331\332\202\200l\205\353",
"\321\232pag\200\311pp\375\335\370\225fo\223d\012",
"\310p\226h:\344",
"\342s\211\244fail\312: \343",
"\241\267\211r\222: \343"
"\262\217a\204from \336le:\345",
"\262writ\200\271 \336le:\345",
"t\305\200ov\211flow:\345",
"\205suf\336ci\214\201\310m\222y\012",
"\306\343se\236l\267\205\227ruc\216\345",
"num\211ic ov\211flow\303\250ce\314\205\264capaci\254\012",
"\323mpil\232scrip\201\250ce\314\203\237\200\313ximum \310m\222\224\364\200(%l\204bytes\235",
"\271o m\213\224\211r\243\310ssag\325\330\202\200l\205\356",
"\323\231pag\200\313pp\205\264\336\353\225fo\223d\012",
"\306p\230h:\345",
"\343s\211\216 fail\314: \344",
"\242\267\211r\222: \344"
#endif
};
@ -403,43 +412,43 @@ static char *warnmsg[] = {
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
#else
"\316 \277tr\243\226\231\271 %\204\274\334\307\211\262",
"\221\333i\244\325\361\213t/\311cro \356",
"nu\236\267\325\270t\203do\331\225\376 \333i\216\012",
"\255 \277nev\267\241\312:\344",
"\255 \277a\273gn\231\252\251u\200\237a\201\277nev\267\241\312:\344",
"\221d\223d\213\201\321\232: \361\213\201\250\324\273\332\277z\211o\012",
"\221d\223d\213\201te\230: \361\213\201\250\324\273\332\277n\202-z\211o\012",
"\223k\212w\340#p\240g\311\012",
"\301\351\373\374\221s\320\201\241\231bef\222\200\333i\216\317f\222c\375\221p\206s\353",
"\371\234 sho\320\204\221tur\340\252\251u\353",
"po\273\245\200\241\200\325\255 bef\222\200\205i\207\215iza\216:\344",
"po\273\245\224\223\205t\214d\231a\273gn\233t\012",
"po\273\245\224\223\205t\214d\231bit\351s\200\352a\216\012",
"\374mis\376\012",
"po\273\245\224\252\042\361\355\315\337w\360\205t\214\232d:\344",
"\250\324\273\332\304\203\212 effe\307\012",
"ne\230\231\321m\233t\012",
"loos\200\205d\214\330\216\012",
"\247\204\230y\370pro\271\261\264\203\241\231\351\373\341\216\363semic\247umn\262",
"loc\363\327\345 s\304dow\203\252\327\200a\201\252\324c\312\375lev\365\012",
"\250\324\273\332\351\373\374ov\211rid\200\303ap\264\206 betwe\214 p\206\214\237ese\262",
"lab\365 nam\345 s\304dow\203\374na\305\012",
"nu\236\267\325\350git\203\250ce\312\203\240\216\363nu\236\267\324ci\227\202\012",
"\221d\223d\213\201\042\367e\306\042: \337\367\200\277\215way\2031 \356",
"\205\232t\211m\205\226\200\315\367\200\372\042\367e\306\355\250\324\273\332\356",
"\223\221a\274\276\200\321\232\012",
"\252\327\200\277a\273gn\231\271 its\365f \356",
"m\222\200\205i\207\215iz\211\203\237\362\214um \335\365d\262",
"l\214g\373\325\205i\207\215iz\267\250ce\312\203\367\200\325\237\200\214um \335\365d\012",
"\205\232x \374mis\376 \356",
"\212 imple\233\330\244f\242\346\345 \372\371\234\317\212 f\215l-back\012",
"\346\200s\264ci\335ca\244\332f\222w\206\204\232\357\334\244\277ig\212\221d\012",
"outpu\201\335\370\277writt\214\317bu\201\351\373\321mpac\201\214\321d\375\350s\276\312\012",
"\346\200\327\345 s\304dow\203\252glob\363\327\353",
"\316 \277m\206k\231\360\232\324c\226\312: \343",
"pu\245ic \301lack\203f\222w\206\204\232\357\334\244\356",
"\223k\212w\340p\334\305t\267\372subs\207tu\244(\205c\222\221c\201#\333\200p\226t\211n\235"
"\321 \301tr\241\230\232\271 %\204\300\206a\311\211\263",
"\217\335i\216 \322\365\213t/\313cro \362",
"nu\236\267\322\270t\203do\325\225\347\300 \335i\216\012",
"\260 \301nev\267\242\314:\345",
"\260 \301a\274gn\232\252\251u\200\237a\201\301nev\267\242\314:\345",
"\217d\223d\213\201\323\231: \365\213\201\250\327\274\330\301z\211o\012",
"\217d\223d\213\201te\227: \365\213\201\250\327\274\330\301n\202-z\211o\012",
"\223k\212w\334#p\240g\313\012",
"\304\352\237 \351\264\217s\315\201\242\232be\375\200\335i\216\303\375c\205\264\217p\206s\356",
"\246\234 sho\315\204\217tur\334\252\251u\356",
"po\274\244\200\242\200\322\260 be\375\200\205i\207\215iz\320:\345",
"po\274\244\224\223\205t\214\231\204a\274gn\233t\012",
"po\274\244\224\223\205t\214\231\204bit\352s\200\355\320\012",
"\351\264mis\347\300\012",
"po\274\244\224\252\042\365\360\312\337w\354\205t\214\231d:\345",
"\250\327\274\330\275\203\212 effe\311\012",
"ne\227\232\323m\233t\012",
"loos\200\205d\214t\320\012",
"\247\204\227y\353pro\271\370\203\242\232\352\237 \342\216\367semic\247umn\263",
"loc\367\332\346 s\275dow\203\252\332\200a\201\252\327c\314\205\264lev\372\012",
"\250\327\274\330\352\237 \351\264ov\211rid\200\307ap\261\206 betwe\214 p\206\214\237ese\263",
"lab\372 \371m\346 s\275dow\203\351\264\371\310\012",
"nu\236\267\322\340git\203\250ce\314\203\240\216\367nu\236\267\327ci\226\202\012",
"\217d\223d\213\201\042\364e\277\042: \337\364\200\301\215way\2031 \362",
"\205\231t\211m\205\230\200\312\364\200\376\042\364e\277\360\250\327\274\330\362",
"\223\217ac\275\244\200\323\231\012",
"\252\332\200\301a\274gn\232\271 its\372f \362",
"m\222\200\205i\207\215iz\211\203\237\366\214um \336\372d\263",
"l\214g\237 \322\205i\207\215iz\267\250ce\314\203\364\200\322\237\200\214um \336\372d\012",
"\205\231x \351\264mis\347\300 \362",
"\212 imple\233t\320 f\243\350\346 \376\246\234\303\212 f\215l-back\012",
"\350\200s\261ci\336c\320 \330\375w\206\204\231\341\206\320 \301ig\212\217d\012",
"outpu\201\336\353\301writt\214\303bu\201\352\237 \323mpac\201\214\323d\205\264\340s\305\314\012",
"\350\200\332\346 s\275dow\203\252glob\367\332\356",
"\321 \301m\206k\232\354\231\327c\230\314: \344",
"pu\244ic \304lack\203\375w\206\204\231\341\206\320 \362",
"\223k\212w\334p\206a\310t\267\376subs\207tu\216 (\205c\222\217c\201#\335\200p\230t\211n\235"
#endif
};

View File

@ -0,0 +1,13 @@
void[] Bad1()
{
}
void Bad2;
stock Bad3(void x)
{
}
public main()
{
}

View File

@ -0,0 +1,3 @@
(1) : error 145: invalid type expression
(5) : error 144: void cannot be used as a variable type
(7) : error 144: void cannot be used as a variable type

View File

@ -0,0 +1,13 @@
native int[] egg6();
forward float[] egg7();
new void crab4;
int[] yam1 = {1,2,3}, yam2[] = {3,4,5};
forward void OnPluginStart();
public int OnPluginStart()
{
}

View File

@ -0,0 +1,5 @@
(1) : error 141: natives, forwards, and public functions cannot return arrays
(2) : error 141: natives, forwards, and public functions cannot return arrays
(3) : error 143: new-style declarations should not have "new"
(4) : error 121: cannot specify array dimensions on both type and name
(6) : error 025: function heading differs from prototype

View File

@ -0,0 +1,55 @@
native egg();
native void egg2();
native int egg3();
native bool egg4();
native bool:egg5();
new crab;
new crab2 = 5;
bool crab3 = true;
int crab4 = 6;
new crab5[] = {1, 2, 3};
bool[] crab6 = {true, false, false, true}
bool crab7[] = {false, true, true}
char crab8[] = "hello"
char[] crab9 = "bye"
native float operator*(float oper1, float oper2) = FloatMul;
forward void OnPluginStart();
public int Crab()
{
}
public float Crab2()
{
}
public Crab3()
{
}
stock char[] Crab4()
{
new String:t[5] = "egg";
return t;
}
new yam, yam2, yam3
new Float:ham, bool:ham2;
int cram, cram2, cram3;
new cram4[] = {1, 2}, cram5[] = {3, 4, 7}
int cram6[] = {1, 2}, cram7[] = {3, 4, 7}
int[] cram8 = {3, 4}, cram9 = {4, 8, 10}
public OnPluginStart()
{
new String:t[5];
t = Crab4();
cram4[0] = 2
cram5[2] = 2
cram7[2] = 2
cram8[1] = 5
cram9[2] = 5
}