This PR removes a condition that allows statements to be instrumented if they are preceded by a newline because there are common cases where non-self-contained statements span several lines. For example:
StatementCoverage('test.sol',1);
if (x==1)
StatementCoverage('test.sol',2);
{BranchCoverage('test.sol',1,0);throw;}else { BranchCoverage('test.sol',1,1);}
This also happens when statements that are arguments to a function are broken up across lines per the solidity style guide:
Person a = Person(
paramA,
paramB,
paramC,
address(0x579fadbb36a7b7284ef4e50bbc83f3f294e9a8ec)
);
I think the newline condition can be removed without reducing the accuracy of the coverage and the other two tests in instrumentStatementare adequate in themselves. (That definitely needs a sanity check though.)
This PR removes a condition that allows statements to be instrumented if they are preceded by a newline because there are common cases where non-self-contained statements span several lines. For example:
produces this error
and is currently instrumented as
This also happens when statements that are arguments to a function are broken up across lines per the solidity style guide:
I think the newline condition can be removed without reducing the accuracy of the coverage and the other two tests in
instrumentStatement
are adequate in themselves. (That definitely needs a sanity check though.)