構文規則属性にIsCatalogとKeywordを追加

このコミットが含まれているのは:
routersys committed 2026-07-05 17:26:28 +09:00
1 親 a7a8c6b117
コミット fb7614d6fb
4ファイル変更
+37 -4

検索条件に一致するファイルはありません

+4
ファイルの表示
@@ -6,5 +6,9 @@ namespace LuaScript.Compat.Syntax
internal sealed class LuaSyntaxRuleAttribute(int order) : Attribute
{
public int Order { get; } = order;
public bool IsCatalog { get; set; }
public string Keyword { get; set; } = "";
}
}
+3 -2
ファイルの表示
@@ -1,8 +1,9 @@
namespace LuaScript.Compat.Syntax.Rules
{
[LuaSyntaxRule(2)]
[LuaSyntaxRule(2, IsCatalog = true, Keyword = MarkerKeyword)]
internal sealed class LuaFastRule : ILuaSyntaxRule
{
private const string MarkerKeyword = "fast";
private const string Message = "[fast]: only obj.fill, obj.convolve and obj.resize can be accelerated.";
public bool TryApply(LuaRewriteContext context)
@@ -14,7 +15,7 @@ namespace LuaScript.Compat.Syntax.Rules
return false;
int nameIndex = context.NextSignificant(context.Index + 1);
if (nameIndex < 0 || !context.Input[nameIndex].IsName("fast"))
if (nameIndex < 0 || !context.Input[nameIndex].IsName(MarkerKeyword))
return false;
int closeIndex = context.NextSignificant(nameIndex + 1);