about summary refs log tree commit diff stats
path: root/arc/.traces/new-skip-noncontiguous
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2018-03-14 00:59:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2018-03-14 00:59:41 -0700
commit090cad5c1b87989049c926e383d2e08667fe325b (patch)
treea921a10dc350869ecbb67d1180407be13aeb6afe /arc/.traces/new-skip-noncontiguous
parent49ec25f7d2892d268968c52edc52762c72ce2c2c (diff)
downloadmu-090cad5c1b87989049c926e383d2e08667fe325b.tar.gz
4223
Diffstat (limited to 'arc/.traces/new-skip-noncontiguous')
0 files changed, 0 insertions, 0 deletions
t;vc@akkartik.com> 2018-06-17 00:29:22 -0700 4261 - start using literals for 'true' and 'false'' href='/akkartik/mu/commit/022constant.cc?h=hlt&id=dd66068298b0a11f2a1f195376cba98e0c8570b5'>dd660682 ^
01ce563d ^

dd660682 ^



92a3d082 ^
dd660682 ^









01ce563d ^


92a3d082 ^


01ce563d ^



92a3d082 ^
01ce563d ^









1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

                            

                                                                                


                                        

          



                        
                                               









                                                                    
 

           



                         
                                                









                                                                     


          


                                        



                               
                                               









                                                                    
//: A few literal constants.

:(scenarios load)  // use 'load' instead of 'run' in all scenarios in this layer

:(before "End Mu Types Initialization")
put(Type_ordinal, "literal-boolean", 0);

//: 'true'

:(scenario true)
def main [
  1:boolean <- copy true
]
+parse:   ingredient: {true: "literal-boolean"}

:(before "End Parsing reagent")
if (name == "true") {
  if (type != NULL) {
    raise << "'true' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-boolean");
  set_value(1);
}

//: 'false'

:(scenario false)
def main [
  1:boolean <- copy false
]
+parse:   ingredient: {false: "literal-boolean"}

:(before "End Parsing reagent")
if (name == "false") {
  if (type != NULL) {
    raise << "'false' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-boolean");
  set_value(0);
}

//: 'null'

:(before "End Mu Types Initialization")
put(Type_ordinal, "literal-address", 0);

:(scenario null)
def main [
  1:address:number <- copy null
]
+parse:   ingredient: {null: "literal-address"}

:(before "End Parsing reagent")
if (name == "null") {
  if (type != NULL) {
    raise << "'null' is a literal and can't take a type\n" << end();
    return;
  }
  type = new type_tree("literal-address");
  set_value(0);
}