about summary refs log tree commit diff stats
path: root/mu.vim
Commit message (Expand)AuthorAgeFilesLines
* 4910Kartik Agaram2019-01-061-4/+4
* 4294Kartik Agaram2018-06-301-9/+9
* 4293Kartik Agaram2018-06-301-1/+1
* 4262 - literal 'null'Kartik Agaram2018-06-171-0/+1
* 4261 - start using literals for 'true' and 'false'Kartik Agaram2018-06-171-0/+1
* 4214Kartik K. Agaram2018-02-211-1/+1
* 4165Kartik K. Agaram2017-12-271-9/+19
* 4164Kartik K. Agaram2017-12-271-3/+19
* 4163Kartik K. Agaram2017-12-241-1/+1
* 4134 - 'input' = 'ingredient'Kartik K. Agaram2017-12-031-2/+2
* 3976Kartik K. Agaram2017-08-201-1/+1
* 3969Kartik K. Agaram2017-07-131-1/+1
* 3702Kartik K. Agaram2016-12-061-1/+1
* 3569Kartik K. Agaram2016-10-231-2/+4
* 3568Kartik K. Agaram2016-10-231-1/+3
* 3561Kartik K. Agaram2016-10-221-4/+4
* 3431Kartik K. Agaram2016-09-301-16/+13
* 3426Kartik K. Agaram2016-09-271-1/+2
* 2838Kartik K. Agaram2016-04-161-1/+1
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-2/+2
* 2562Kartik K. Agaram2016-01-171-1/+0
* 2367Kartik K. Agaram2015-11-051-1/+1
* 2306 - recipe headersKartik K. Agaram2015-10-281-0/+1
* 2295 - drop first-class recipes and continuationsKartik K. Agaram2015-10-281-1/+0
* 2294Kartik K. Agaram2015-10-281-0/+1
* 2266 - drop experiment with genericsKartik K. Agaram2015-10-071-1/+1
* 2252Kartik K. Agaram2015-10-051-1/+1
* 2174Kartik K. Agaram2015-09-061-1/+2
* 2153Kartik K. Agaram2015-09-051-1/+1
* 2139Kartik K. Agaram2015-09-041-0/+1
* 2080Kartik K. Agaram2015-08-261-0/+1
* 2059Kartik K. Agaram2015-08-221-1/+1
* 1960Kartik K. Agaram2015-08-091-2/+2
* 1903Kartik K. Agaram2015-07-301-0/+5
* 1868 - start using naked literals everywhereKartik K. Agaram2015-07-281-0/+2
* 1780 - now we always reclaim local scopesKartik K. Agaram2015-07-131-1/+1
* 1774Kartik K. Agaram2015-07-131-1/+1
* 1771Kartik K. Agaram2015-07-131-1/+2
* 1646Kartik K. Agaram2015-06-251-1/+1
* 1555 - mu.vim: distinguish control-flow from constantsKartik K. Agaram2015-06-121-5/+7
* 1506Kartik K. Agaram2015-05-281-1/+1
* 1432 - contrast scenarios and recipesKartik K. Agaram2015-05-231-2/+3
* 1410Kartik K. Agaram2015-05-201-1/+2
* 1378Kartik K. Agaram2015-05-151-0/+1
* 1333Kartik K. Agaram2015-05-101-3/+11
* 1331Kartik K. Agaram2015-05-101-2/+4
* 1327 - better error handling in chessboardKartik K. Agaram2015-05-101-1/+1
* vim highlighting for labelsKartik K. Agaram2015-04-181-1/+2
* 1093 - little more vim support for the old arc versionKartik K. Agaram2015-04-171-0/+2
* 1048Kartik K. Agaram2015-04-111-5/+5
designate jump targets :(before "End Mu Types Initialization") Type_ordinal["offset"] = 0; :(scenario jump_backward) recipe main [ jump 1:offset # 0 -+ jump 3:offset # | +-+ 1 # \/ /\ | jump -2:offset # 2 +-->+ | ] # \/ 3 +run: jump 1:offset +run: jump -2:offset +run: jump 3:offset :(before "End Primitive Recipe Declarations") JUMP_IF, :(before "End Primitive Recipe Numbers") Recipe_ordinal["jump-if"] = JUMP_IF; :(before "End Primitive Recipe Implementations") case JUMP_IF: { if (SIZE(ingredients) != 2) { raise << current_recipe_name() << ": 'jump-if' requires exactly two ingredients, but got " << current_instruction().to_string() << '\n' << end(); break; } if (!scalar(ingredients.at(0))) { raise << current_recipe_name() << ": 'jump-if' requires a boolean for its first ingredient, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); break; } if (!scalar(ingredients.at(1))) { raise << current_recipe_name() << ": 'jump-if' requires a label or offset for its second ingredient, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); break; } assert(current_instruction().ingredients.at(1).initialized); if (!ingredients.at(0).at(0)) { trace(Primitive_recipe_depth, "run") << "jump-if fell through" << end(); break; } current_step_index() += ingredients.at(1).at(0)+1; trace(Primitive_recipe_depth, "run") << "jumping to instruction " << current_step_index() << end(); continue; // skip rest of this instruction } :(scenario jump_if) recipe main [ jump-if 999, 1:offset 123:number <- copy 1 ] +run: jump-if 999, 1:offset +run: jumping to instruction 2 -run: 1:number <- copy 1 -mem: storing 1 in location 123 :(scenario jump_if_fallthrough) recipe main [ jump-if 0, 1:offset 123:number <- copy 1 ] +run: jump-if 0, 1:offset +run: jump-if fell through +run: 123:number <- copy 1 +mem: storing 1 in location 123 :(before "End Primitive Recipe Declarations") JUMP_UNLESS, :(before "End Primitive Recipe Numbers") Recipe_ordinal["jump-unless"] = JUMP_UNLESS; :(before "End Primitive Recipe Implementations") case JUMP_UNLESS: { if (SIZE(ingredients) != 2) { raise << current_recipe_name() << ": 'jump-unless' requires exactly two ingredients, but got " << current_instruction().to_string() << '\n' << end(); break; } if (!scalar(ingredients.at(0))) { raise << current_recipe_name() << ": 'jump-unless' requires a boolean for its first ingredient, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); break; } if (!scalar(ingredients.at(1))) { raise << current_recipe_name() << ": 'jump-unless' requires a label or offset for its second ingredient, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); break; } assert(current_instruction().ingredients.at(1).initialized); if (ingredients.at(0).at(0)) { trace(Primitive_recipe_depth, "run") << "jump-unless fell through" << end(); break; } current_step_index() += ingredients.at(1).at(0)+1; trace(Primitive_recipe_depth, "run") << "jumping to instruction " << current_step_index() << end(); continue; // skip rest of this instruction } :(scenario jump_unless) recipe main [ jump-unless 0, 1:offset 123:number <- copy 1 ] +run: jump-unless 0, 1:offset +run: jumping to instruction 2 -run: 123:number <- copy 1 -mem: storing 1 in location 123 :(scenario jump_unless_fallthrough) recipe main [ jump-unless 999, 1:offset 123:number <- copy 1 ] +run: jump-unless 999, 1:offset +run: jump-unless fell through +run: 123:number <- copy 1 +mem: storing 1 in location 123