Changeset 1113c9e in mainline for uspace/dist/src/sysel/lib/map.sy
- Timestamp:
- 2010-06-09T19:03:24Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8eec3c8
- Parents:
- 8f80c77 (diff), c5cb943d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/lib/map.sy
r8f80c77 r1113c9e 91 91 end 92 92 end 93 94 fun GetEnumerator() : IEnumerator/tkey is 95 return new MapEnumerator/tkey/tvalue(data.get_first()); 96 end 93 97 end 94 98 … … 97 101 var Value : tvalue; 98 102 end 103 104 class MapEnumerator/tkey/tvalue : IEnumerator/tkey is 105 var first : ListNode/(MapPair/tkey/tvalue); 106 var current : ListNode/(MapPair/tkey/tvalue); 107 var started : bool; 108 109 new(first_node : ListNode/(MapPair/tkey/tvalue)) is 110 first = first_node; 111 current = nil; 112 started = false; 113 end 114 115 fun MoveNext() : bool is 116 if started then 117 current = current.Next; 118 else 119 current = first; 120 started = true; 121 end 122 123 return current != nil; 124 end 125 126 prop Data : tkey is 127 get is 128 return current.Data.Key; 129 end 130 end 131 end
Note:
See TracChangeset
for help on using the changeset viewer.