Skip to content

Commit

Permalink
Merge pull request #228 from EYBlockchain/lydia/_variables
Browse files Browse the repository at this point in the history
Throw an error if a variable begins with _
  • Loading branch information
SwatiEY authored Feb 13, 2024
2 parents 88b877b + ea39da8 commit 2e186d5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/transformers/visitors/checks/unsupportedVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@ export default {
);
},
},

VariableDeclaration: {
enter(node: any) {
if (node.name.startsWith('_'))
throw new ZKPError(
`Zokrates does not support variables that begin with an underscore such as as _value.`,
node
);
},
},
};

0 comments on commit 2e186d5

Please sign in to comment.