diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-12 20:47:49 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-12 20:48:05 -0700 |
commit | f1a6f32323a982f8aa9b8fe757f8d4e2ae4d77db (patch) | |
tree | 731297f5a113721aafc043a5315e814680294cba | |
parent | 39f77cc54ea08cd1feac8796aaa617d00a35f835 (diff) | |
download | mu-f1a6f32323a982f8aa9b8fe757f8d4e2ae4d77db.tar.gz |
1051
-rw-r--r-- | cpp/010vm | 10 | ||||
-rw-r--r-- | cpp/011load | 2 | ||||
-rw-r--r-- | cpp/013run | 6 | ||||
-rw-r--r-- | cpp/021call | 4 | ||||
-rw-r--r-- | cpp/025name | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/cpp/010vm b/cpp/010vm index abb53732..d6eead5e 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -79,7 +79,7 @@ void setup_types() { Type.clear(); Type_number.clear(); Type_number["literal"] = 0; Next_type_number = 1; - // Mu Types Initialization. + // Mu Types Initialization int integer = Type_number["integer"] = Next_type_number++; Type_number["location"] = Type_number["integer"]; // wildcard type Type[integer].name = "integer"; @@ -91,7 +91,7 @@ void setup_types() { Type[character].name = "character"; int array = Type_number["array"] = Next_type_number++; Type[array].name = "array"; - // End Mu Types Initialization. + // End Mu Types Initialization } :(before "End One-time Setup") setup_types(); @@ -109,7 +109,7 @@ struct type_info { size_t size; // only if is_record; primitives and addresses have size 1 while arrays are dynamic vector<vector<type_number> > elements; // only if is_record vector<string> element_names; // only if is_record - // End type_info Fields. + // End type_info Fields type_info() :is_record(false), size(0) {} }; @@ -127,11 +127,11 @@ void setup_recipes() { Recipe_number["idle"] = IDLE; assert(Next_recipe_number == IDLE); Next_recipe_number++; - // Primitive Recipe Numbers. + // Primitive Recipe Numbers Recipe_number["copy"] = COPY; assert(Next_recipe_number == COPY); Next_recipe_number++; - // End Primitive Recipe Numbers. + // End Primitive Recipe Numbers } //: We could just reset the recipe table after every test, but that gets slow //: all too quickly. Instead, initialize the common stuff just once at diff --git a/cpp/011load b/cpp/011load index cff79edd..3939f72f 100644 --- a/cpp/011load +++ b/cpp/011load @@ -197,7 +197,7 @@ for (size_t i = 0; i < recently_added_recipes.size(); ++i) { Recipe_number.erase(Recipe[recently_added_recipes[i]].name); Recipe.erase(recently_added_recipes[i]); } -// Clear Other State For recently_added_recipes. +// Clear Other State For recently_added_recipes recently_added_recipes.clear(); :(scenario parse_comment_outside_recipe) diff --git a/cpp/013run b/cpp/013run index 63a27e48..0a1f6529 100644 --- a/cpp/013run +++ b/cpp/013run @@ -45,14 +45,14 @@ void run(routine rr) { trace("run") << "instruction " << recipe_name(rr) << '/' << pc; //? cout << "operation " << instructions[pc].operation << '\n'; //? 3 switch (instructions[pc].operation) { - // Primitive Recipe Implementations. + // Primitive Recipe Implementations case COPY: { trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name; vector<int> data = read_memory(instructions[pc].ingredients[0]); write_memory(instructions[pc].products[0], data); break; } - // End Primitive Recipe Implementations. + // End Primitive Recipe Implementations default: { cout << "not a primitive op: " << instructions[pc].operation << '\n'; } @@ -156,7 +156,7 @@ size_t size_of(const reagent& r) { return size_of(r.types); } size_t size_of(const vector<type_number>& types) { - // End size_of(types) Cases. + // End size_of(types) Cases return 1; } diff --git a/cpp/021call b/cpp/021call index d84912c2..a2379219 100644 --- a/cpp/021call +++ b/cpp/021call @@ -44,7 +44,7 @@ inline vector<instruction>& steps(routine& rr) { return Recipe[rr.calls.top().running_recipe].steps; } -:(replace{} "default:" following "End Primitive Recipe Implementations.") +:(replace{} "default:" following "End Primitive Recipe Implementations") default: { // not a primitive; try to look for a matching recipe if (Recipe.find(instructions[pc].operation) == Recipe.end()) { @@ -62,7 +62,7 @@ inline bool done(routine& rr) { return rr.calls.empty(); } -:(before "Running one instruction.") +:(before "Running one instruction") // when we reach the end of one call, we may reach the end of the one below // it, and the one below that, and so on while (running_at(rr) >= steps(rr).size()) { diff --git a/cpp/025name b/cpp/025name index c1992506..03fec138 100644 --- a/cpp/025name +++ b/cpp/025name @@ -37,7 +37,7 @@ void transform_names(const recipe_number r) { for (size_t i = 0; i < Recipe[r].steps.size(); ++i) { //? cout << "instruction " << i << '\n'; //? 2 instruction& inst = Recipe[r].steps[i]; - // Per-recipe Transforms Go Here + // Per-recipe Transforms // map names to addresses for (size_t in = 0; in < inst.ingredients.size(); ++in) { if (is_raw(inst.ingredients[in])) continue; |