Redo menu methodmaps.

This commit is contained in:
David Anderson
2014-12-13 12:53:30 -08:00
parent 5959d6ed54
commit 722a23c818
4 changed files with 411 additions and 133 deletions
+12 -3
View File
@@ -3414,7 +3414,14 @@ static int parse_new_decl(declinfo_t *decl, const token_t *first, int flags)
if (!parse_new_typeexpr(&decl->type, first, flags))
return FALSE;
decl->type.is_new = TRUE;
if (flags & DECLMASK_NAMED_DECL) {
if ((flags & DECLFLAG_ARGUMENT) && matchtoken(tELLIPS)) {
decl->type.ident = iVARARGS;
return TRUE;
}
if ((flags & DECLFLAG_MAYBE_FUNCTION) && matchtoken(tOPERATOR)) {
decl->opertok = operatorname(decl->name);
if (decl->opertok == 0)
@@ -3428,8 +3435,6 @@ static int parse_new_decl(declinfo_t *decl, const token_t *first, int flags)
}
}
decl->type.is_new = TRUE;
if (flags & DECLMASK_NAMED_DECL) {
if (matchtoken('[')) {
if (decl->type.numdim == 0)
@@ -3516,7 +3521,11 @@ 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) || lexpeek('&')) {
if (lexpeek(tSYMBOL) ||
lexpeek(tOPERATOR) ||
lexpeek('&') ||
lexpeek(tELLIPS))
{
// 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);
@@ -0,0 +1,3 @@
methodmap X {
public native void egg(any ...);
};