about summary refs log tree commit diff stats
path: root/011load.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-04 09:36:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-04 09:36:14 -0700
commitee6a21cede4cfe6773afc4985d298e3841dde370 (patch)
treea6093c5263ec2e1cf5b93aa70143f55c18d6f613 /011load.cc
parentd731455459178fc954c4bb2e48a78ba0c4cfbc89 (diff)
downloadmu-ee6a21cede4cfe6773afc4985d298e3841dde370.tar.gz
3440
Diffstat (limited to '011load.cc')
-rw-r--r--011load.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/011load.cc b/011load.cc
index cc329b5c..d575c706 100644
--- a/011load.cc
+++ b/011load.cc
@@ -215,30 +215,6 @@ void skip_comment(istream& in) {
   }
 }
 
-//: Warn if a recipe gets redefined, because large codebases can accidentally
-//: step on their own toes. But there'll be many occasions later where
-//: we'll want to disable the errors.
-:(before "End Globals")
-bool Disable_redefine_checks = false;
-:(before "End Setup")
-Disable_redefine_checks = false;
-:(code)
-bool should_check_for_redefine(const string& recipe_name) {
-  if (Disable_redefine_checks) return false;
-  return true;
-}
-
-// for debugging
-:(code)
-void show_rest_of_stream(istream& in) {
-  cerr << '^';
-  char c;
-  while (in >> c)
-    cerr << c;
-  cerr << "$\n";
-  exit(0);
-}
-
 :(scenario recipe_instead_of_def)
 recipe main [
   1:number <- copy 23
@@ -364,6 +340,19 @@ void test_parse_comment_terminated_by_eof() {
   cerr << ".";  // termination = success
 }
 
+//: Warn if a recipe gets redefined, because large codebases can accidentally
+//: step on their own toes. But there'll be many occasions later where
+//: we'll want to disable the errors.
+:(before "End Globals")
+bool Disable_redefine_checks = false;
+:(before "End Setup")
+Disable_redefine_checks = false;
+:(code)
+bool should_check_for_redefine(const string& recipe_name) {
+  if (Disable_redefine_checks) return false;
+  return true;
+}
+
 :(scenario warn_on_missing_space_before_bracket)
 % Hide_errors = true;
 def main[
@@ -390,3 +379,14 @@ def! main [
 ]
 -error: redefining recipe main
 $error: 0
+
+:(code)
+// for debugging
+void show_rest_of_stream(istream& in) {
+  cerr << '^';
+  char c;
+  while (in >> c)
+    cerr << c;
+  cerr << "$\n";
+  exit(0);
+}