Skip to content

Commit

Permalink
fix: keep padding in assignments generated from declarations (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinclancy authored Jun 1, 2023
1 parent 8d4cc2b commit 4c0264b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions slither/solc_parsing/declarations/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,19 +929,24 @@ def _parse_variable_definition(self, statement: Dict, node: NodeSolc) -> NodeSol
new_node = self._parse_variable_definition_init_tuple(
new_statement, i, new_node
)
else:
variables.append(None)
i = i + 1

var_identifiers = []
# craft of the expression doing the assignement
for v in variables:
identifier = {
"nodeType": "Identifier",
"referencedDeclaration": v["id"],
"src": v["src"],
"name": v["name"],
"typeDescriptions": {"typeString": v["typeDescriptions"]["typeString"]},
}
var_identifiers.append(identifier)
if v != None:
identifier = {
"nodeType": "Identifier",
"referencedDeclaration": v["id"],
"src": v["src"],
"name": v["name"],
"typeDescriptions": {"typeString": v["typeDescriptions"]["typeString"]},
}
var_identifiers.append(identifier)
else:
var_identifiers.append(None)

tuple_expression = {
"nodeType": "TupleExpression",
Expand Down

0 comments on commit 4c0264b

Please sign in to comment.