From 5fe060d582d4a82444243a28b18085c971a85628 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 27 Jul 2018 17:07:52 -0700 Subject: 4447 --- html/018constant.cc.html | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 html/018constant.cc.html (limited to 'html/018constant.cc.html') diff --git a/html/018constant.cc.html b/html/018constant.cc.html new file mode 100644 index 00000000..33c35cb3 --- /dev/null +++ b/html/018constant.cc.html @@ -0,0 +1,129 @@ + + + + +Mu - 018constant.cc + + + + + + + + + + +
+ 1 //: A few literal constants.
+ 2 
+ 3 :(scenarios load)  // use 'load' instead of 'run' in all scenarios in this layer
+ 4 
+ 5 :(before "End Mu Types Initialization")
+ 6 put(Type_ordinal, "literal-boolean", 0);
+ 7 
+ 8 //: 'true'
+ 9 
+10 :(scenario true)
+11 def main [
+12   1:boolean <- copy true
+13 ]
+14 +parse:   ingredient: {true: "literal-boolean"}
+15 
+16 :(before "End Parsing reagent")
+17 if (name == "true") {
+18   if (type != NULL) {
+19     raise << "'true' is a literal and can't take a type\n" << end();
+20     return;
+21   }
+22   type = new type_tree("literal-boolean");
+23   set_value(1);
+24 }
+25 
+26 //: 'false'
+27 
+28 :(scenario false)
+29 def main [
+30   1:boolean <- copy false
+31 ]
+32 +parse:   ingredient: {false: "literal-boolean"}
+33 
+34 :(before "End Parsing reagent")
+35 if (name == "false") {
+36   if (type != NULL) {
+37     raise << "'false' is a literal and can't take a type\n" << end();
+38     return;
+39   }
+40   type = new type_tree("literal-boolean");
+41   set_value(0);
+42 }
+43 
+44 //: 'null'
+45 
+46 :(before "End Mu Types Initialization")
+47 put(Type_ordinal, "literal-address", 0);
+48 
+49 :(scenario null)
+50 def main [
+51   1:address:number <- copy null
+52 ]
+53 +parse:   ingredient: {null: "literal-address"}
+54 
+55 :(before "End Parsing reagent")
+56 if (name == "null") {
+57   if (type != NULL) {
+58     raise << "'null' is a literal and can't take a type\n" << end();
+59     return;
+60   }
+61   type = new type_tree("literal-address");
+62   set_value(0);
+63 }
+
+ + + -- cgit 1.4.1-2-gfad0