diff --git a/BeefLibs/corlib/src/BumpAllocator.bf b/BeefLibs/corlib/src/BumpAllocator.bf index d87cb722..8b8f7223 100644 --- a/BeefLibs/corlib/src/BumpAllocator.bf +++ b/BeefLibs/corlib/src/BumpAllocator.bf @@ -83,7 +83,7 @@ namespace System protected virtual void* AllocLarge(int size, int align) { - return new uint8[size]* {?}; + return new uint8[size]* (?); } protected virtual void FreeLarge(void* ptr) @@ -95,7 +95,7 @@ namespace System { int poolSize = (mPools != null) ? mPools.Count : 0; int allocSize = Math.Clamp((int)Math.Pow(poolSize, 1.5) * 4*1024, 4*1024, 64*1024); - return Span(new uint8[allocSize]* {?}, allocSize); + return Span(new uint8[allocSize]* (?), allocSize); } protected virtual void FreePool(Span span) diff --git a/BeefLibs/corlib/src/DateTime.bf b/BeefLibs/corlib/src/DateTime.bf index 49c3de37..f209d2b6 100644 --- a/BeefLibs/corlib/src/DateTime.bf +++ b/BeefLibs/corlib/src/DateTime.bf @@ -59,10 +59,10 @@ namespace System private const int32 DatePartMonth = 2; private const int32 DatePartDay = 3; - private static readonly int32[] DaysToMonth365 = new int32[]{ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365} ~ delete _; - private static readonly int32[] DaysToMonth366 = new int32[]{ - 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} ~ delete _; + private static readonly int32[] DaysToMonth365 = new int32[]( + 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365) ~ delete _; + private static readonly int32[] DaysToMonth366 = new int32[]( + 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366) ~ delete _; public static readonly DateTime MinValue = DateTime(MinTicks, DateTimeKind.Unspecified); public static readonly DateTime MaxValue = DateTime(MaxTicks, DateTimeKind.Unspecified); diff --git a/BeefLibs/corlib/src/Globalization/CalendarData.bf b/BeefLibs/corlib/src/Globalization/CalendarData.bf index 17f5165b..36c0fc67 100644 --- a/BeefLibs/corlib/src/Globalization/CalendarData.bf +++ b/BeefLibs/corlib/src/Globalization/CalendarData.bf @@ -210,7 +210,7 @@ namespace System.Globalization else { // For all others just use the an empty string (doesn't matter we'll never ask for it for other calendars) - this.saAbbrevEnglishEraNames = new String[] { "" }; + this.saAbbrevEnglishEraNames = new String[] ( "" ); } // Japanese is the only thing with > 1 era. Its current era # is how many ever diff --git a/BeefLibs/corlib/src/Globalization/DateTimeFormat.bf b/BeefLibs/corlib/src/Globalization/DateTimeFormat.bf index f5911f7f..e96eee40 100644 --- a/BeefLibs/corlib/src/Globalization/DateTimeFormat.bf +++ b/BeefLibs/corlib/src/Globalization/DateTimeFormat.bf @@ -126,18 +126,18 @@ namespace System { static readonly TimeSpan NullOffset = TimeSpan.MinValue; static char8[] allStandardFormats = new char8[] - { + ( 'd', 'D', 'f', 'F', 'g', 'G', 'm', 'M', 'o', 'O', 'r', 'R', 's', 't', 'T', 'u', 'U', 'y', 'Y', - } ~ delete _; + ) ~ delete _; const String RoundtripFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK"; const String RoundtripDateTimeUnfixed = "yyyy'-'MM'-'ddTHH':'mm':'ss zzz"; private const int DEFAULT_ALL_DATETIMES_SIZE = 132; - static String[] fixedNumberFormats = new String[] { + static String[] fixedNumberFormats = new String[] ( "0", "00", "000", @@ -145,7 +145,7 @@ namespace System { "00000", "000000", "0000000", - } ~ delete _; + ) ~ delete _; //////////////////////////////////////////////////////////////////////////// // diff --git a/BeefLibs/corlib/src/Globalization/GregorianCalendar.bf b/BeefLibs/corlib/src/Globalization/GregorianCalendar.bf index 3ee2dce3..70d1d762 100644 --- a/BeefLibs/corlib/src/Globalization/GregorianCalendar.bf +++ b/BeefLibs/corlib/src/Globalization/GregorianCalendar.bf @@ -54,14 +54,14 @@ namespace System.Globalization { GregorianCalendarTypes m_type; static readonly int[] DaysToMonth365 = new int[] - { + ( 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 - } ~ delete _; + ) ~ delete _; static readonly int[] DaysToMonth366 = new int[] - { + ( 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 - } ~ delete _; + ) ~ delete _; private static volatile Calendar s_defaultInstance; @@ -426,7 +426,7 @@ namespace System.Globalization { { get { - return (new int[] {ADEra} ); + return (new int[] (ADEra) ); } } diff --git a/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf b/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf index d78bbdb9..18ca0f3b 100644 --- a/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf +++ b/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf @@ -90,9 +90,9 @@ namespace System.Globalization { // DO NOT UPDATE THIS WITHOUT UPDATING THAT STRUCTURE. IF YOU ADD BOOL, ADD THEM AT THE END. // ALSO MAKE SURE TO UPDATE mscorlib.h in the VM directory to check field offsets. // READTHIS READTHIS READTHIS - protected int32[] numberGroupSizes = new int32[] {3} ~ delete _; - protected int32[] currencyGroupSizes = new int32[] {3} ~ delete _; - protected int32[] percentGroupSizes = new int32[] {3} ~ delete _; + protected int32[] numberGroupSizes = new int32[] (3) ~ delete _; + protected int32[] currencyGroupSizes = new int32[] (3) ~ delete _; + protected int32[] percentGroupSizes = new int32[] (3) ~ delete _; protected OwnedString positiveSign = .("+") ~ _.Dispose(); protected OwnedString negativeSign = .("-") ~ _.Dispose(); protected OwnedString numberDecimalSeparator = .(".") ~ _.Dispose(); @@ -112,7 +112,7 @@ namespace System.Globalization { protected OwnedString percentSymbol = .("%") ~ _.Dispose(); protected OwnedString perMilleSymbol = .("\u{2030}") ~ _.Dispose(); - protected String[] nativeDigits = new .[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} ~ DeleteNativeDigits(); + protected String[] nativeDigits = new .[] ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9") ~ DeleteNativeDigits(); protected int32 numberDecimalDigits = 2; protected int32 currencyDecimalDigits = 2; diff --git a/BeefLibs/corlib/src/IO/OpenFileDialog.bf b/BeefLibs/corlib/src/IO/OpenFileDialog.bf index 56255673..8c32cbc3 100644 --- a/BeefLibs/corlib/src/IO/OpenFileDialog.bf +++ b/BeefLibs/corlib/src/IO/OpenFileDialog.bf @@ -375,7 +375,7 @@ namespace System.IO } else { - buf = new char16[123]* { ? }; + buf = new char16[123]* ( ? ); defer:mixin delete buf; } buf diff --git a/BeefLibs/corlib/src/Reflection/TypeInstance.bf b/BeefLibs/corlib/src/Reflection/TypeInstance.bf index 61bd42a4..7171cc0a 100644 --- a/BeefLibs/corlib/src/Reflection/TypeInstance.bf +++ b/BeefLibs/corlib/src/Reflection/TypeInstance.bf @@ -139,7 +139,7 @@ namespace System.Reflection if (!methodInfo.IsInitialized) return .Err; - void* data = new [Align(16)] uint8[mInstSize]* {?}; + void* data = new [Align(16)] uint8[mInstSize]* (?); if (methodInfo.Invoke(data) case .Err) { diff --git a/BeefLibs/corlib/src/String.bf b/BeefLibs/corlib/src/String.bf index 6d6e0eb0..1eecf30c 100644 --- a/BeefLibs/corlib/src/String.bf +++ b/BeefLibs/corlib/src/String.bf @@ -321,7 +321,7 @@ namespace System protected virtual void* Alloc(int size, int align) { - return new char8[size]* {?}; + return new char8[size]* (?); } protected virtual void Free(void* ptr) @@ -2196,11 +2196,11 @@ namespace System char16* buf; if (encodedLen < 128) { - buf = scope:mixin char16[encodedLen]* { ? }; + buf = scope:mixin char16[encodedLen]* ( ? ); } else { - buf = new char16[encodedLen]* { ? }; + buf = new char16[encodedLen]* ( ? ); defer:mixin delete buf; } @@ -3212,11 +3212,11 @@ namespace System char16* buf; if (encodedLen < 128) { - buf = scope:mixin char16[encodedLen]* { ? }; + buf = scope:mixin char16[encodedLen]* ( ? ); } else { - buf = new char16[encodedLen]* { ? }; + buf = new char16[encodedLen]* ( ? ); defer:mixin delete buf; } diff --git a/BeefLibs/corlib/src/System.bf b/BeefLibs/corlib/src/System.bf index dd55ff42..f8bf4ba1 100644 --- a/BeefLibs/corlib/src/System.bf +++ b/BeefLibs/corlib/src/System.bf @@ -208,11 +208,11 @@ static void* data; if (size <= 128) { - data = scope:mixin [Align(align)] uint8[size]* { ? }; + data = scope:mixin [Align(align)] uint8[size]* ( ? ); } else { - data = new [Align(align)] uint8[size]* { ? }; + data = new [Align(align)] uint8[size]* ( ? ); defer:mixin delete data; } data diff --git a/BeefLibs/corlib/src/Text/UTF8.bf b/BeefLibs/corlib/src/Text/UTF8.bf index 8f31a032..031ec57f 100644 --- a/BeefLibs/corlib/src/Text/UTF8.bf +++ b/BeefLibs/corlib/src/Text/UTF8.bf @@ -3,7 +3,7 @@ namespace System.Text class UTF8 { public static int8* sTrailingBytesForUTF8 = new int8[]* - { + ( 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -12,13 +12,13 @@ namespace System.Text 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 - } ~ delete _; + ) ~ delete _; public static uint32* sOffsetsFromUTF8 = new uint32[]* - { - 0x00000000, 0x00003080, 0x000E2080, + ( + 0x00000000, 0x00003080, 0x000E2080, 0x03C82080, 0xFA082080, 0x82082080 - } ~ delete _; + ) ~ delete _; public static int GetEncodedLength(char32 c) { diff --git a/IDEHelper/Compiler/BfReducer.cpp b/IDEHelper/Compiler/BfReducer.cpp index c25455bd..2d63286d 100644 --- a/IDEHelper/Compiler/BfReducer.cpp +++ b/IDEHelper/Compiler/BfReducer.cpp @@ -7512,6 +7512,8 @@ BfObjectCreateExpression* BfReducer::CreateObjectCreateExpression(BfAstNode* all if (auto block = BfNodeDynCast(mVisitorPos.GetNext())) { + mPassInstance->Warn(0, "Expected '('", block->mOpenBrace); + mVisitorPos.MoveNext(); MEMBER_SET(objectCreateExpr, mOpenToken, block->mOpenBrace); //