mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-10-21 19:18:19 +00:00
ZoneCodeGenerator: Remove the const keyword from typename but instead save whether a reference is cosnt in the typedeclaration
This commit is contained in:
1 parent
3d30915308
commit
f71ae1bcf5
7 files changed
+117
-104
No files matched your search
@@ -99,22 +99,6 @@ namespace ZoneCodeGeneratorTests.Parsing.Matching.Matchers
|
||||
Assert.AreEqual("signed int", result.NamedMatches["type_token"].ElementAtOrDefault(0));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void EnsureConstTypeNamesAreRecognized()
|
||||
{
|
||||
tokens.AddRange(new List<string>
|
||||
{
|
||||
"const", "int"
|
||||
});
|
||||
|
||||
var matcher = new MatcherTypename().WithName("type_token");
|
||||
var result = matcher.Test(matchingContext, 0);
|
||||
|
||||
Assert.IsTrue(result.Successful);
|
||||
Assert.AreEqual(2, result.ConsumedTokenCount);
|
||||
Assert.AreEqual("const int", result.NamedMatches["type_token"].ElementAtOrDefault(0));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void EnsureDoubleLongIsRecognized()
|
||||
{
|
||||
@@ -136,15 +120,15 @@ namespace ZoneCodeGeneratorTests.Parsing.Matching.Matchers
|
||||
{
|
||||
tokens.AddRange(new List<string>
|
||||
{
|
||||
"const", "unsigned", "long", "long"
|
||||
"unsigned", "long", "long"
|
||||
});
|
||||
|
||||
var matcher = new MatcherTypename().WithName("type_token");
|
||||
var result = matcher.Test(matchingContext, 0);
|
||||
|
||||
Assert.IsTrue(result.Successful);
|
||||
Assert.AreEqual(4, result.ConsumedTokenCount);
|
||||
Assert.AreEqual("const unsigned long long", result.NamedMatches["type_token"].ElementAtOrDefault(0));
|
||||
Assert.AreEqual(3, result.ConsumedTokenCount);
|
||||
Assert.AreEqual("unsigned long long", result.NamedMatches["type_token"].ElementAtOrDefault(0));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
Reference in new issue
Block a user