mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
ZoneCodeGenerator: Remove the const keyword from typename but instead save whether a reference is cosnt in the typedeclaration
This commit is contained in:
@ -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