ASM style checker improvements
This commit is contained in:
parent
0401476675
commit
b292799a07
|
@ -26,7 +26,8 @@ class AsmStyleCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const AsmBrExp brExp)
|
override void visit(const AsmBrExp brExp)
|
||||||
{
|
{
|
||||||
if (brExp.asmBrExp !is null)
|
if (brExp.asmBrExp !is null && brExp.asmBrExp.asmUnaExp !is null
|
||||||
|
&& brExp.asmBrExp.asmUnaExp.asmPrimaryExp !is null)
|
||||||
{
|
{
|
||||||
addErrorMessage(brExp.line, brExp.column,
|
addErrorMessage(brExp.line, brExp.column,
|
||||||
"This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.");
|
"This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.");
|
||||||
|
@ -46,6 +47,7 @@ unittest
|
||||||
asm
|
asm
|
||||||
{
|
{
|
||||||
mov a, someArray[1]; // [warn]: This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.
|
mov a, someArray[1]; // [warn]: This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.
|
||||||
|
add near ptr [EAX], 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}c, sac);
|
}c, sac);
|
||||||
|
|
|
@ -1045,6 +1045,7 @@ class XMLPrinter : ASTVisitor
|
||||||
override void visit(const PragmaDeclaration pragmaDeclaration) { mixin (tagAndAccept!"pragmaDeclaration"); }
|
override void visit(const PragmaDeclaration pragmaDeclaration) { mixin (tagAndAccept!"pragmaDeclaration"); }
|
||||||
override void visit(const PragmaExpression pragmaExpression) { mixin (tagAndAccept!"pragmaExpression"); }
|
override void visit(const PragmaExpression pragmaExpression) { mixin (tagAndAccept!"pragmaExpression"); }
|
||||||
override void visit(const PrimaryExpression primaryExpression) { mixin (tagAndAccept!"primaryExpression"); }
|
override void visit(const PrimaryExpression primaryExpression) { mixin (tagAndAccept!"primaryExpression"); }
|
||||||
|
override void visit(const Register register) { mixin (tagAndAccept!"register"); }
|
||||||
override void visit(const ScopeGuardStatement scopeGuardStatement) { mixin (tagAndAccept!"scopeGuardStatement"); }
|
override void visit(const ScopeGuardStatement scopeGuardStatement) { mixin (tagAndAccept!"scopeGuardStatement"); }
|
||||||
override void visit(const SharedStaticConstructor sharedStaticConstructor) { mixin (tagAndAccept!"sharedStaticConstructor"); }
|
override void visit(const SharedStaticConstructor sharedStaticConstructor) { mixin (tagAndAccept!"sharedStaticConstructor"); }
|
||||||
override void visit(const SharedStaticDestructor sharedStaticDestructor) { mixin (tagAndAccept!"sharedStaticDestructor"); }
|
override void visit(const SharedStaticDestructor sharedStaticDestructor) { mixin (tagAndAccept!"sharedStaticDestructor"); }
|
||||||
|
|
Loading…
Reference in New Issue