daily update on 20240206 by nitload youmu, token parser change to use regex generator

This commit is contained in:
Nitload
2025-02-06 07:45:06 +08:00
parent 4e5a1b0dfb
commit 7d0470d50b
104 changed files with 2752 additions and 3134 deletions
@@ -41,17 +41,15 @@ using System.Text.RegularExpressions;
namespace StgSharp.Script.Express
{
public class ExpSchemaSource
public partial class ExpSchemaSource
{
[GeneratedRegex(@"\s*END_CONSTANT;")]
private static partial Regex GetConstDefineEnd();
private static Regex
_constDefineBegin = new Regex(
@"\s*CONSTANT", RegexOptions.Compiled ),
_constDefineEnd = new Regex(
@"\s*END_CONSTANT;", RegexOptions.Compiled ),
_schemaBegin = new Regex(
@"\s*SCHEMA\s*(?<namespace>[A-Za-z0-9_]+)\s?;",
RegexOptions.Compiled ),
_constDefineBegin = GetConstDefineBegin(),
_constDefineEnd = GetConstDefineEnd(),
_schemaBegin = GetSchemaBegin(),
_schemaEnd = new Regex(
@"END_SCHEMA;\s*--\s*(?<namespace>[A-Za-z0-9_]+)",
RegexOptions.Compiled ),
@@ -315,6 +313,11 @@ namespace StgSharp.Script.Express
return false;
}
[GeneratedRegex(@"\s*CONSTANT")]
private static partial Regex GetConstDefineBegin();
[GeneratedRegex(@"\s*SCHEMA\s*(?<namespace>[A-Za-z0-9_]+)\s?;")]
private static partial Regex GetSchemaBegin();
}
}