Added rule to finc plaves where TableName2Id(tableStr(t)) is used

This commit is contained in:
Peter Villadsen 2022-02-10 14:23:42 -08:00
Родитель 146053710b
Коммит 0bd5108c79
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,19 @@
(: Copyright (c) Microsoft Corporation.
Licensed under the MIT license. :)
(: Identify calls to tablename2id(TableStr(T)) that could base
expressed better with tableNum(T), since there is no runtime
function called in the latter case. :)
(: @Language Xpp :)
(: @Category Informational :)
<CallsTableName2IdInTableStr>
{
for $a in /*
for $m in $a//Method
for $call in $m//FunctionCall[lower-case(@FunctionName)='tablename2id']/Intrinsic[lower-case(@Name)='tablestr']
return <Call Artifact='{$a/@Artifact}'
StartLine='{$call/@StartLine}' EndLine='{$call/@EndLine}'
StartCol='{$call/@StartCol}' EndCol='{$call/@EndCol}'/>
}
</CallsTableName2IdInTableStr>