From 9e25884f12f7a33dab0038462d03e696a52a6ba2 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 11 Dec 2013 22:59:20 +0000 Subject: [PATCH] Fix for br942 - allow function declaration in VHDL architecture. --- vhdlpp/architec_emit.cc | 7 ++++++- vhdlpp/parse.y | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vhdlpp/architec_emit.cc b/vhdlpp/architec_emit.cc index b53f94acf..21d65b7f2 100644 --- a/vhdlpp/architec_emit.cc +++ b/vhdlpp/architec_emit.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -97,6 +97,11 @@ int Architecture::emit(ostream&out, Entity*entity) errors += emit_signals(out, entity, this); errors += emit_variables(out, entity, this); + for (map::const_iterator cur = cur_subprograms_.begin() + ; cur != cur_subprograms_.end() ; ++ cur) { + errors += cur->second->emit_package(out); + } + for (list::iterator cur = statements_.begin() ; cur != statements_.end() ; ++cur) { diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index 873d21eaf..453344930 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -496,6 +496,10 @@ block_declarative_item | constant_declaration + | subprogram_declaration + + | subprogram_body + | type_declaration | use_clause_lib