Minor fixes
This commit is contained in:
parent
0e89df07f8
commit
13a5a3e693
|
@ -30,6 +30,7 @@ public:
|
|||
|
||||
override void visit(const Token t)
|
||||
{
|
||||
import std.algorithm : startsWith;
|
||||
if (isNumberLiteral(t.type) && !t.text.startsWith("0x")
|
||||
&& ((t.text.startsWith("0b") && !t.text.matchFirst(badBinaryRegex).empty)
|
||||
|| !t.text.matchFirst(badDecimalRegex).empty))
|
||||
|
|
|
@ -108,17 +108,21 @@ class UnmodifiedFinder:BaseAnalyzer
|
|||
dec.accept(this);
|
||||
}
|
||||
|
||||
override void visit(const IdentifierChain ic)
|
||||
{
|
||||
if (ic.identifiers.length && interest > 0)
|
||||
variableMightBeModified(ic.identifiers[0].text);
|
||||
ic.accept(this);
|
||||
}
|
||||
|
||||
override void visit(const IdentifierOrTemplateInstance ioti)
|
||||
{
|
||||
// import std.stdio : stderr;
|
||||
// stderr.writeln(ioti.identifier.text, " ", ioti.identifier.line);
|
||||
if (ioti.identifier != tok!"" && interest > 0)
|
||||
{
|
||||
variableMightBeModified(ioti.identifier.text);
|
||||
}
|
||||
ioti.accept(this);
|
||||
}
|
||||
|
||||
mixin PartsMightModify!AsmPrimaryExp;
|
||||
mixin PartsMightModify!IndexExpression;
|
||||
mixin PartsMightModify!SliceExpression;
|
||||
mixin PartsMightModify!FunctionCallExpression;
|
||||
|
|
|
@ -91,7 +91,6 @@ class XMLPrinter : ASTVisitor
|
|||
visit(asmInstruction.identifierOrIntegerOrOpcode);
|
||||
if (asmInstruction.operands !is null)
|
||||
{
|
||||
stderr.writeln("operands is not null");
|
||||
visit(asmInstruction.operands);
|
||||
}
|
||||
output.writeln("</asmInstruction>");
|
||||
|
|
|
@ -43,8 +43,9 @@ class ImportPrinter : ASTVisitor
|
|||
|
||||
alias visit = ASTVisitor.visit;
|
||||
|
||||
private:
|
||||
|
||||
/// Collected imports
|
||||
RedBlackTree!string imports;
|
||||
|
||||
private:
|
||||
bool ignore = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue