[Patch,gfortran] ENUMERATIONS and ENUMERATORS
Gaurav Gautam, Noida
gauravga@noida.hcltech.com
Sun Oct 16 11:48:00 GMT 2005
hi,
I have updated the patch according your comments.
please find code diff and change log with this mail.
Should I also put it in the patch queue again?
> I also have a few remarks WRT the code which would also apply to a revised
> version:
> - there are a number of cases where you're not following the coding standards
> (trailing whitespace, spaces around '->', maybe others)
--changes made for this comments
> - I think the function prototypes you added can safely be put into parse.h,
> otherwise don't hesistate to put them in gfortran.h
--prototypes added to these two files.
> - the logic here would be much easier if you moved the check for COMP_ENUM
> before the other if
>> if (d == DECL_NONE || d == DECL_COLON)
>> ! {
>> ! if (gfc_current_state () == COMP_ENUM)
>> ! {
>> ! t = gfc_add_flavor (¤t_attr, FL_PARAMETER, NULL, NULL);
>> ! if (t == FAILURE)
>> ! {
>> ! m = MATCH_ERROR;
>> ! goto cleanup;
>> ! }
>> ! current_attr.enumerator = 1;
>> ! }
>> ! break;
>> ! }
>> ! else if (gfc_current_state () == COMP_ENUM)
>> ! {
>> ! gfc_error ("Enumerator cannot have attributes %C");
>> ! return MATCH_ERROR;
>> ! }
> the same goes for the change to variable_decl.
--changed accordingly
> I'm wondering if using gfc_match_data_decl makes much sense given the very
> restricted syntax that is allowed inside enumeration declarations.
--since enumerators have implemted as integer constants, so most of the functionality of
gfc_data_decl has been used. writing a different function didnt seem appropriate to me, since this would have lead to a large amount of repeated code.
Regards,
Gaurav Gautam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changelog_code_20051016
Type: application/octet-stream
Size: 2364 bytes
Desc: changelog_code_20051016
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20051016/4cc20495/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code_diff_20051016
Type: application/octet-stream
Size: 22331 bytes
Desc: code_diff_20051016
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20051016/4cc20495/attachment-0001.obj>
More information about the Fortran
mailing list