diff options
| author | Patrick Schönberger | 2021-08-04 14:51:23 +0200 |
|---|---|---|
| committer | Patrick Schönberger | 2021-08-04 14:51:23 +0200 |
| commit | dbc4a22d3c8c4189459f0361cb9da06415ec2dc9 (patch) | |
| tree | 7eabe3910c0a6d56b3d7c2b2a082e95a61a71c58 /src/check.h | |
| parent | 71a20a4f3d4e5f5278f7d004af710af89dfd7ebc (diff) | |
| download | toc-dbc4a22d3c8c4189459f0361cb9da06415ec2dc9.tar.gz toc-dbc4a22d3c8c4189459f0361cb9da06415ec2dc9.zip | |
pre change
Diffstat (limited to 'src/check.h')
| -rw-r--r-- | src/check.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/check.h b/src/check.h index d85bd81..091b646 100644 --- a/src/check.h +++ b/src/check.h @@ -4,8 +4,7 @@ bool checkStmt(
const Stmt & s,
- std::vector<Struct> structs,
- std::vector<Function> funcs,
+ std::vector<Namespace> namespaces,
std::vector<Variable> vars)
{
return true;
@@ -13,15 +12,14 @@ bool checkStmt( bool checkFunction(
const Function & f,
- std::vector<Struct> structs,
- std::vector<Function> funcs,
+ std::vector<Namespace> namespaces,
std::vector<Variable> vars)
{
vars.insert(vars.end(), f.parameters.begin(), f.parameters.end());
vars.insert(vars.end(), f.body.variables.begin(), f.body.variables.end());
for (auto s : f.body.statements)
{
- if (!checkStmt(s, structs, funcs, vars))
+ if (!checkStmt(s, namespaces, vars))
return false;
}
return true;
@@ -31,7 +29,7 @@ bool checkProgram(const Program & p) {
for (auto f : p.functions)
{
- if (!checkFunction(f, p.structs, p.functions, p.variables))
+ if (!checkFunction(f, p.namespaces, p.variables))
return false;
}
for (auto s : p.structs)
@@ -41,7 +39,7 @@ bool checkProgram(const Program & p) vars.push_back(v);
for (auto f : s.methods)
{
- if (!checkFunction(f, p.structs, p.functions, vars))
+ if (!checkFunction(f, p.namespaces, vars))
return false;
}
}
|
