daily update on 20250208 by nitload youmu. lexical analyzer complete but little problem

This commit is contained in:
Nitload
2025-02-08 23:12:10 +08:00
parent 7d0470d50b
commit ae94c265ae
73 changed files with 2237 additions and 1028 deletions
+51 -4
View File
@@ -37,6 +37,7 @@ using StgSharp.Graphics;
using StgSharp.Math;
using StgSharp.MVVM;
using StgSharp.MVVM.ViewModel;
using StgSharp.Script;
using StgSharp.Script.Express;
using System;
@@ -56,11 +57,8 @@ namespace StgSharp
internal static unsafe void Main( string[] args )
{
try {
/**/
StgSharp.Init();
StgSharp.InitGL( 4, 6 );
StgSharp.GlobalSetting.VSyncActivated = false;
ExpCompile.InitCompile();
@@ -68,6 +66,53 @@ namespace StgSharp
ExpSchemaSource schemaSource = new ExpSchemaSource();
schemaSource.ReadSchema(reader);
ScriptSourceTransmitter st = new ScriptSourceTransmitter("end", 0);
for (int i = 0; i < 10; i++)
{
string str = $"rawCode {i}";
Console.WriteLine(str);
st.WriteLine(str);
}
for (int i = 0; i < 10; i++)
{
string str = $"Code{i} {new string(' ', i + 1)}-- Comment{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++)
{
var str = $" Code{i} (* (* Comment{i} *) *) Code{i}";
Console.WriteLine(str);
st.WriteLine(str);
}
st.WriteLine("end");
List<string> cache = new List<string>();
ExpSourceReader sr = new ExpSourceReader(st);
while (!sr.IsEmpty) {
string str = sr.ReadToken().ToString();
cache.Add(str);
Console.Write($"{cache.Count}\t{cache.Last()}\t\t\t");
if (cache.Count % 5 == 0)
{
Console.Write(Environment.NewLine);
}
/*
if (cache.Count > 32)
{
Console.WriteLine("?");
}
/**/
}
/*
StgSharp.InitGL( 4, 6 );
StgSharp.GlobalSetting.VSyncActivated = false;
ViewPort vp = new ViewPort(800,600,"Hello StgSharp!",IntPtr.Zero);
//throw new NotImplementedException();
@@ -89,11 +134,13 @@ namespace StgSharp
StgSharp.Terminate();
/**/
}
catch( Exception ex ) {
catch ( Exception ex ) {
/*
StgSharp.WriteLog($"{ex}", LogType.Error);
if( true ) { }
Dialogue.PostError( ex );
Environment.Exit(-1);
/**/
}
}
}