構文規則属性にIsCatalogとKeywordを追加
このコミットが含まれているのは:
4ファイル変更
+37
-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; } = "";
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする