Skip to content

Commit

Permalink
Fix some more test regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Jun 14, 2014
1 parent 3510646 commit 7511073
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 48 deletions.
115 changes: 68 additions & 47 deletions src/parse.c
Expand Up @@ -2688,52 +2688,6 @@ static void p_constant_declaration(tree_t parent)
}
}

static void p_entity_declarative_item(tree_t entity)
{
// subprogram_declaration | subprogram_body | type_declaration
// | subtype_declaration | constant_declaration | signal_declaration
// | shared_variable_declaration | file_declaration | alias_declaration
// | attribute_declaration | attribute_specification
// | disconnection_specification | use_clause | group_template_declaration
// | group_declaration

BEGIN("entity declarative item");

switch (peek()) {
case tATTRIBUTE:
if (peek_nth(3) == tOF)
p_attribute_specification(entity);
else
tree_add_decl(entity, p_attribute_declaration());
break;

case tTYPE:
tree_add_decl(entity, p_type_declaration());
break;

case tSUBTYPE:
tree_add_decl(entity, p_subtype_declaration());
break;

case tCONSTANT:
p_constant_declaration(entity);
break;

default:
expect(tATTRIBUTE, tTYPE, tSUBTYPE, tCONSTANT);
}
}

static void p_entity_declarative_part(tree_t entity)
{
// { entity_declarative_item }

BEGIN("entity declarative part");

while (not_at_token(tEND, tBEGIN))
p_entity_declarative_item(entity);
}

static tree_t p_assertion(void)
{
// assert condition [ report expression ] [ severity expression ]
Expand Down Expand Up @@ -2966,6 +2920,66 @@ static tree_t p_alias_declaration(void)
return t;
}

static void p_entity_declarative_item(tree_t entity)
{
// subprogram_declaration | subprogram_body | type_declaration
// | subtype_declaration | constant_declaration | signal_declaration
// | shared_variable_declaration | file_declaration | alias_declaration
// | attribute_declaration | attribute_specification
// | disconnection_specification | use_clause | group_template_declaration
// | group_declaration

BEGIN("entity declarative item");

switch (peek()) {
case tATTRIBUTE:
if (peek_nth(3) == tOF)
p_attribute_specification(entity);
else
tree_add_decl(entity, p_attribute_declaration());
break;

case tTYPE:
tree_add_decl(entity, p_type_declaration());
break;

case tSUBTYPE:
tree_add_decl(entity, p_subtype_declaration());
break;

case tCONSTANT:
p_constant_declaration(entity);
break;

case tFUNCTION:
case tPROCEDURE:
case tIMPURE:
case tPURE:
{
tree_t spec = p_subprogram_specification();
if (peek() == tSEMI)
tree_add_decl(entity, p_subprogram_declaration(spec));
else
tree_add_decl(entity, p_subprogram_body(spec));
}
break;

default:
expect(tATTRIBUTE, tTYPE, tSUBTYPE, tCONSTANT, tFUNCTION, tPROCEDURE,
tIMPURE, tPURE);
}
}

static void p_entity_declarative_part(tree_t entity)
{
// { entity_declarative_item }

BEGIN("entity declarative part");

while (not_at_token(tEND, tBEGIN))
p_entity_declarative_item(entity);
}

static void p_subprogram_declarative_item(tree_t sub)
{
// subprogram_declaration | subprogram_body | type_declaration
Expand Down Expand Up @@ -3753,6 +3767,7 @@ static void p_block_declarative_item(tree_t parent)
break;

case tFUNCTION:
case tPROCEDURE:
case tIMPURE:
case tPURE:
{
Expand Down Expand Up @@ -3787,9 +3802,14 @@ static void p_block_declarative_item(tree_t parent)
p_use_clause(parent, tree_add_decl);
break;

case tSHARED:
p_variable_declaration(parent);
break;

default:
expect(tSIGNAL, tTYPE, tSUBTYPE, tFILE, tCONSTANT, tFUNCTION, tIMPURE,
tPURE, tALIAS, tATTRIBUTE, tFOR, tCOMPONENT, tUSE);
tPURE, tPROCEDURE, tALIAS, tATTRIBUTE, tFOR, tCOMPONENT, tUSE,
tSHARED);
}
}

Expand Down Expand Up @@ -4592,6 +4612,7 @@ static tree_t p_concurrent_procedure_call_statement(ident_t label)
assert(false); // XXX: FIXME

tree_change_kind(t, T_CPCALL);
tree_set_ident2(t, tree_ident(t));

consume(tSEMI);

Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.am
@@ -1,4 +1,4 @@
check_PROGRAMS = test_lib test_ident test_parse test_sem #test_simp \
check_PROGRAMS = test_lib test_ident test_parse test_sem test_simp \
test_elab test_heap test_hash test_group test_bounds test_value
TESTS_ENVIRONMENT = BUILD_DIR=$(top_builddir)
TESTS = $(check_PROGRAMS) run_regr.rb
Expand Down

0 comments on commit 7511073

Please sign in to comment.