From fe0c96790bf0db36b374e2ed96916b0c524702a6 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 19 Jun 2015 11:46:01 +0200 Subject: [ilasm] Add support for multiple custom type modifiers attached to single type --- mcs/ilasm/parser/ILParser.jay | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'mcs/ilasm') diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay index 4cd03495ef3..7e69c763418 100644 --- a/mcs/ilasm/parser/ILParser.jay +++ b/mcs/ilasm/parser/ILParser.jay @@ -921,7 +921,7 @@ class_decl : method_all type : generic_class_ref { - $$ = $1; + $$ = GetTypeRef ((BaseTypeRef) $1); } | K_OBJECT { @@ -952,38 +952,38 @@ type : generic_class_ref } | type OPEN_BRACKET CLOSE_BRACKET { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; base_type.MakeArray (); $$ = base_type; } | type OPEN_BRACKET bounds CLOSE_BRACKET { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; ArrayList bound_list = (ArrayList) $3; base_type.MakeBoundArray (bound_list); $$ = base_type; } | type AMPERSAND { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; base_type.MakeManagedPointer (); $$ = base_type; } | type STAR { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; base_type.MakeUnmanagedPointer (); $$ = base_type; } | type K_PINNED { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; base_type.MakePinned (); $$ = base_type; } | type K_MODREQ OPEN_PARENS custom_modifier_type CLOSE_PARENS { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; BaseTypeRef class_ref = (BaseTypeRef) $4; base_type.MakeCustomModified (codegen, CustomModifier.modreq, class_ref); @@ -991,7 +991,7 @@ type : generic_class_ref } | type K_MODOPT OPEN_PARENS custom_modifier_type CLOSE_PARENS { - BaseTypeRef base_type = GetTypeRef ((BaseTypeRef) $1); + BaseTypeRef base_type = (BaseTypeRef) $1; BaseTypeRef class_ref = (BaseTypeRef) $4; base_type.MakeCustomModified (codegen, CustomModifier.modopt, class_ref); @@ -1004,8 +1004,6 @@ type : generic_class_ref | primitive_type ; - ; - primitive_type : K_INT8 { $$ = new PrimitiveTypeRef (PrimitiveType.Int8, "System.SByte"); -- cgit v1.2.3