diff options
| author | azidar | 2015-02-20 16:56:25 -0800 |
|---|---|---|
| committer | azidar | 2015-02-20 16:56:25 -0800 |
| commit | 95dd261b4e65840ade351dcb00e4164a99daf654 (patch) | |
| tree | 73f5fa894f5ebb3a61581dd2f29ae96e46d476e4 /src/main/stanza/ir-utils.stanza | |
| parent | 8299c2ecae1701fa6060185a8aed25543e201eba (diff) | |
Rewrote the initialize-register pass, now correctly implemented
with a new IR construct - Null. LetRec is not implemented, but is
marked with a TODO.
Test cases for this pass are now located in
test/passes/initialize-register
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
| -rw-r--r-- | src/main/stanza/ir-utils.stanza | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza index 7edbcb1c..7fe61ff2 100644 --- a/src/main/stanza/ir-utils.stanza +++ b/src/main/stanza/ir-utils.stanza @@ -55,6 +55,7 @@ defmethod print (o:OutputStream, e:Expression) : print-all(o, join(concat(args(e), consts(e)), ", ")) print(o, ")") (e:ReadPort) : print-all(o, ["ReadPort(" mem(e) ", " index(e) ")"]) + (e:Null) : print-all(o, ["Null"]) defmethod print (o:OutputStream, c:Stmt) : match(c) : @@ -227,7 +228,7 @@ defmethod children (c:Stmt) : (c:Begin) : body(c) (c) : List() -;=================== STRING OPS =============================== +;=================== ADAM OPS =============================== public defn split (s:String,c:Char) -> List<String> : val empty = "" defn next-word (s:String,i:Int) -> String|False : @@ -249,3 +250,6 @@ public defn contains (l:List<Char>, c:Char) : if x == c : myret(true) false +public defn merge!<?K,?V> (a:HashTable<?K,?V>, b:HashTable<K,V>) : + for e in b do : + a[key(e)] = value(e) |
