cpplib.h (cpp_comments, [...]): New structs.

2008-10-05  Matthew Gingell  <gingell@adacore.com>
	    Arnaud Charlet  <charlet@adacore.com>

	* include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
	(cpp_get_comments): New function.
	* internal.h (struct cpp_reader): Add comments field.
	* init.c (cpp_destroy): Free comments.
	* lex.c (store_comment, cpp_get_comments): New functions.
	(comments): New struct.
	(save_comment): Store comments in comments struct.

Co-Authored-By: Arnaud Charlet <charlet@adacore.com>

From-SVN: r140883
This commit is contained in:
Matthew Gingell 2008-10-05 12:35:36 +00:00 committed by Arnaud Charlet
parent 7a90b0ca0c
commit 631d0d3610
5 changed files with 102 additions and 0 deletions

View file

@ -245,6 +245,7 @@ cpp_destroy (cpp_reader *pfile)
{
cpp_context *context, *contextn;
tokenrun *run, *runn;
int i;
free (pfile->op_stack);
@ -287,6 +288,14 @@ cpp_destroy (cpp_reader *pfile)
free (context);
}
if (pfile->comments.entries)
{
for (i = 0; i < pfile->comments.count; i++)
free (pfile->comments.entries[i].comment);
free (pfile->comments.entries);
}
free (pfile);
}