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
@@ -95,7 +95,7 @@ namespace StgSharp.Script.Express
public ExpSchemaSource() { }
public void ReadSchema( ExpFileReader reader )
public void ReadSchema( ExpFileSource reader )
{
string line = reader.ReadLine();
while( !_schemaBegin.IsMatch( line ) ) {
@@ -122,7 +122,7 @@ namespace StgSharp.Script.Express
public static bool TryReadSchema(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out ExpSchemaSource source )
{
if( !_schemaBegin.IsMatch( firstLine ) ) {
@@ -163,15 +163,15 @@ namespace StgSharp.Script.Express
private bool TryReadConst(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out IExpElementSource source )
{
Match match = _constDefineBegin.Match( firstLine );
if( match.Success ) {
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter(
"END_CONSTANT" );
"END_CONSTANT",reader.Location );
ExpConstantCollectionSource _source = new ExpConstantCollectionSource(
"Constant", transmitter );
transmitter );
string line = reader.ReadLine();
while( !_constDefineEnd.IsMatch( line ) ) {
transmitter.WriteLine( line );
@@ -187,13 +187,13 @@ namespace StgSharp.Script.Express
private bool TryReadEntity(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out IExpElementSource source )
{
Match match = _entityDefineBegin.Match( firstLine );
if( match.Success ) {
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter(
"END_ENTITY" );
"END_ENTITY", reader.Location);
ExpEntitySource _source = new ExpEntitySource(
match.Groups[ "TypeName" ].ToString(), transmitter );
string line = reader.ReadLine();
@@ -218,13 +218,13 @@ namespace StgSharp.Script.Express
private bool TryReadFunction(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out IExpElementSource source )
{
Match match = _functionDefineBegin.Match( firstLine );
if( match.Success ) {
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter(
"END_FUNCTION" );
"END_FUNCTION", reader.Location);
ExpFunctionSource _source = new ExpFunctionSource(
match.Groups[ "FunctionName" ].ToString(), transmitter );
transmitter.WriteLine( match.Groups[ "Remaining" ].ToString() );
@@ -250,13 +250,13 @@ namespace StgSharp.Script.Express
private bool TryReadRule(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out IExpElementSource source )
{
Match match = _ruleDefineBegin.Match( firstLine );
if( match.Success ) {
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter(
"END_RULE" );
"END_RULE", reader.Location);
ExpRuleSource _source = new ExpRuleSource(
match.Groups[ "RuleName" ].ToString(), transmitter );
string target = match.Groups[ "Target" ].ToString();
@@ -285,13 +285,13 @@ namespace StgSharp.Script.Express
private bool TryReadType(
string firstLine,
ExpFileReader reader,
ExpFileSource reader,
out IExpElementSource source )
{
Match match = _typeDefineBegin.Match( firstLine );
if( match.Success ) {
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter(
"END_ENTITY" );
"END_ENTITY", reader.Location);
ExpTypeSource _source = new ExpTypeSource(
match.Groups[ "TypeName" ].ToString(), transmitter );
transmitter.WriteLine( match.Groups[ "Remaining" ].ToString() );