]> gitweb.ps.run Git - toc/blobdiff - src/check.h
add namespace, private struct member grammar, change bracket style
[toc] / src / check.h
index 4e52ccd491acd4aad8d8be6ffe191a6eaa36860e..d85bd81e27b01f5a7cf7ea03c02a44a3b464dbd6 100644 (file)
@@ -19,7 +19,8 @@ bool checkFunction(
 {\r
   vars.insert(vars.end(), f.parameters.begin(), f.parameters.end());\r
   vars.insert(vars.end(), f.body.variables.begin(), f.body.variables.end());\r
-  for (auto s : f.body.statements) {\r
+  for (auto s : f.body.statements)\r
+  {\r
     if (!checkStmt(s, structs, funcs, vars))\r
       return false;\r
   }\r
@@ -28,15 +29,18 @@ bool checkFunction(
 \r
 bool checkProgram(const Program & p)\r
 {\r
-  for (auto f : p.functions) {\r
+  for (auto f : p.functions)\r
+  {\r
     if (!checkFunction(f, p.structs, p.functions, p.variables))\r
       return false;\r
   }\r
-  for (auto s : p.structs) {\r
+  for (auto s : p.structs)\r
+  {\r
     std::vector<Variable> vars = p.variables;\r
     for (auto v : s.members)\r
       vars.push_back(v);\r
-    for (auto f : s.methods) {\r
+    for (auto f : s.methods)\r
+    {\r
       if (!checkFunction(f, p.structs, p.functions, vars))\r
         return false;\r
     }\r