Skip to content

Commit 0bfad8b

Browse files
phoglundtvandijck
authored andcommitted
Add float32 and float64
1 parent 5b6e67a commit 0bfad8b

File tree

4 files changed

+57
-5
lines changed

4 files changed

+57
-5
lines changed

ServerCodeExciserTest/Problems/Common/DeclarationInFunctionRootScopeWithReturnValTest.common

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ class UDeclarationInFunctionRootScopeWithReturnValTest
3636
return ThisMustBeGuarded;
3737
}
3838

39+
float32 TestFloat32()
40+
{
41+
ensure(System::IsServer());
42+
43+
float32 ThisMustBeGuarded = 0.0f;
44+
ThisMustBeGuarded--;
45+
46+
return ThisMustBeGuarded;
47+
}
48+
49+
float64 TestFloat64()
50+
{
51+
ensure(System::IsServer());
52+
53+
float64 ThisMustBeGuarded = 0.0f;
54+
ThisMustBeGuarded--;
55+
56+
return ThisMustBeGuarded;
57+
}
58+
3959
FString TestString()
4060
{
4161
ensure(System::IsServer());

ServerCodeExciserTest/Solutions/Common/DeclarationInFunctionRootScopeWithReturnValTest.common

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class UDeclarationInFunctionRootScopeWithReturnValTest
3434
#endif // WITH_SERVER
3535
}
3636

37-
float TestFloat()
37+
double TestFloat()
3838
{
3939
ensure(System::IsServer());
4040
#ifdef WITH_SERVER
@@ -48,6 +48,34 @@ class UDeclarationInFunctionRootScopeWithReturnValTest
4848
#endif // WITH_SERVER
4949
}
5050

51+
float32 TestFloat32()
52+
{
53+
ensure(System::IsServer());
54+
#ifdef WITH_SERVER
55+
56+
float32 ThisMustBeGuarded = 0.0f;
57+
ThisMustBeGuarded--;
58+
59+
return ThisMustBeGuarded;
60+
#else
61+
return 0.0f;
62+
#endif // WITH_SERVER
63+
}
64+
65+
float64 TestFloat64()
66+
{
67+
ensure(System::IsServer());
68+
#ifdef WITH_SERVER
69+
70+
float64 ThisMustBeGuarded = 0.0;
71+
ThisMustBeGuarded--;
72+
73+
return ThisMustBeGuarded;
74+
#else
75+
return 0.0;
76+
#endif // WITH_SERVER
77+
}
78+
5179
FString TestString()
5280
{
5381
ensure(System::IsServer());

UnrealAngelscriptParser/Grammar/UnrealAngelscriptLexer.g4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ UInt16: 'uint16';
7171
UInt32: 'uint32';
7272
UInt64: 'uint64';
7373
Float: 'float';
74+
Float32: 'float32';
75+
Float64: 'float64';
7476
Double: 'double';
7577
Bool: 'bool';
7678

UnrealAngelscriptParser/Grammar/UnrealAngelscriptParser.g4

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ script:
3838
annotationList:
3939
annotation (Comma annotation)*;
4040

41-
annotation:
41+
annotation:
4242
Identifier (Assign expression)?;
4343

44-
utype:
44+
utype:
4545
(UClass | UStruct) LeftParen annotationList? RightParen;
4646

4747
uproperty:
@@ -57,7 +57,7 @@ moduleImport:
5757

5858
asGeneric:
5959
Identifier Less simpleTypeSpecifierList Greater;
60-
60+
6161
simpleTypeSpecifierList:
6262
declSpecifierSeq (Comma declSpecifierSeq)*;
6363

@@ -300,7 +300,7 @@ emptyDeclaration: Semi;
300300
declSpecifier:
301301
typeSpecifier
302302
| functionSpecifier;
303-
303+
304304
declSpecifierSeq: declSpecifier+?;
305305

306306
functionSpecifier: Virtual;
@@ -338,6 +338,8 @@ simpleTypeSpecifier:
338338
| UInt32
339339
| UInt64
340340
| Float
341+
| Float32
342+
| Float64
341343
| Double
342344
| Bool
343345
| Void

0 commit comments

Comments
 (0)