about summary refs log tree commit diff stats
path: root/html/003trace.test.cc.html
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-21 23:34:12 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-21 23:34:12 -0700
commite7d9351f52fb3b747760031c77ca117336c08219 (patch)
treeec662c7b3af4ecacacbe5b47138773bcbf842bd9 /html/003trace.test.cc.html
parentd47f3a82786c7d3abdb1001c2562780d0e1fab2e (diff)
downloadmu-e7d9351f52fb3b747760031c77ca117336c08219.tar.gz
4585
Diffstat (limited to 'html/003trace.test.cc.html')
0 files changed, 0 insertions, 0 deletions
a id='n8' href='#n8'>8 9 10 11
12
13
14
15
16
17
18
19
20
21
22
23
24










                                                                           
                                                                                                                                             







                                                
                                          
                                                                                                             

        
//: Primitive to convert any type to text (array of characters).
//: Later layers will allow us to override this to do something smarter for
//: specific types.

:(before "End Primitive Recipe Declarations")
TO_TEXT,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "to-text", TO_TEXT);
:(before "End Primitive Recipe Checks")
case TO_TEXT: {
  if (SIZE(inst.ingredients) != 1) {
    raise << maybe(get(Recipe, r).name) << "'to-text' requires a single ingredient, but got '" << to_original_string(inst) << "'\n" << end();
    break;
  }
  // can handle any type
  break;
}
:(before "End Primitive Recipe Implementations")
case TO_TEXT: {
  products.resize(1);
  products.at(0).push_back(/*alloc id*/0);
  products.at(0).push_back(new_mu_text(inspect(current_instruction().ingredients.at(0), ingredients.at(0))));
  break;
}