Merge branch 'master' into noms

This commit is contained in:
David Anderson 2014-07-06 23:42:41 -07:00
commit 27d5ce45f5
12 changed files with 697 additions and 378 deletions

View File

@ -73,7 +73,9 @@ class SMConfig(object):
self.versionlib = None
def use_auto_versioning(self):
return builder.backend == 'amb2' and not builder.options.disable_auto_versioning
if builder.backend != 'amb2':
return False
return not getattr(builder.options, 'disable_auto_versioning', False)
@property
def tag(self):

View File

@ -1170,6 +1170,12 @@ const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
if (offset == -1)
{
CBaseEntity *pGetterEnt = ReferenceToEntity(0);
if (pGetterEnt == NULL)
{
// If we don't have a world entity yet, we'll have to rely on the given entity
pGetterEnt = pEntity;
}
datamap_t *pMap = GetDataMap(pGetterEnt);
sm_datatable_info_t info;

View File

@ -78,7 +78,7 @@ native Handle:CloneHandle(Handle:hndl, Handle:plugin=INVALID_HANDLE);
/**
* Helper for object-oriented syntax.
*/
methodmap Handle
methodmap Handle __nullable__
{
public Clone() = CloneHandle;
public ~Handle() = CloseHandle;

View File

@ -254,12 +254,12 @@ native TF2_SetPlayerPowerPlay(client, bool:enabled);
*
* @param client Player's index.
* @param team Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
* @param class TFClassType class to disguise the player as
* @param classType TFClassType class to disguise the player as
* @param target Specific target player to disguise as (0 for any)
* @noreturn
* @error Invalid client index, client not in game, or no mod support.
*/
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class, target=0);
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:classType, target=0);
/**
* Removes the current disguise from a client. Only has an effect on spies.

View File

@ -335,19 +335,19 @@ stock TFClassType:TF2_GetPlayerClass(client)
* Note: If setting player class in a player spawn hook weapons should be set to false.
*
* @param client Player's index.
* @param class TFClassType class symbol.
* @param classType TFClassType class symbol.
* @param weapons This paramater is ignored.
* @param persistent If true changes the players desired class so the change stays after death.
* @noreturn
* @error Invalid client index.
*/
stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true, bool:persistent=true)
stock TF2_SetPlayerClass(client, TFClassType:classType, bool:weapons=true, bool:persistent=true)
{
SetEntProp(client, Prop_Send, "m_iClass", _:class);
SetEntProp(client, Prop_Send, "m_iClass", _:classType);
if (persistent)
{
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:classType);
}
}

View File

@ -171,6 +171,7 @@ typedef struct s_symbol {
#define iREFFUNC 10
#define iVARARGS 11 /* function specified ... as argument(s) */
#define iPROXY 12 /* proxies to another symbol. */
#define iACCESSOR 13 /* property accessor via a methodmap_method_t */
/* Possible entries for "usage"
*
@ -240,6 +241,8 @@ typedef struct s_symbol {
#define sSTATEVAR 3 /* criterion to find variables (sSTATEVAR implies a global variable) */
struct methodmap_method_s;
typedef struct value_s {
symbol *sym; /* symbol in symbol table, NULL for (constant) expression */
cell constval; /* value of the constant expression (if ident==iCONSTEXPR)
@ -250,6 +253,9 @@ typedef struct value_s {
* iEXPRESSION or iREFERENCE */
char boolresult; /* boolean result for relational operators */
cell *arrayidx; /* last used array indices, for checking self assignment */
/* when ident == iACCESSOR */
struct methodmap_method_s *accessor;
} value;
/* Wrapper around value + l/rvalue bit. */
@ -411,6 +417,8 @@ enum {
tMETHODMAP,
tNATIVE,
tNEW,
tNULL,
tNULLABLE,
tOBJECT,
tOPERATOR,
tPUBLIC,
@ -675,6 +683,7 @@ SC_FUNC cell array_totalsize(symbol *sym);
SC_FUNC int matchtag_string(int ident, int tag);
SC_FUNC int checktag_string(value *sym1, value *sym2);
SC_FUNC int checktags_string(int tags[], int numtags, value *sym1);
SC_FUNC int lvalexpr(svalue *sval);
/* function prototypes in SC4.C */
SC_FUNC void writeleader(symbol *root);
@ -699,6 +708,7 @@ SC_FUNC void copyarray(symbol *sym,cell size);
SC_FUNC void fillarray(symbol *sym,cell size,cell value);
SC_FUNC void ldconst(cell val,regid reg);
SC_FUNC void moveto1(void);
SC_FUNC void move_alt(void);
SC_FUNC void pushreg(regid reg);
SC_FUNC void pushval(cell val);
SC_FUNC void popreg(regid reg);
@ -726,6 +736,10 @@ SC_FUNC void charalign(void);
SC_FUNC void addconst(cell value);
SC_FUNC void setheap_save(cell value);
SC_FUNC void stradjust(regid reg);
SC_FUNC void invoke_getter(struct methodmap_method_s *method);
SC_FUNC void invoke_setter(struct methodmap_method_s *method, int save);
SC_FUNC void inc_pri();
SC_FUNC void dec_pri();
/* Code generation functions for arithmetic operators.
*
@ -923,6 +937,7 @@ SC_VDECL int pc_tag_string; /* global String tag */
SC_VDECL int pc_tag_void; /* global void tag */
SC_VDECL int pc_tag_object; /* root object tag */
SC_VDECL int pc_tag_bool; /* global bool tag */
SC_VDECL int pc_tag_null_t; /* the null type */
SC_VDECL int pc_anytag; /* global any tag */
SC_VDECL int glbstringread; /* last global string read */
SC_VDECL int sc_require_newdecls; /* only newdecls are allowed */

View File

@ -79,6 +79,7 @@ int pc_tag_string = 0;
int pc_tag_void = 0;
int pc_tag_object = 0;
int pc_tag_bool = 0;
int pc_tag_null_t = 0;
static void resetglobals(void);
static void initglobals(void);
@ -1349,6 +1350,7 @@ static void setconstants(void)
pc_tag_void = pc_addtag_flags("void", FIXEDTAG);
pc_tag_object = pc_addtag_flags("object", FIXEDTAG|OBJECTTAG);
pc_tag_bool = pc_addtag("bool");
pc_tag_null_t = pc_addtag_flags("null_t", FIXEDTAG|OBJECTTAG);
add_constant("true",1,sGLOBAL,1); /* boolean flags */
add_constant("false",0,sGLOBAL,1);
@ -3442,7 +3444,7 @@ int parse_decl(declinfo_t *decl, int flags)
// Otherwise, we have to eat a symbol to tell.
if (matchsymbol(&ident)) {
if (lexpeek(tSYMBOL) || lexpeek(tOPERATOR)) {
if (lexpeek(tSYMBOL) || lexpeek(tOPERATOR) || lexpeek('&')) {
// A new-style declaration only allows array dims or a symbol name, so
// this is a new-style declaration.
return parse_new_decl(decl, &ident.tok, flags);
@ -3663,9 +3665,10 @@ int parse_property_accessor(const typeinfo_t *type, methodmap_t *map, methodmap_
return FALSE;
}
int getter = TRUE;
int getter = (strcmp(ident.name, "get") == 0);
int setter = (strcmp(ident.name, "set") == 0);
if (strcmp(ident.name, "get") != 0) {
if (!getter && !setter) {
error(125);
return FALSE;
}
@ -3687,19 +3690,36 @@ int parse_property_accessor(const typeinfo_t *type, methodmap_t *map, methodmap_
else if (target->ident != iFUNCTN)
error(10);
} else {
typeinfo_t voidtype;
char tmpname[METHOD_NAMEMAX + 1];
strcpy(tmpname, method->name);
if (getter)
strcat(tmpname, ".get");
target = parse_inline_function(map, type, tmpname, is_native, FALSE, FALSE);
else
strcat(tmpname, ".set");
const typeinfo_t *ret_type;
if (getter) {
ret_type = type;
} else {
make_primitive(&voidtype, pc_tag_void);
ret_type = &voidtype;
}
target = parse_inline_function(map, ret_type, tmpname, is_native, FALSE, FALSE);
}
if (!target)
return FALSE;
if (method->getter) {
if (getter && method->getter) {
error(126, "getter", method->name);
return FALSE;
}
if (setter && method->setter) {
error(126, "setter", method->name);
return FALSE;
}
if (getter) {
method->getter = target;
@ -3707,6 +3727,10 @@ int parse_property_accessor(const typeinfo_t *type, methodmap_t *map, methodmap_
// Cannot have extra arguments.
if (target->dim.arglist[0].ident && target->dim.arglist[1].ident)
error(127);
if (!check_this_tag(map, target)) {
error(108, layout_spec_name(map->spec), map->name);
return FALSE;
}
// Must return the same tag as the property.
@ -3714,12 +3738,34 @@ int parse_property_accessor(const typeinfo_t *type, methodmap_t *map, methodmap_
const char *kind = getter ? "getter" : "setter";
error(128, "getter", map->name, type_to_name(type->tag));
}
} else {
method->setter = target;
if (!check_this_tag(map, target)) {
error(108, layout_spec_name(map->spec), map->name);
return FALSE;
}
// Must have one extra argument taking the return type.
arginfo *arg = &target->dim.arglist[1];
if (arg->ident == 0 ||
arg->ident != iVARIABLE ||
arg->hasdefault ||
arg->numtags != 1 ||
arg->tags[0] != type->tag)
{
error(150, pc_tagname(type->tag));
return FALSE;
}
if (target->dim.arglist[2].ident) {
error(150, pc_tagname(type->tag));
return FALSE;
}
if (target->tag != pc_tag_void)
error(151);
}
needtoken(tTERM);
return TRUE;
}
@ -3747,10 +3793,8 @@ methodmap_method_t *parse_property(methodmap_t *map)
return method;
while (!matchtoken('}')) {
if (!parse_property_accessor(&type, map,method)) {
if (!consume_line())
return NULL;
}
if (!parse_property_accessor(&type, map,method))
lexclr(TRUE);
}
needtoken(tTERM);
@ -3973,6 +4017,9 @@ static void domethodmap(LayoutSpec spec)
strcpy(map->name, mapname);
if (spec == Layout_MethodMap) {
map->tag = pc_addtag_flags(mapname, FIXEDTAG | METHODMAPTAG);
if (matchtoken(tNULLABLE))
map->nullable = TRUE;
} else {
constvalue *tagptr = pc_tagptr(mapname);
if (!tagptr) {
@ -4032,35 +4079,48 @@ static void domethodmap(LayoutSpec spec)
// delete ::= "delete" expr
static void dodelete()
{
int tag;
symbol *sym;
svalue sval;
int ident = doexpr(TRUE, FALSE, TRUE, FALSE, &tag, &sym, TRUE);
int lcl_staging = FALSE;
if (!staging) {
stgset(TRUE);
lcl_staging = TRUE;
assert(stgidx == 0);
}
int lcl_stgidx = stgidx;
int ident = lvalexpr(&sval);
needtoken(tTERM);
switch (ident) {
case iFUNCTN:
case iREFFUNC:
error(115, "functions");
return;
goto cleanup;
case iARRAY:
case iREFARRAY:
case iARRAYCELL:
case iARRAYCHAR:
{
symbol *sym = sval.val.sym;
if (!sym || sym->dim.array.level > 0) {
error(115, "arrays");
return;
goto cleanup;
}
break;
}
}
if (tag == 0) {
if (sval.val.tag == 0) {
error(115, "primitive types or enums");
return;
goto cleanup;
}
methodmap_t *map = methodmap_find_by_tag(tag);
methodmap_t *map = methodmap_find_by_tag(sval.val.tag);
if (!map) {
error(115, pc_tagname(tag));
return;
error(115, pc_tagname(sval.val.tag));
goto cleanup;
}
{
@ -4076,24 +4136,70 @@ static void dodelete()
if (!map || !map->dtor) {
error(115, layout_spec_name(map->spec), map->name);
return;
goto cleanup;
}
// Only zap non-const lvalues.
int zap = sval.lvalue;
if (zap && sval.val.sym && (sval.val.sym->usage & uCONST))
zap = FALSE;
int popaddr = FALSE;
methodmap_method_t *accessor = NULL;
if (sval.lvalue) {
if (zap) {
switch (sval.val.ident) {
case iACCESSOR:
// rvalue() removes iACCESSOR so we store it locally.
accessor = sval.val.accessor;
if (!accessor->setter) {
zap = FALSE;
break;
}
pushreg(sPRI);
popaddr = TRUE;
break;
case iARRAYCELL:
case iARRAYCHAR:
pushreg(sPRI);
popaddr = TRUE;
break;
}
}
rvalue(&sval.val);
}
// For some reason, we don't get a sysreq.n once this passes through the
// peephole optimizer. I can't tell why. -dvander
//
// push.pri
// push.c 1
// sysreq.c N 1
// stack 8
pushreg(sPRI);
markexpr(sPARM,NULL,0);
{
pushval(1);
ffcall(map->dtor->target, NULL, 1);
markusage(map->dtor->target, uREAD);
}
if (zap) {
if (popaddr)
popreg(sALT);
// Store 0 back.
ldconst(0, sPRI);
if (accessor)
invoke_setter(accessor, FALSE);
else
store(&sval.val);
}
markexpr(sEXPR, NULL, 0);
cleanup:
if (lcl_staging) {
stgout(lcl_stgidx);
stgset(FALSE);
}
}
/**
@ -4113,20 +4219,44 @@ static void dofuncenum(int listmode)
/* get the explicit tag (required!) */
int l = lex(&val,&str);
if (l != tSYMBOL)
{
if (listmode == FALSE && l == tPUBLIC)
{
isNewStyle = 1;
newStyleTag = pc_addtag(NULL);
l = lex(&val, &str);
if (l != tSYMBOL)
{
if (l != tSYMBOL) {
if (listmode == FALSE && l == tPUBLIC) {
isNewStyle = TRUE;
switch (lex(&val, &str)) {
case tOBJECT:
newStyleTag = pc_tag_object;
break;
case tINT:
newStyleTag = 0;
break;
case tVOID:
newStyleTag = pc_tag_void;
break;
case tCHAR:
newStyleTag = pc_tag_string;
break;
case tLABEL:
newStyleTag = pc_addtag(str);
break;
case tSYMBOL:
// Check whether this is new-style declaration.
// we'll port this all to parse_decl() sometime.
if (lexpeek('('))
lexpush();
else
newStyleTag = pc_addtag(str);
break;
default:
error(93);
}
if (!needtoken(tSYMBOL)) {
lexclr(TRUE);
litidx = 0;
return;
}
else
{
l = tokeninfo(&val, &str);
} else {
error(93);
}
}
@ -5311,17 +5441,22 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
fpublic = (sym->usage & (uPUBLIC|uSTOCK))!=0;
if (thistag && *thistag != -1) {
arginfo *argptr;
if ((sym->usage & uPROTOTYPED) == 0) {
// 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];
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;
} else {
argptr = &sym->dim.arglist[0];
}
symbol *sym = addvariable2(
argptr->name,
@ -5379,7 +5514,6 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
if (decl.name[0] == PUBLIC_CHAR)
error(56,name); /* function arguments cannot be public */
if (1) {
if (decl.type.ident == iARRAY)
decl.type.ident = iREFARRAY;
/* Stack layout:
@ -5414,7 +5548,6 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
free(arg.tags);
} /* if */
argcnt++;
}
} while (matchtoken(','));
/* if the next token is not ",", it should be ")" */
needtoken(')');

View File

@ -1956,7 +1956,7 @@ char *sc_tokens[] = {
"goto",
"if", "int",
"methodmap",
"native", "new",
"native", "new", "null", "__nullable__",
"object", "operator",
"public",
"return",
@ -2752,6 +2752,7 @@ SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_
case iARRAYCHAR:
case iEXPRESSION:
case iVARARGS:
case iACCESSOR:
default:
assert(0);
break;

View File

@ -356,6 +356,23 @@ static int matchobjecttags(int formaltag, int actualtag, int flags)
// objects never coerce to non-objects, YET.
if ((formaltag & OBJECTTAG) && !(actualtag & OBJECTTAG))
return obj_typeerror(132, formaltag, actualtag);
if (actualtag == pc_tag_null_t) {
// All objects are nullable.
if (formaltag & OBJECTTAG)
return TRUE;
// Some methodmaps are nullable.
methodmap_t *map = methodmap_find_by_tag(formaltag);
for (; map; map = map->parent) {
if (map->nullable)
return TRUE;
}
error(148, pc_tagname(formaltag));
return FALSE;
}
if (!(formaltag & OBJECTTAG) && (actualtag & OBJECTTAG))
return obj_typeerror(131, formaltag, actualtag);
@ -375,6 +392,15 @@ static int matchobjecttags(int formaltag, int actualtag, int flags)
return obj_typeerror(133, formaltag, actualtag);
}
static int matchreturntag(functag_t *t, symbol *sym)
{
if (t->ret_tag == sym->tag)
return TRUE;
if (t->ret_tag == pc_tag_void && (sym->tag == 0 && !(sym->usage & uRETVALUE)))
return TRUE;
return FALSE;
}
static int matchfunctags(int formaltag, int actualtag)
{
if (actualtag == pc_functag || (formaltag == pc_functag && actualtag & FUNCTAG))
@ -447,7 +473,7 @@ static int matchfunctags(int formaltag, int actualtag)
arginfo *func_arg;
funcarg_t *enum_arg;
/* Check return type first. */
if (t->ret_tag != sym->tag) {
if (!matchreturntag(t, sym)) {
t = t->next;
continue;
}
@ -496,7 +522,7 @@ static int matchfunctags(int formaltag, int actualtag)
}
/* They should all be in the same order just for clarity... */
for (i=0; i<enum_arg->tagcount; i++) {
if (enum_arg->tags[i] != func_arg->tags[i]) {
if (!matchtag(func_arg->tags[i], enum_arg->tags[i], MATCHTAG_SILENT|MATCHTAG_COERCE)) {
skip = 1;
break;
}
@ -954,6 +980,19 @@ static cell calc(cell left,void (*oper)(),cell right,char *boolresult)
return 0;
}
SC_FUNC int lvalexpr(svalue *sval)
{
memset(sval, 0, sizeof(*sval));
errorset(sEXPRMARK, 0);
pushheaplist();
sval->lvalue = hier14(&sval->val);
popheaplist();
errorset(sEXPRRELEASE, 0);
return sval->val.ident;
}
SC_FUNC int expression(cell *val,int *tag,symbol **symptr,int chkfuncresult,value *_lval)
{
value lval={0};
@ -1161,8 +1200,8 @@ static int hier14(value *lval1)
if (!lvalue)
return error(22); /* must be lvalue */
/* may not change "constant" parameters */
assert(lval1->sym!=NULL);
if ((lval1->sym->usage & uCONST)!=0)
assert(lval1->sym || lval1->accessor);
if (lval1->sym && (lval1->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */
sc_allowproccall=FALSE; /* may no longer use "procedure call" syntax */
@ -1192,6 +1231,19 @@ static int hier14(value *lval1)
if (same)
error(226,lval3.sym->name); /* self-assignment */
} /* if */
} else if (lval1->ident == iACCESSOR) {
pushreg(sPRI);
if (oper) {
rvalue(lval1);
plnge2(oper,hier14,lval1,&lval2);
} else {
if (hier14(&lval2))
rvalue(&lval2); /* instead of plnge2(). */
else if (lval2.ident==iVARIABLE)
lval2.ident=iEXPRESSION;/* mark as "rvalue" if it is not an "lvalue" */
checkfunction(&lval2);
}
popreg(sALT);
} else {
if (oper){
rvalue(lval1);
@ -1504,23 +1556,43 @@ static int hier2(value *lval)
case tINC: /* ++lval */
if (!hier2(lval))
return error(22); /* must be lvalue */
if (lval->ident != iACCESSOR) {
assert(lval->sym!=NULL);
if ((lval->sym->usage & uCONST)!=0)
return error(22); /* assignment to const argument */
if (!check_userop(user_inc,lval->tag,0,1,lval,&lval->tag))
inc(lval); /* increase variable first */
rvalue(lval); /* and read the result into PRI */
} else {
pushreg(sPRI);
invoke_getter(lval->accessor);
if (!check_userop(user_inc,lval->tag,0,1,lval,&lval->tag))
inc_pri();
popreg(sALT);
invoke_setter(lval->accessor, TRUE);
lval->ident = iEXPRESSION;
}
sideeffect=TRUE;
return FALSE; /* result is no longer lvalue */
case tDEC: /* --lval */
if (!hier2(lval))
return error(22); /* must be lvalue */
if (lval->ident != iACCESSOR) {
assert(lval->sym!=NULL);
if ((lval->sym->usage & uCONST)!=0)
return error(22); /* assignment to const argument */
if (!check_userop(user_dec,lval->tag,0,1,lval,&lval->tag))
dec(lval); /* decrease variable first */
rvalue(lval); /* and read the result into PRI */
} else {
pushreg(sPRI);
invoke_getter(lval->accessor);
if (!check_userop(user_dec,lval->tag,0,1,lval,&lval->tag))
dec_pri();
popreg(sALT);
invoke_setter(lval->accessor, TRUE);
lval->ident = iEXPRESSION;
}
sideeffect=TRUE;
return FALSE; /* result is no longer lvalue */
case '~': /* ~ (one's complement) */
@ -1781,6 +1853,7 @@ static int hier2(value *lval)
case tINC: /* lval++ */
if (!lvalue)
return error(22); /* must be lvalue */
if (lval->ident != iACCESSOR) {
assert(lval->sym!=NULL);
if ((lval->sym->usage & uCONST)!=0)
return error(22); /* assignment to const argument */
@ -1798,11 +1871,24 @@ static int hier2(value *lval)
inc(lval); /* increase variable afterwards */
if (saveresult)
popreg(sPRI); /* restore PRI (result of rvalue()) */
} else {
pushreg(sPRI); // save obj
invoke_getter(lval->accessor);
swap1(); // pri = obj, stack = [oldval]
pushreg(sPRI); // pri = obj, stack = [oldval, obj]
if (!check_userop(user_inc, lval->tag, 0, 1, lval, &lval->tag))
inc_pri();
popreg(sALT);
invoke_setter(lval->accessor, FALSE);
popreg(sPRI);
lval->ident = iEXPRESSION;
}
sideeffect=TRUE;
return FALSE; /* result is no longer lvalue */
case tDEC: /* lval-- */
if (!lvalue)
return error(22); /* must be lvalue */
if (lval->ident != iACCESSOR) {
assert(lval->sym!=NULL);
if ((lval->sym->usage & uCONST)!=0)
return error(22); /* assignment to const argument */
@ -1816,6 +1902,18 @@ static int hier2(value *lval)
dec(lval); /* decrease variable afterwards */
if (saveresult)
popreg(sPRI); /* restore PRI (result of rvalue()) */
} else {
pushreg(sPRI); // save obj
invoke_getter(lval->accessor);
swap1(); // pri = obj, stack = [oldval]
pushreg(sPRI); // pri = obj, stack = [oldval, obj]
if (!check_userop(user_dec, lval->tag, 0, 1, lval, &lval->tag))
dec_pri();
popreg(sALT);
invoke_setter(lval->accessor, FALSE);
popreg(sPRI);
lval->ident = iEXPRESSION;
}
sideeffect=TRUE;
return FALSE;
/* This is temporarily disabled because we detect it automatically.
@ -1843,28 +1941,6 @@ static int hier2(value *lval)
} /* switch */
}
static void invoke_getter(methodmap_t *map, methodmap_method_t *method, svalue *thisval)
{
if (thisval->lvalue)
rvalue(&thisval->val);
// push.pri
// push.c 1
// sysreq.c N 1
// stack 8
pushreg(sPRI);
markexpr(sPARM, NULL, 0);
{
pushval(1);
ffcall(method->getter, NULL, 1);
markusage(method->getter, uREAD);
}
markexpr(sEXPR, NULL, 0);
// We can't tell whether gets are effectful, but they really shouldn't be.
sideeffect = TRUE;
}
/* hier1
*
* The highest hierarchy level: it looks for pointer and array indices
@ -1892,6 +1968,10 @@ static int hier1(value *lval1)
restart:
sym=cursym;
if (matchtoken('[') || matchtoken('{') || matchtoken('(') || matchtoken('.')) {
if (lvalue && lval1->ident == iACCESSOR) {
rvalue(lval1);
lvalue = FALSE;
}
tok=tokeninfo(&val,&st); /* get token read by matchtoken() */
magic_string = (sym && (sym->tag == pc_tag_string && sym->dim.array.level == 0));
if (sym==NULL && symtok!=tSYMBOL) {
@ -2098,12 +2178,14 @@ restart:
if ((method = methodmap_find_method(map, lexstr)) == NULL)
error(105, map->name, lexstr);
if (method && method->getter) {
invoke_getter(map, method, &thisval);
if (method && (method->getter || method->setter)) {
if (lvalue)
rvalue(lval1);
clear_value(lval1);
lval1->ident = iEXPRESSION;
lval1->ident = iACCESSOR;
lval1->tag = method->getter->tag;
lvalue = FALSE;
lval1->accessor = method;
lvalue = TRUE;
goto restart;
}
@ -2307,6 +2389,7 @@ static void clear_value(value *lval)
lval->tag=0;
lval->ident=0;
lval->boolresult=FALSE;
lval->accessor=NULL;
/* do not clear lval->arrayidx, it is preset in hier14() */
/* do not clear lval->cmptag */
}
@ -2532,6 +2615,10 @@ static int nesting=0;
lvalue = implicitthis->lvalue;
} else {
lvalue = hier14(&lval);
if (lvalue && lval.ident == iACCESSOR) {
rvalue(&lval);
lvalue = FALSE;
}
}
assert(sc_status==statFIRST || arg[argidx].ident == 0 || arg[argidx].tags!=NULL);
switch (arg[argidx].ident) {
@ -2949,6 +3036,11 @@ static int constant(value *lval)
lval->tag=sym->tag;
lval->sym=sym;
markusage(sym,uREAD);
} else if (tok==tNULL) {
lval->constval = 0;
ldconst(lval->constval, sPRI);
lval->ident = iCONSTEXPR;
lval->tag = pc_tag_null_t;
} else if (tok==tNUMBER) {
lval->constval=val;
ldconst(lval->constval,sPRI);

View File

@ -1,3 +1,4 @@
// vim: set ts=8 sts=2 sw=2 tw=99 et:
/* Pawn compiler - code generation (unoptimized "assembler" code)
*
* Copyright (c) ITB CompuPhase, 1997-2006
@ -29,6 +30,7 @@
#include <alloc/fortify.h>
#endif
#include "sc.h"
#include "sctracker.h"
static int fcurseg; /* the file number (fcurrent) for the active segment */
@ -407,6 +409,10 @@ SC_FUNC void rvalue(value *lval)
outval(sym->addr,TRUE);
markusage(sym,uREAD);
code_idx+=opcodes(1)+opargs(1);
} else if (lval->ident==iACCESSOR) {
invoke_getter(lval->accessor);
lval->ident=iEXPRESSION;
lval->accessor=NULL;
} else {
/* direct or stack relative fetch */
assert(sym!=NULL);
@ -490,6 +496,8 @@ SC_FUNC void store(value *lval)
stgwrite("\tsref.pri ");
outval(sym->addr,TRUE);
code_idx+=opcodes(1)+opargs(1);
} else if (lval->ident==iACCESSOR) {
invoke_setter(lval->accessor, TRUE);
} else {
assert(sym!=NULL);
markusage(sym,uWRITTEN);
@ -637,6 +645,12 @@ SC_FUNC void moveto1(void)
code_idx+=opcodes(1)+opargs(0);
}
SC_FUNC void move_alt(void)
{
stgwrite("\tmove.alt\n");
code_idx+=opcodes(1)+opargs(0);
}
/* Push primary or the alternate register onto the stack
*/
SC_FUNC void pushreg(regid reg)
@ -1234,6 +1248,17 @@ SC_FUNC void nooperation(void)
code_idx+=opcodes(1);
}
SC_FUNC void inc_pri()
{
stgwrite("\tinc.pri\n");
code_idx+=opcodes(1);
}
SC_FUNC void dec_pri()
{
stgwrite("\tdec.pri\n");
code_idx+=opcodes(1);
}
/* increment symbol
*/
@ -1376,3 +1401,37 @@ SC_FUNC void outval(cell val,int newline)
if (newline)
stgwrite("\n");
}
SC_FUNC void invoke_getter(methodmap_method_t *method)
{
if (!method->getter) {
error(149, method->name);
return;
}
// push.c 1
// sysreq.c N 1
// stack 8
pushreg(sPRI);
pushval(1);
ffcall(method->getter, NULL, 1);
markusage(method->getter, uREAD);
}
SC_FUNC void invoke_setter(methodmap_method_t *method, int save)
{
if (!method->setter) {
error(152, method->name);
return;
}
if (save)
pushreg(sPRI);
pushreg(sPRI);
pushreg(sALT);
pushval(2);
ffcall(method->setter, NULL, 2);
if (save)
popreg(sPRI);
markusage(method->setter, uREAD);
}

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}, {97,114}, {105,110}, {116,105}, {37,115}, {101,114}, {110,111}, {97,110}, {101,110}, {97,108}, {135,130}, {114,101},
{111,114}, {34,136}, {145,34}, {117,110}, {121,32}, {138,129}, {115,105}, {115,116}, {100,101}, {97,116}, {101,132}, {109,140}, {32,146}, {41,10}, {109,98}, {116,104},
{114,97}, {117,115}, {144,32}, {147,99}, {98,108}, {163,142}, {102,165}, {101,120}, {118,141}, {97,32}, {111,108}, {116,121}, {99,139}, {112,101}, {115,121}, {172,149},
{174,158}, {133,160}, {176,170}, {115,10}, {103,32}, {105,132}, {103,117}, {115,150}, {182,155}, {137,32}, {133,184}, {116,111}, {102,134}, {97,164}, {168,181}, {99,104},
{161,129}, {134,190}, {109,192}, {104,97}, {111,102}, {105,131}, {44,32}, {166,32}, {109,101}, {99,116}, {98,128}, {97,142}, {177,148}, {109,97}, {101,100}, {117,108},
{99,130}, {37,131}, {118,133}, {112,143}, {178,156}, {196,32}, {105,189}, {210,214}, {99,111}, {101,131}, {130,32}, {99,108}, {118,128}, {110,32}, {152,188}, {102,105},
{111,112}, {186,129}, {100,105}, {97,115}, {108,128}, {112,128}, {97,131}, {136,10}, {156,10}, {109,153}, {151,153}, {116,97}, {171,229}, {119,105}, {215,128}, {224,137},
{101,10}, {212,157}, {34,32}, {171,173}, {195,220}, {40,241}, {150,122}, {208,151}, {139,32}, {141,32}, {110,97}, {101,108}, {139,132}, {102,144}, {134,32}
{101,32}, {116,32}, {111,110}, {115,32}, {100,32}, {97,114}, {105,110}, {116,105}, {101,114}, {37,115}, {110,111}, {97,110}, {101,110}, {114,101}, {97,108}, {135,130},
{111,114}, {117,110}, {34,137}, {146,34}, {121,32}, {138,129}, {115,105}, {115,116}, {100,101}, {97,116}, {101,132}, {109,140}, {32,147}, {41,10}, {109,98}, {116,104},
{114,97}, {117,115}, {144,32}, {98,108}, {145,99}, {101,120}, {164,143}, {102,166}, {97,32}, {116,121}, {118,142}, {111,108}, {169,112}, {99,139}, {173,149}, {115,121},
{175,158}, {133,160}, {136,32}, {176,171}, {115,10}, {103,32}, {103,117}, {105,132}, {115,150}, {182,155}, {133,185}, {116,111}, {161,129}, {97,163}, {109,188}, {101,131},
{102,134}, {44,32}, {170,183}, {99,104}, {101,10}, {134,194}, {104,97}, {111,102}, {117,108}, {99,116}, {105,131}, {167,32}, {98,128}, {97,143}, {177,148}, {109,97},
{101,100}, {165,112}, {99,130}, {37,131}, {118,133}, {179,156}, {110,32}, {199,32}, {105,189}, {212,216}, {109,101}, {99,111}, {111,112}, {137,10}, {130,32}, {99,108},
{118,128}, {186,129}, {152,192}, {102,105}, {172,128}, {220,136}, {116,97}, {100,105}, {119,105}, {97,115}, {108,128}, {97,131}, {156,10}, {109,153}, {151,153}, {217,128},
{213,157}, {198,224}, {40,240}, {150,122}, {210,151}, {34,32}, {138,32}, {139,32}, {142,32}, {159,32}, {110,97}, {115,101}, {116,117}, {139,132}, {209,141}
};
/*-*SCPACK end of pair table, do not change or remove this line */
@ -168,7 +168,7 @@ static char *errmsg[] = {
/*122*/ "expected type expression\n",
/*123*/ "fully-qualified name \"%s\" is too long, would be truncated to \"%s\"\n",
/*124*/ "unexpected token, expected method or property\n",
/*125*/ "expected \"native\" or \"get\"\n",
/*125*/ "expected \"native\", \"get\", or \"set\"\n",
/*126*/ "%s for %s already exists\n",
/*127*/ "property getters cannot accept extra arguments\n",
/*128*/ "%s must have the same return type as property %s (%s)\n",
@ -191,154 +191,164 @@ static char *errmsg[] = {
/*145*/ "invalid type expression\n",
/*146*/ "#pragma newdecls must be required or optional\n",
/*147*/ "new-style declarations are required\n",
/*148*/ "cannot assign null to a non-nullable type\n",
/*149*/ "no getter found for property %s\n",
/*150*/ "setter must take exactly one extra argument with type %s\n",
/*151*/ "setter must return void\n",
/*152*/ "no setter found for property %s\n",
#else
"\247\255\311\232\273k\214:\234\306bu\201fo\223\204\222\012",
"\202l\224\251s\206g\344\352e\233\201(\242\247\323\267\202) \254 f\252low ea\277 \042c\343e\042\012",
"\230\333\205\313 \325\251loc\371\356\302ap\255\205 \376\251\330mpo\223\204\244ock\012",
"\246\234 \305\225imple\233t\316\012",
"\307\315\224\225\364\272t\263",
"\302\312a\267gn\232\273 \370\261y\012",
"\357\231\242\257\312\217\336\316\012",
"\302\312\251\367\213\201\247\323\267\202; \343sum\232z\211o\012",
"\301\314\366\200(nega\207ve\306z\211o \242ou\201\325bo\223ds\235",
"\301\307\242\230\333\205\313\012",
"\301out\226d\200\246\263",
"\301\307c\215l\306\225\251\276add\217s\263",
"\212 \214tr\224po\206\201(\212 pu\244ic \246s\235",
"\301\352e\233t; \225\376s\355t\277\012",
"\042\230fa\317t\362c\343\200\302\312\237\200l\343\201c\343\200\376s\355t\277 \352e\233t\012",
"m\317\207p\344\230fa\317t\203\376\042s\355t\277\042\012",
"\223\336\232\324\012",
"\206i\207\215iz\313 d\231\251\247ce\316\203\230\333\205\232\366\360",
"\225\251lab\373:\350",
"\301\262 \372m\200\222\012",
"\262 \215\217ad\224\336\316:\350",
"\302\312l\250u\200(n\202-\367\213t\235",
"\314a\267gn\233\201\302\312\226mp\344a\267gn\233t\012",
"\042b\217ak\362\242\042\320t\206ue\362\305ou\201\325\320t\247t\012",
"\307head\206\264\342ff\211\203from pro\273\363\012",
"\212 \351\277\206\264\042#if...\042\012",
"\301\277\205a\311\271\367\213t\012",
"\301subscrip\201(\225\370\314\242\273o m\213\224subscripts):\350",
"\301\247\323\267\202\306\343sum\232z\211o\012",
"\330mpo\223\204\352e\233\201\225\333os\232a\201\237\200\214\204\325\337\344(\227\205t\232a\201l\206\200%d\235",
"\223k\212w\335\342\217c\207v\360",
"\314\206\230x ou\201\325bo\223d\203(\356\222\235",
"\314\302\312\206\230x\232(\356\222\235",
"\341do\331\225\364\251\230fa\317\201\250u\200(\341%d\235",
"\341\354mis\351\277 (\341%d\235",
"empt\224\352e\233t\012",
"\301\227r\206\264(po\267\244\224n\202-t\211m\206\231\232\227r\206g\235",
"\247t\240 \277\205a\311\211\203\332l\206\360",
"\367\213\201\262 \303\203\212 \366\360",
"duplic\231\200\042c\343e\362lab\373 (\250u\200%d\235",
"\301\373lip\226s\306\314\366\200\305\225k\212wn\012",
"\301\330\236\206\313 \325\333\343\203s\255ci\337\211\263",
"\277\205a\311\271\367\213\201\247ce\316\203r\213g\200f\242pack\232\227r\206g\012",
"po\226\216\371p\205a\310t\211\203\302\323c\316\200\215l \372m\232p\205a\310t\211\263",
"\273o m\213\224\307\272t\263",
"\223k\212w\335\314\366\200(\356\222\235",
"\314\366\331do \225\351\277\306\242\230\227\206\313 \314\305\273o sm\215l\012",
"\314(\203do \225\351\277\012",
"\301l\206\200\320t\206u\313\012",
"\301r\213g\360",
"\301subscript\306\241\200\042[ ]\362\357\231\220\203\332\315j\242\342\233\226\202\263",
"m\317\207-\342\233\226\202\371\261y\203\302\312f\317l\224\206i\207\215iz\316\012",
"\247ce\316\206\264\315ximum nu\236\271\325\342\233\226\202\263",
"\223\351\277\232\333os\206\264b\240c\200(\042}\042\235",
"\227\205\201\325\307bod\224\355\237ou\201\307head\211\012",
"\261ys\306loc\371\327\331\374\307\272t\203\257\312pu\244ic (\356\222\235",
"\223\274ish\232\247\323\267\332be\375\200\330mpil\271\342\217c\207v\360",
"duplic\231\200\272t; sam\200\341\305p\343s\232t\355c\360",
"\307\341\315\224\225\364\251\230fa\317\201\250u\200(\356\222\235",
"m\317\207p\344\042#\373se\362\342\217c\207v\331betwe\214 \042#if ... #\214\342f\042\012",
"\042#\373seif\362\342\217c\207\334f\252low\203\370\042#\373se\362\342\217c\207v\360",
"nu\236\271\325\357\213d\203do\331\225\337\201\237\200\357\231\220\012",
"\307\217s\317\201\353\264\325\357\231\220\234 \302\312\222\012",
"\257\277\213g\200\323\336\232\357\231\220\263",
"\307\341\315\224\202l\224\364\251s\206g\344\353\264(\341%d\235",
"\307\341\315\224\225\312\251\217f\211\214c\200\341\242\370\314(\341\222\235",
"\356\257\312bo\237 \251\217f\211\214c\200\374\370\314(\356\222\235",
"\301\240\216\371nu\236\271\323ci\226\332\376#p\240g\315\012",
"\240\216\371nu\236\271\375\315\201\215\217ad\224\336\316\012",
"\240\216\371nu\236\271supp\220\201w\346\225\214\275\316\012",
"\241\211-\336\232\357\231\242\302\312\230\333\205\232be\375\200\241\200(\246\234\235",
"\042\366e\304\362\357\231\242\305\301\332\042\246\362\262\263",
"\307\341\302\312\370\314(\341\222\235",
"#\336\200p\231t\211\335\302\227\205\201\355\237 \370\215p\303be\207c \277\205a\311\211\012",
"\206pu\201l\206\200\273o l\202\264(aft\271subs\207tu\216s\235",
"\256n\353x \211r\242\376\237\200\247\323\267\202\306\242\301\307c\215l\012",
"m\215\375m\232UTF-8 \214\330d\206g\306\242c\220rupt\232\337le: \347",
"\307\241\331bo\237 \042\217turn\362\374\042\217tur\335<\250ue>\042\012",
"\206\320\226\227\214\201\217tur\335\363\203(\314& n\202-\261y\235",
"\223k\212w\335\262\306\242\225\251\367\213\201\262 \365",
"\257\353k\200\251\353\264\346\251\230fa\317\201\250u\200f\242\370\206\230x\232\314p\205a\310t\271\365",
"\241\211-\336\232\357\231\220\203\374\372\207\334\246\203\315\224\225\364\352e\263",
"\251\307\242\356\315\224\202l\224b\373\202\264\273 \251s\206g\344au\273\351\332\365",
"\352\200\320fli\311: \202\200\325\237\200\352\331\305\215\217ad\224a\267gn\232\273 a\212\237\271imple\233t\313 \365",
"\212 \352\331\205\200\336\232f\242\324\012",
"\223k\212w\335au\273\351\202\350",
"\223k\212w\335\352\200\222 f\242au\273\351\202\350",
"pu\244ic \327\331\374loc\371\327\331\315\224\225\364\352\331\365",
"\352\200\327\331\315\224\225\312\206i\207\215iz\232\365",
"pu\244ic \246\203\315\224\225\217tur\335\261y\203\365",
"a\236i\266ou\203\367\213t; \353\264ov\211rid\200\305\217qui\217\204\365",
"nu\236\271\325\272t\203do\331\225\351\277 \336i\216\012",
"\247\255\311\232\353\264\372m\200id\214\207\337\211\012",
"\307\214um\211\313 \217qui\217\203\223iqu\200\353g\012",
"\257\364\217qui\217\204p\205a\310t\211\203aft\271\340\216\371p\205a\310t\211\263",
"\330\317\204\225\274\204\310\236\211\234 \376\227ruc\201\222\012",
"\324 do\331\225\364\251\351\277\206\264\363\012",
"\354\222 sho\317\204\312\222 \376new-\227y\344\230\333\205\313\263",
"\321sho\317\204\225\364\370\247plici\201\217tur\335\363\012",
"\307pro\273\363\203do \225\351\277\012",
"s\255cif\224ei\237\271\215l \342\233\226\202\203\242\202l\224\237\200l\343\201\342\233\226\202\012",
"\257\274\204\321\347",
"\321w\346\215\217ad\224\336\232\332\237\305\347",
"\257\274\204\213\224\310\237od\203f\242\347",
"\257\274\204\310\237o\204\242pr\357t\224\210.\347",
"\257c\215l \310\237od\203\332\370\261y\012",
"\257c\215l \310\237od\203\332\251\246\012",
"\310\237o\204\302\364\251\337rs\201\341\330mpa\207\244\200\355\237 \237\200\321\354(\210\235",
"\321\372m\200\302\227\205\201\355\237 \370upp\211c\343\200lett\211\012",
"\321\303\203\215\217ad\224be\214 \336\232(\323vio\241l\224se\214 \346\210\235",
"\247\255\311\232id\214\207\337\271- d\265you \375ge\201\251\363?\012",
"\367ru\311\242\307\302\217tur\335\353\264\347",
"\257\336\200\367ru\311\242\375\234; \215\217ad\224\247i\227\203\346\251\347",
"miss\206\264\363\306\242\321\302\364\237\200sam\200\372m\200\346\321\222\012",
"\257\241\200\230lete\306\321\321\303\203\212 \230\227ru\311\220\012",
"\212 \310\237od\315p \242\333\343\203w\346fo\223\204f\242\347",
"\212 \230\227ru\311\242w\346fo\223\204f\242\321\347",
"\230\227ru\311\220\203\302\312\372\207\334\246\263",
"\230\227ru\311\220\203\257\364\247t\240 \272t\263",
"\310\237od\315p \374\333\343\203\226gn\231u\217\203\302\241\200new-\227y\344\354\230\333\205\313\263",
"\257s\255cif\224\314\342\233\226\202\203\332bo\237 \354\374\372\310\012",
"\247\255\311\232\354\247\323\267\202\012",
"f\317ly-qu\215i\337\232\372m\200\222 \305\273o l\202g\306wo\317\204\312tr\243\231\232\273\350",
"\223\247\255\311\232\273k\214\306\247\255\311\232\310\237o\204\242pr\357\253\012",
"\247\255\311\232\042\372\207ve\362\242\042get\042\012",
"\321f\242\321\215\217ad\224\247i\227\263",
"pr\357t\224gett\211\203\257accep\201\247t\240 \272t\263",
"\321\302\364\237\200sam\200\217tur\335\354\346pr\357t\224\321(\210\235",
"\257mix \310\237od\315p\203\374\333\343s\331\355\237 \206h\211it\213c\360",
"\257\330\211c\200\246\203\273 \250ue\263",
"\257\330\211c\200objec\201\354\321\273 n\202-objec\201\354\347",
"\257\330\211c\200n\202-objec\201\354\321\273 objec\201\354\347",
"\257\330\211c\200\223\217l\231\232objec\201\363\203\321\374\347",
"\354mis\351\277 (\321\374\210\235",
"\257\241\200\370objec\201\376\251m\317\207-\353\264s\373e\311\220\012",
"\261y\203\205\200\225supp\220t\232\346\217tur\335\363\263",
"\257mix \217f\211\214c\200\374\314\363\263",
"\320s\201w\346s\255ci\337\232t\355c\360",
"\330\317\204\225\274\204\354\222\012",
"new-\227y\344\314\363\203\257s\255cif\224\342\233\226\332\366\331\346p\205\201\325\237eir \363\012",
"\372\207ves\306\375w\205ds\306\374pu\244ic \246\203\257\217tur\335\261y\263",
"\301\354\230\333\205\313\012",
"new-\227y\344\230\333\205\313\203sho\317\204\225\364\042new\042\012",
"vo\265\257\312\241\232\346\251\356\363\012",
"\301\354\247\323\267\202\012",
"#p\240gm\251new\230\333\203\302\312\217qui\217\204\242\340\216\215\012",
"new-\227y\344\230\333\205\313\203\205\200\217qui\217d\012"
"\321e\311\232\273k\214:\234\301bu\201fo\221\204\223\012",
"\202l\224\250s\206g\352\356e\233\201(\242\376\270\202) \255 f\253low ea\303 \042c\351e\042\012",
"\230\337\205\315 \327\250loc\370\357\276appe\205 \206 \250\333mpo\221\204\243ock\012",
"\247\234 \312\225imple\233t\320\012",
"\313\317\224\225\361\272t\264",
"\276\314a\270gn\232\273 \367\261y\012",
"\345\231\242\256\314\215\342\320\012",
"\276\314\250\364\213\201\376\270\202; \351sum\232z\210o\012",
"\305\316\363\200(nega\207ve\301z\210o \242ou\201\327bo\221ds\235",
"\305\313\242\230\337\205\315\012",
"\305out\226d\200\247\264",
"\305\313c\216l\301\225\250\302add\215s\264",
"\366\214tr\224po\206\201(\366pu\243ic \247s\235",
"\305\356e\233t; \225\206 s\350t\303\012",
"\042\230fa\310t\365c\351\200\276\314\237\200l\351\201c\351\200\206 s\350t\303 \356e\233t\012",
"m\310\207p\352\230fa\310t\203\206 \042s\350t\303\042\012",
"\221\342\232\325\012",
"\206i\207\216iz\315 d\231\250\245ce\320\203\230\337\205\232\363\304",
"\225\250label:\354",
"\305\263 \372m\200\223\012",
"\263 \216\215ad\224\342\320:\354",
"\276\314l\252u\200(n\202-\364\213t\235",
"\316a\270gn\233\201\276\314\226mp\352a\270gn\233t\012",
"\042b\215ak\365\242\042\322t\206ue\365\312ou\201\327\322t\245t\012",
"\313head\206\265\347ff\210\203from pro\273\254\304",
"\366\355\303\206\265\042#if...\042\012",
"\305\303\205a\311\262\364\213t\012",
"\305subscrip\201(\225\367\316\242\273o m\213\224subscripts):\354",
"\305\376\270\202\301\351sum\232z\210o\012",
"\333mpo\221\204\356e\233\201\225\337os\232a\201\237\200\214\204\327\343\352(\227\205t\232a\201l\206\200%d\235",
"\221k\212w\326\347\215c\207v\304",
"\316\206\230x ou\201\327bo\221d\203(\357\223\235",
"\316\276\314\206\230x\232(\357\223\235",
"\341do\277\225\361\250\230fa\310\201\252u\200(\341%d\235",
"\341\344mis\355\303 (\341%d\235",
"empt\224\356e\233t\012",
"\305\227r\206\265(po\270\243\224n\202-t\210m\206\231\232\227r\206g\235",
"\245t\240 \303\205a\311\210\203\336l\206\304",
"\364\213\201\263 \306\203\366\363\304",
"duplic\231\200\042c\351e\365label (\252u\200%d\235",
"\305ellip\226s\301\316\363\200\312\225k\212wn\012",
"\305\333\236\206\315 \327\337\351\203speci\343\210\264",
"\303\205a\311\262\364\213\201\245ce\320\203r\213g\200f\242pack\232\227r\206g\012",
"po\226\217\370p\205a\332t\210\203\276p\215c\320\200\216l \372m\232p\205a\332t\210\264",
"\273o m\213\224\313\272t\264",
"\221k\212w\326\316\363\200(\357\223\235",
"\316\363\277do \225\355\303\301\242\230\227\206\315 \316\312\273o sm\216l\012",
"\316(\203do \225\355\303\012",
"\305l\206\200\322t\206u\315\012",
"\305r\213g\304",
"\305subscript\301\241\200\042[ ]\365\345\231\220\203\336\317j\242\347\233\226\202\264",
"m\310\207-\347\233\226\202\370\261y\203\276\314f\310l\224\206i\207\216iz\320\012",
"\245ce\320\206\265\317ximum nu\236\262\327\347\233\226\202\264",
"\221\355\303\232\337os\206\265b\240c\200(\042}\042\235",
"\227\205\201\327\313bod\224\350\237ou\201\313head\210\012",
"\261ys\301loc\370\331\277\375\313\272t\203\256\314pu\243ic (\357\223\235",
"\221\300ish\232\376\270\336bef\220\200\333mpil\262\347\215c\207v\304",
"duplic\231\200\272t; sam\200\341\312p\351s\232t\350c\304",
"\313\341\317\224\225\361\250\230fa\310\201\252u\200(\357\223\235",
"m\310\207p\352\042#el\373\365\347\215c\207v\277betwe\214 \042#if ... #\214\347f\042\012",
"\042#el\373if\365\347\215c\207\340f\253low\203\367\042#el\373\365\347\215c\207v\304",
"nu\236\262\327\345\213d\203do\277\225\343\201\237\200\345\231\220\012",
"\313\215s\310\201\346\265\327\345\231\220\234 \276\314\223\012",
"\256\303\213g\200p\215\342\232\345\231\220\264",
"\313\341\317\224\202l\224\361\250s\206g\352\346\265(\341%d\235",
"\313\341\317\224\225\314\250\215f\210\214c\200\341\242\367\316(\341\223\235",
"\357\256\314bo\371\250\215f\210\214c\200\375\367\316(\357\223\235",
"\305\240\217\370nu\236\262p\215ci\226\336\206 #p\240g\317\012",
"\240\217\370nu\236\262f\220\317\201\216\215ad\224\342\320\012",
"\240\217\370nu\236\262supp\220\201w\353\225\214\275\320\012",
"\241\210-\342\232\345\231\242\276\314\230\337\205\232bef\220\200\241\200(\247\234\235",
"\042\363e\307\365\345\231\242\312\305\336\042\247\365\263\264",
"\313\341\276\314\367\316(\341\223\235",
"#\342\200p\231t\210\326\276\227\205\201\350\371\367\216p\306be\207c \303\205a\311\210\012",
"\206pu\201l\206\200\273o l\202\265(aft\262subs\207\374\217s\235",
"\257n\346x \210r\242\206 \237\200\376\270\202\301\242\305\313c\216l\012",
"m\216f\220m\232UTF-8 \214\333d\206g\301\242c\220rupt\232\343le: \335",
"\313\241\277bo\371\042\215\374rn\365\375\042\215\374r\326<\252ue>\042\012",
"\206\322\226\227\214\201\215\374r\326\254\277(\316& n\202-\261y\235",
"\221k\212w\326\263\301\242\225\250\364\213\201\263 \362",
"\256\346k\200\250\346\265\353\250\230fa\310\201\252u\200f\242\367\206\230x\232\316p\205a\332t\262\362",
"\241\210-\342\232\345\231\220\203\375\372\207\340\247\203\317\224\225\361\356e\264",
"\250\313\242\357\317\224\202l\224bel\202\265\273 \250s\206g\352au\273\355\336\362",
"\356\200\322fli\311: \202\200\327\237\200\356\277\312\216\215ad\224a\270gn\232\273 a\212\237\262imple\233t\315 \362",
"\366\356\277\205\200\342\232f\242\325\012",
"\221k\212w\326au\273\355\202\354",
"\221k\212w\326\356\200\223 f\242au\273\355\202\354",
"pu\243ic \331\277\375loc\370\331\277\317\224\225\361\356\277\362",
"\356\200\331\277\317\224\225\314\206i\207\216iz\232\362",
"pu\243ic \247\203\317\224\225\215\374r\326\261y\203\362",
"a\236i\266ou\203\364\213t; \346\265ov\210rid\200\312\215qui\215\204\362",
"nu\236\262\327\272t\203do\277\225\355\303 \342i\217\012",
"\321e\311\232\346\265\372m\200id\214\207\343\210\012",
"\313\214um\210\315 \215qui\215\203\221iqu\200\346g\012",
"\256\361\215qui\215\204p\205a\332t\210\203aft\262\334\217\370p\205a\332t\210\264",
"\333\310\204\225\300\204\332\236\210\234 \206 \227ruc\201\223\012",
"\325 do\277\225\361\250\355\303\206\265\254\304",
"\344\223 sho\310\204\314\223 \206 new-\227y\352\230\337\205\315\264",
"\323sho\310\204\225\361\367\321lici\201\215\374r\326\254\304",
"\313pro\273\254\277do \225\355\303\012",
"specif\224ei\237\262\216l \347\233\226\202\203\242\202l\224\237\200l\351\201\347\233\226\202\012",
"\256\300\204\323\335",
"\323w\353\216\215ad\224\342\232\336\237\312\335",
"\256\300\204\213\224\332\237od\203f\242\335",
"\256\300\204\332\237o\204\242pr\345t\224\211.\335",
"\256c\216l \332\237od\203\336\367\261y\012",
"\256c\216l \332\237od\203\336\250\247\012",
"\332\237o\204\276\361\250\343rs\201\341\333mpa\207\243\200\350\371\237\200\323\344(\211\235",
"\323\372m\200\276\227\205\201\350\371\367upp\210c\351\200lett\210\012",
"\323\306\203\216\215ad\224be\214 \342\232(p\215vio\241l\224\373\214 \353\211\235",
"\321e\311\232id\214\207\343\262- d\267you f\220ge\201\250\254e?\012",
"\364ru\311\242\313\276\215\374r\326\346\265\335",
"\256\342\200\364ru\311\242f\220\234; \216\215ad\224\245i\227\203\353\250\335",
"miss\206\265\254e\301\242\323\276\361\237\200sam\200\372m\200\353\323\223\012",
"\256\241\200\230lete\301\323\323\306\203\366\230\227ru\311\220\012",
"\366\332\237od\317p \242\337\351\203w\353fo\221\204f\242\335",
"\366\230\227ru\311\242w\353fo\221\204f\242\323\335",
"\230\227ru\311\220\203\276\314\372\207\340\247\264",
"\230\227ru\311\220\203\256\361\245t\240 \272t\264",
"\332\237od\317p \375\337\351\203\226gn\231u\215\203\276\241\200new-\227y\352\344\230\337\205\315\264",
"\256specif\224\316\347\233\226\202\203\336bo\371\344\375\372m\304",
"\321e\311\232\344\376\270\202\012",
"f\310ly-qu\216i\343\232\372m\200\223 \312\273o l\202g\301wo\310\204\314tr\244\231\232\273\354",
"\221\321e\311\232\273k\214\301\321e\311\232\332\237o\204\242pr\345\251\012",
"\321e\311\232\042\372\207ve\042\301\042get\042\301\242\042\373t\042\012",
"\323f\242\323\216\215ad\224\245i\227\264",
"pr\345t\224gett\210\203\256accep\201\245t\240 \272t\264",
"\323\276\361\237\200sam\200\215\374r\326\344\353pr\345t\224\323(\211\235",
"\256mix \332\237od\317p\203\375\337\351s\277\350\371\206h\210it\213c\304",
"\256\333\210c\200\247\203\273 \252ue\264",
"\256\333\210c\200objec\201\344\323\273 n\202-objec\201\344\335",
"\256\333\210c\200n\202-objec\201\344\323\273 objec\201\344\335",
"\256\333\210c\200\221\215l\231\232objec\201\254\277\323\375\335",
"\344mis\355\303 (\323\375\211\235",
"\256\241\200\367objec\201\206 \250m\310\207-\346\265\373le\311\220\012",
"\261y\203\205\200\225supp\220t\232\353\215\374r\326\254e\264",
"\256mix \215f\210\214c\200\375\316\254e\264",
"\322s\201w\353speci\343\232t\350c\304",
"\333\310\204\225\300\204\344\223\012",
"new-\227y\352\316\254\277\256specif\224\347\233\226\336\363\277\353p\205\201\327\237eir \254\304",
"\372\207ves\301f\220w\205ds\301\375pu\243ic \247\203\256\215\374r\326\261y\264",
"\305\344\230\337\205\315\012",
"new-\227y\352\230\337\205\315\203sho\310\204\225\361\042new\042\012",
"vo\267\256\314\241\232\353\250\357\254\304",
"\305\344\376\270\202\012",
"#p\240gm\250new\230\337\203\276\314\215qui\215\204\242\334\217\216\012",
"new-\227y\352\230\337\205\315\203\205\200\215qui\215d\012",
"\256a\270g\326n\310l \273 \250n\202-n\310l\275\200\254\304",
"\366gett\262fo\221\204f\242pr\345t\224\335",
"\373tt\262\276\346k\200\245a\311l\224\202\200\245t\240 \341\350\371\344\335",
"\373tt\262\276\215\374r\326void\012",
"\366\373tt\262fo\221\204f\242pr\345t\224\335"
#endif
};
@ -363,18 +373,18 @@ static char *fatalmsg[] = {
/*170*/ "assertion failed: %s\n",
/*171*/ "user error: %s\n",
#else
"\257\217a\204from \337le:\350",
"\257writ\200\273 \337le:\350",
"t\275\200ov\211flow:\350",
"\206suf\337ci\214\201\310m\220y\012",
"\301\343se\236l\271\206\227ruc\216\350",
"num\211ic ov\211flow\306\247ce\316\206\264capaci\253\012",
"\330mpil\232scrip\201\247ce\316\203\237\200\315ximum \310m\220\224\366\200(%l\204bytes\235",
"\273o m\213\224\211r\242\310ssag\331\332\202\200l\206\360",
"\330\230pag\200\315pp\206\264\337\344\225fo\223d\012",
"\301p\231h:\350",
"\343s\211\216 fail\316: \347",
"\241\271\211r\220: \347"
"\256\215a\204from \343le:\354",
"\256writ\200\273 \343le:\354",
"t\275\200ov\210flow:\354",
"\206suf\343ci\214\201\332m\220y\012",
"\305\351\373\236l\262\206\227ruc\217\354",
"num\210ic ov\210flow\301\245ce\320\206\265capaci\251\012",
"\333mpil\232scrip\201\245ce\320\203\237\200\317ximum \332m\220\224\363\200(%l\204bytes\235",
"\273o m\213\224\210r\242\332ssag\277\336\202\200l\206\304",
"\333\230pag\200\317pp\206\265\343\352\225fo\221d\012",
"\305p\231h:\354",
"\351s\210\217 fail\320: \335",
"\241\262\210r\220: \335"
#endif
};
@ -418,43 +428,43 @@ static char *warnmsg[] = {
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
#else
"\324 \305tr\243\231\232\273 %\204\277\205a\311\211\263",
"\217\336i\216 \325\367\213t/\315cro \365",
"nu\236\271\325\272t\203do\331\225\351\277 \336i\216\012",
"\262 \305nev\271\241\316:\350",
"\262 \305a\267gn\232\251\250u\200\237a\201\305nev\271\241\316:\350",
"\217d\223d\213\201\330\230: \367\213\201\247\323\267\332\305z\211o\012",
"\217d\223d\213\201te\227: \367\213\201\247\323\267\332\305n\202-z\211o\012",
"\223k\212w\335#p\240g\315\012",
"\307\355\237 \353\264\217s\317\201\241\232be\375\200\336i\216\306\375c\206\264\217p\205s\360",
"\246\234 sho\317\204\217tur\335\251\250u\360",
"po\267\244\200\241\200\325\262 be\375\200\206i\207\215iz\313:\350",
"po\267\244\224\223\206t\214\230\204a\267gn\233t\012",
"po\267\244\224\223\206t\214\230\204bit\355s\200\357\313\012",
"\353\264mis\351\277\012",
"po\267\244\224\251\042\367\362\314\341w\346\206t\214\230d:\350",
"\247\323\267\332\303\203\212 effe\311\012",
"ne\227\232\330m\233t\012",
"loos\200\206d\214t\313\012",
"\252\204\227y\344pro\273\363\203\241\232\355\237 \340\216\371semic\252umn\263",
"loc\371\356\222 s\303dow\203\251\356a\201\251\323c\316\206\264lev\373\012",
"\247\323\267\332\355\237 \353\264ov\211rid\200\302ap\255\205 betwe\214 p\205\214\237ese\263",
"lab\373 \372m\200\222 s\303dow\203\353\264\372\310\012",
"nu\236\271\325\342git\203\247ce\316\203\240\216\371nu\236\271\323ci\226\202\012",
"\217d\223d\213\201\042\366e\304\042: \341\366\200\305\215way\2031 \365",
"\206\230t\211m\206\231\200\314\366\200\376\042\366e\304\362\247\323\267\332\365",
"\223\217a\277\275\200\330\230\012",
"\251\356\305a\267gn\232\273 its\373f \365",
"m\220\200\206i\207\215iz\211\203\237\370\214um \337\373d\263",
"l\214g\237 \325\206i\207\215iz\271\247ce\316\203\366\200\325\237\200\214um \337\373d\012",
"\206\230x \353\264mis\351\277 \365",
"\212 imple\233t\313 f\242\352\200\222 \376\246\234\306\212 f\215l-back\012",
"\352\200s\255ci\337c\313 \332\375w\205\204\230\333\205\313 \305ig\212\217d\012",
"outpu\201\337\344\305writt\214\306bu\201\355\237 \330mpac\201\214\330d\206\264\342s\275\316\012",
"\352\200\356\222 s\303dow\203\251glob\371\327\360",
"\324 \305m\205k\232\346\230\323c\231\316: \347",
"pu\244ic \307lack\203\375w\205\204\230\333\205\313 \365",
"\223k\212w\335p\205a\310t\271\376subs\207tu\216 (\206c\220\217c\201#\336\200p\231t\211n\235"
"\325 \312tr\244\231\232\273 %\204\303\205a\311\210\264",
"\215\342i\217 \327\364\213t/\317cro \362",
"nu\236\262\327\272t\203do\277\225\355\303 \342i\217\012",
"\263 \312nev\262\241\320:\354",
"\263 \312a\270gn\232\250\252u\200\237a\201\312nev\262\241\320:\354",
"\215d\221d\213\201\333\230: \364\213\201\376\270\336\312z\210o\012",
"\215d\221d\213\201te\227: \364\213\201\376\270\336\312n\202-z\210o\012",
"\221k\212w\326#p\240g\317\012",
"\313\350\371\346\265\215s\310\201\241\232bef\220\200\342i\217\301f\220c\206\265\215p\205s\304",
"\247\234 sho\310\204\215\374r\326\250\252u\304",
"po\270\243\200\241\200\327\263 bef\220\200\206i\207\216iz\315:\354",
"po\270\243\224\221\206t\214\230\204a\270gn\233t\012",
"po\270\243\224\221\206t\214\230\204bit\350s\200\345\315\012",
"\346\265mis\355\303\012",
"po\270\243\224\250\042\364\365\316\341w\353\206t\214\230d:\354",
"\376\270\336\306\203\366effe\311\012",
"ne\227\232\333m\233t\012",
"loos\200\206d\214t\315\012",
"\253\204\227y\352pro\273\254\277\241\232\350\371\334\217\370\373mic\253umn\264",
"loc\370\357\223 s\306dow\203\250\357a\201\250p\215c\320\206\265level\012",
"\376\270\336\350\371\346\265ov\210rid\200\276appe\205 betwe\214 p\205\214\237e\373\264",
"label \372m\200\223 s\306dow\203\346\265\372m\304",
"nu\236\262\327\347git\203\245ce\320\203\240\217\370nu\236\262p\215ci\226\202\012",
"\215d\221d\213\201\042\363e\307\042: \341\363\200\312\216way\2031 \362",
"\206\230t\210m\206\231\200\316\363\200\206 \042\363e\307\365\376\270\336\362",
"\221\215a\303\275\200\333\230\012",
"\250\357\312a\270gn\232\273 it\373lf \362",
"m\220\200\206i\207\216iz\210\203\237\367\214um \343eld\264",
"l\214g\371\327\206i\207\216iz\262\245ce\320\203\363\200\327\237\200\214um \343eld\012",
"\206\230x \346\265mis\355\303 \362",
"\366imple\233t\315 f\242\356\200\223 \206 \247\234\301\366f\216l-back\012",
"\356\200speci\343c\315 \336f\220w\205\204\230\337\205\315 \312ig\212\215d\012",
"outpu\201\343\352\312writt\214\301bu\201\350\371\333mpac\201\214\333d\206\265\347s\275\320\012",
"\356\200\357\223 s\306dow\203\250glob\370\331\304",
"\325 \312m\205k\232\353\230p\215c\231\320: \335",
"pu\243ic \313lack\203f\220w\205\204\230\337\205\315 \362",
"\221k\212w\326p\205a\332t\262\206 subs\207\374\217 (\206c\220\215c\201#\342\200p\231t\210n\235"
#endif
};

View File

@ -92,6 +92,7 @@ typedef struct methodmap_s
struct methodmap_s *next;
struct methodmap_s *parent;
int tag;
int nullable;
LayoutSpec spec;
char name[sNAMEMAX+1];
methodmap_method_t **methods;