mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Merge pull request #1326 from EinScott/corlib-additions
handle uint64 constExpr printing
This commit is contained in:
commit
5af38dd554
2 changed files with 22 additions and 0 deletions
|
@ -1126,6 +1126,17 @@ namespace System.Reflection
|
|||
(*(float*)&mValue).ToString(strBuffer);
|
||||
case typeof(double):
|
||||
(*(double*)&mValue).ToString(strBuffer);
|
||||
case typeof (bool):
|
||||
strBuffer.Append((*(bool*)&mValue) ? "true" : "false");
|
||||
case typeof(char8), typeof(char16), typeof(char32):
|
||||
strBuffer.Append('\'');
|
||||
var str = (*(char32*)&mValue).ToString(.. scope .());
|
||||
let len = str.Length;
|
||||
String.QuoteString(&str[0], len, str);
|
||||
strBuffer.Append(str[(len + 1)...^2]);
|
||||
strBuffer.Append('\'');
|
||||
case typeof(uint64), typeof(uint):
|
||||
(*(uint64*)&mValue).ToString(strBuffer);
|
||||
default:
|
||||
mValue.ToString(strBuffer);
|
||||
}
|
||||
|
|
|
@ -1128,6 +1128,17 @@ namespace System.Reflection
|
|||
(*(float*)&mValue).ToString(strBuffer);
|
||||
case typeof(double):
|
||||
(*(double*)&mValue).ToString(strBuffer);
|
||||
case typeof (bool):
|
||||
strBuffer.Append((*(bool*)&mValue) ? "true" : "false");
|
||||
case typeof(char8), typeof(char16), typeof(char32):
|
||||
strBuffer.Append('\'');
|
||||
var str = (*(char32*)&mValue).ToString(.. scope .());
|
||||
let len = str.Length;
|
||||
String.QuoteString(&str[0], len, str);
|
||||
strBuffer.Append(str[(len + 1)...^2]);
|
||||
strBuffer.Append('\'');
|
||||
case typeof(uint64), typeof(uint):
|
||||
(*(uint64*)&mValue).ToString(strBuffer);
|
||||
default:
|
||||
mValue.ToString(strBuffer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue