daily update on 20240203 by nitload youmu, ExpComment Comment Splitter ok, case code(* comment[comment*)code--comment and comment*)code--comment not added, may use span optimize all programme

This commit is contained in:
Nitload
2025-02-03 23:27:54 +08:00
parent 4ee675669f
commit 4e5a1b0dfb
48 changed files with 1247 additions and 662 deletions
+52 -5
View File
@@ -60,12 +60,59 @@ namespace STgSharpTest
}
[TestMethod]
public void TestMethod()
public void TestSource()
{
ExpFileReader reader = new ExpFileReader(testExpPath);
ExpSchemaSource schemaSource = new ExpSchemaSource();
schemaSource.ReadSchema(reader);
ScriptSourceTransmitter st = new ScriptSourceTransmitter("end", 0);
for (int i = 0; i < 10; i++)
{
st.WriteLine($"Code{i} {new string(' ', i + 1)}-- Comment{i}");
}
st.WriteLine("Code (* comment");
for (int i = 0; i < 10; i++)
{
st.WriteLine($"comment-code");
}
st.WriteLine($"comment *) code");
for (int i = 0; i < 10; i++)
{
st.WriteLine($" Code{i} (* (* Comment *) *) Code{i}");
}
st.WriteLine("end");
ExpSourceReader reader = new ExpSourceReader(st);
while (!st.IsEmpty)
{
Console.WriteLine(reader.ReadLine());
}
}
}
[TestMethod]
public void TestMethod()
{
ScriptSourceTransmitter st = new ScriptSourceTransmitter("end", 0);
for (int i = 0; i < 10; i++)
{
st.WriteLine($"Code{i} {new string(' ',i+1)}-- Comment{i}");
}
st.WriteLine("Code (* comment");
for (int i = 0; i < 10; i++)
{
st.WriteLine($"comment-code");
}
st.WriteLine($"comment *) code");
for (int i = 0; i < 10; i++)
{
st.WriteLine($" Code{i} (* (* Comment *) *) Code{i}");
}
st.WriteLine("end");
ExpSourceReader reader = new ExpSourceReader(st);
while (!st.IsEmpty)
{
Console.WriteLine(reader.ReadNoCommentLine());
}
}
}
}