仿真平台内核初版 -tlib库 包含<sparc arm riscv powerPC>

This commit is contained in:
liuwb
2026-02-07 20:43:43 +08:00
parent de61f9e2b0
commit b3117648be
9748 changed files with 4309137 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
namespace CxxDemangler.Tests.Parsing
{
[TestClass]
public class ExprPrimary : TestBase
{
[TestMethod]
public void ExprPrimaryLiteral()
{
Verify("LS_12345E...",
new Parsers.ExprPrimary.Literal(
new Parsers.Substitution(0),
name: "12345"));
}
[TestMethod]
public void ExprPrimaryLiteral2()
{
Verify("LS_E...",
new Parsers.ExprPrimary.Literal(
new Parsers.Substitution(0),
name: ""));
}
[TestMethod]
public void ExprPrimaryExternal()
{
Verify("L_Z3abcE...",
new Parsers.ExprPrimary.External(
new Parsers.SourceName.Identifier("abc")));
}
[TestMethod]
public void ExprPrimaryFailures()
{
Assert.IsNull(Parse("zzz"));
Assert.IsNull(Parse("LS_zzz"));
Assert.IsNull(Parse("LS_12345"));
Assert.IsNull(Parse("LS_"));
Assert.IsNull(Parse("L"));
Assert.IsNull(Parse(""));
}
internal override IEnumerable<IParsingResult> SubstitutionTableList()
{
yield return new Parsers.Expression.Retrow();
}
internal override IParsingResult Parse(ParsingContext context)
{
return Parsers.ExprPrimary.Parse(context);
}
}
}