daily update on 20250220 by nitload youmu, building AST generator, correct type naming

This commit is contained in:
Nitload
2025-02-21 08:11:26 +08:00
parent ccef0de6f6
commit 83bde12d22
98 changed files with 4182 additions and 1855 deletions
+31 -38
View File
@@ -52,55 +52,50 @@ namespace StgSharp
internal static class Program
{
static string testExpPath = @"D:\Programmer\stepcode\data\ap203\ap203.exp";
private static string testExpPath = @"D:\Programmer\stepcode\data\ap203\ap203.exp";
internal static unsafe void Main( string[] args )
{
try
{
try {
StgSharp.Init();
ExpCompile.InitCompile();
ExpFileSource reader = new ExpFileSource(testExpPath);
ExpFileSource reader = new ExpFileSource( testExpPath );
ExpSchemaSource schemaSource = new ExpSchemaSource();
schemaSource.ReadSchema(reader);
schemaSource.ReadSchema( reader );
ScriptSourceTransmitter st = new ScriptSourceTransmitter("end", 0);
for (int i = 0; i < 10; i++)
{
ScriptSourceTransmitter st = new ScriptSourceTransmitter(
"end", 0 );
for( int i = 0; i < 10; i++ ) {
string str = $"rawCode () (\"\") {i}";
Console.WriteLine(str);
st.WriteLine(str);
Console.WriteLine( str );
st.WriteLine( str );
}
for (int i = 0; i < 10; i++)
{
for( int i = 0; i < 10; i++ ) {
string str = $"Code{i} {new string(' ', i + 1)}-- Comment{i}";
Console.WriteLine(str);
st.WriteLine(str);
Console.WriteLine( str );
st.WriteLine( str );
}
st.WriteLine("CodeBef (* comment");
st.WriteLine($"comment *) codeAft");
Console.WriteLine("CodeBef (* comment_");
Console.WriteLine($"_comment *) codeAft");
for (int i = 0; i < 10; i++)
{
var str = $" Code{i} (* (* Comment{i} *) *) Code{i}";
Console.WriteLine(str);
st.WriteLine(str);
st.WriteLine( "CodeBef (* comment" );
st.WriteLine( $"comment *) codeAft" );
Console.WriteLine( "CodeBef (* comment_" );
Console.WriteLine( $"_comment *) codeAft" );
for( int i = 0; i < 10; i++ ) {
string str = $" Code{i} (* (* Comment{i} *) *) Code{i}";
Console.WriteLine( str );
st.WriteLine( str );
}
st.WriteLine("end");
ExpSourceReader sr = new ExpSourceReader(st);
st.WriteLine( "end" );
ExpSourceReader sr = new ExpSourceReader( st );
int count = 0;
while (!sr.IsEmpty)
{
while( !sr.IsEmpty ) {
count++;
var str = sr.ReadToken();
Console.WriteLine($"{count}\t{str.Mask}\t\t{str.Value.ToString()}");
Token str = sr.ReadToken();
Console.WriteLine(
$"{count}\t{str.Flag}\t\t{str.Value.ToString()}" );
}
var slice = st.Slice(5, 2);
IScriptSourceProvider slice = st.Slice( 5, 2 );
/*
@@ -130,20 +125,18 @@ namespace StgSharp
return;
}
catch (Exception ex)
{
catch( Exception ) {
throw;
/*
StgSharp.WriteLog($"{ex}", LogType.Error);
if( true ) { }
Dialogue.PostError( ex );
/**/
Environment.Exit(-1);
Environment.Exit( -1 );
/**/
}
finally
{
}
finally { }
}
}
}