Cannot create a class with attribute with more than 1 arg

Project:GNU Smalltalk
Component:VM
Category:bug
Priority:normal
Assigned:bonzinip
Status:fixed
Description

The error message : "expected one keyword only" is printed

Updates

#1 submitted by Gwenael Casaccio on Tue, 09/14/2010 - 11:11
static mst_Boolean
parse_and_send_attribute (gst_parser *p, OOP receiverOOP)
{

OOP selectorOOP, *args;
tree_node keyword, value, stmt;
int i, nb = 0;

  1. if 0

printf ("parse attribute\n");

  1. endif

lex_skip_mandatory (p, '<');
keyword = parse_keyword_expression (p, NULL, EXPR_KEYWORD);

selectorOOP = _gst_compute_keyword_selector (keyword->v_expr.expression);
nb = _gst_selector_num_args (selectorOOP);
args = alloca (sizeof (*args) * nb);
i = 0;
for (stmt = keyword->v_expr.expression; stmt; stmt =

stmt->v_list.next)
  {
    value = stmt->v_list.value;
    value = _gst_make_statement_list (&value->location, value);
    args[i] = _gst_execute_statements (NULL, value, UNDECLARED_NONE, true);
    if (!args[i])
      {
        _gst_had_error = true;
        break ;
      }
    i = i + 1;
  }

if (!_gst_had_error)
    _gst_nvmsg_send (receiverOOP, selectorOOP, args, i);

lex_skip_mandatory (p, '>');
return !_gst_had_error;

}

#2 submitted by Gwenael Casaccio on Tue, 09/14/2010 - 12:20
Attachment:gst-parser.txt (954 bytes)

Here is the patch of gst-parser.c

#3 submitted by Paolo Bonzini on Tue, 09/14/2010 - 12:38
Assigned to:Unassigned» bonzinip
Status:active» reviewed

It's missing the malloc->alloca conversion, but I can take care of that. Thanks!

#4 submitted by Paolo Bonzini on Sat, 09/25/2010 - 15:13
Status:reviewed» fixed

Committed, thanks.

User login