mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
ZoneCodeGenerator: Remove align statement. Alignments will be defined via types created by a typedef that have a __declspec(align(X)) part
This commit is contained in:
parent
d1e097bbdf
commit
3d30915308
@ -195,7 +195,6 @@ set count verts0 vertCount;
|
|||||||
set count vb0 0;
|
set count vb0 0;
|
||||||
set count vertList vertListCount;
|
set count vertList vertListCount;
|
||||||
set count triIndices triCount;
|
set count triIndices triCount;
|
||||||
set align triIndices 16;
|
|
||||||
set count indexBuffer 0;
|
set count indexBuffer 0;
|
||||||
reorder:
|
reorder:
|
||||||
vertInfo
|
vertInfo
|
||||||
|
@ -11,7 +11,6 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Impl
|
|||||||
class CommandParserState : ICommandParserState
|
class CommandParserState : ICommandParserState
|
||||||
{
|
{
|
||||||
private static readonly ITokenTest<ICommandParserState>[] tests = {
|
private static readonly ITokenTest<ICommandParserState>[] tests = {
|
||||||
new TestAlign(),
|
|
||||||
new TestAsset(),
|
new TestAsset(),
|
||||||
new TestBlock(),
|
new TestBlock(),
|
||||||
new TestCondition(),
|
new TestCondition(),
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ZoneCodeGenerator.Parsing.Matching;
|
|
||||||
using ZoneCodeGenerator.Parsing.Matching.Matchers;
|
|
||||||
using ZoneCodeGenerator.Parsing.Testing;
|
|
||||||
|
|
||||||
namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
|
|
||||||
{
|
|
||||||
class TestAlign : AbstractTokenTest<ICommandParserState>
|
|
||||||
{
|
|
||||||
private const string MemberTypeNameToken = "name";
|
|
||||||
private const string AlignValueToken = "align";
|
|
||||||
|
|
||||||
private static readonly TokenMatcher[] matchers = {
|
|
||||||
new MatcherLiteral("set"),
|
|
||||||
new MatcherLiteral("align"),
|
|
||||||
new MatcherTypename().WithName(MemberTypeNameToken),
|
|
||||||
new MatcherNumber().WithName(AlignValueToken),
|
|
||||||
new MatcherLiteral(";")
|
|
||||||
};
|
|
||||||
|
|
||||||
public TestAlign() : base(matchers)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void ProcessMatch(ICommandParserState state)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
using Moq;
|
|
||||||
using ZoneCodeGenerator.Parsing;
|
|
||||||
using ZoneCodeGenerator.Parsing.CommandFile;
|
|
||||||
using ZoneCodeGenerator.Parsing.CommandFile.Tests;
|
|
||||||
using ZoneCodeGenerator.Parsing.Testing;
|
|
||||||
|
|
||||||
namespace ZoneCodeGeneratorTests.Parsing.CommandFile.Tests
|
|
||||||
{
|
|
||||||
[TestClass]
|
|
||||||
public class TestAlignTest
|
|
||||||
{
|
|
||||||
private Mock<ICommandParserState> parserStateMock;
|
|
||||||
|
|
||||||
private Mock<ILexer> lexerMock;
|
|
||||||
private int tokenOffset;
|
|
||||||
private List<string> tokens;
|
|
||||||
|
|
||||||
[TestInitialize]
|
|
||||||
public void Setup()
|
|
||||||
{
|
|
||||||
parserStateMock = new Mock<ICommandParserState>();
|
|
||||||
|
|
||||||
tokenOffset = 0;
|
|
||||||
tokens = new List<string>();
|
|
||||||
lexerMock = new Mock<ILexer>();
|
|
||||||
|
|
||||||
lexerMock.Setup(lexer => lexer.PeekToken(It.IsAny<int>()))
|
|
||||||
.Returns((int index) => tokens.ElementAtOrDefault(index + tokenOffset));
|
|
||||||
lexerMock.Setup(lexer => lexer.NextToken())
|
|
||||||
.Returns(() => tokens.ElementAtOrDefault(tokenOffset++));
|
|
||||||
lexerMock.Setup(lexer => lexer.SkipTokens(It.IsAny<int>()))
|
|
||||||
.Callback((int count) => tokenOffset += count);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void EnsureAcceptsSimpleAlignStatement()
|
|
||||||
{
|
|
||||||
tokens.AddRange(new List<string>
|
|
||||||
{
|
|
||||||
"set", "align", "test", ":", ":", "type", "16", ";"
|
|
||||||
});
|
|
||||||
|
|
||||||
var test = new TestAlign();
|
|
||||||
|
|
||||||
Assert.AreEqual(TokenTestResult.Match, test.PerformTest(parserStateMock.Object, lexerMock.Object));
|
|
||||||
Assert.AreEqual(8, test.ConsumedTokenCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user