Add ByRef annotations to the ".info" files generated by the compiler.

[COMPILER]
* NEW: Add ByRef annotations to the ".info" files generated by the compiler. The name of "ByRef" method arguments is now prefixed with a '&' character.
This commit is contained in:
gambas 2019-07-15 15:38:52 +02:00
parent f1cc289bfb
commit f6f7f85f8b
3 changed files with 7 additions and 2 deletions

View file

@ -324,14 +324,17 @@ static void export_type(TYPE type, bool scomma)
static void export_signature(int nparam, int npmin, PARAM *param, bool vararg)
{
int i;
PARAM *p;
for (i = 0; i < nparam; i++)
{
p = &param[i];
if (i == npmin)
fprintf(_finfo, "[");
fprintf(_finfo, "(%s)", get_name(param[i].index));
export_type(param[i].type, TRUE);
fprintf(_finfo, "(%s%s)", (p->byref ? "&" : ""), get_name(p->index));
export_type(p->type, TRUE);
}
if (npmin < nparam)

View file

@ -166,6 +166,7 @@ static void analyze_function_desc(TRANS_FUNC *func, int flag)
if (PATTERN_is(*look, RS_AT) || PATTERN_is(*look, RS_BYREF))
{
param->byref = TRUE;
func->byref |= byref_mask;
look++;
}

View file

@ -31,6 +31,7 @@ typedef
PATTERN *optional;
short value;
unsigned ignore : 1;
unsigned byref : 1;
}
TRANS_PARAM;