Changeset c5cb943d in mainline for uspace/dist/src/sysel/lib/map.sy
- Timestamp:
- 2010-06-09T19:01:08Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1113c9e
- Parents:
- 051bc69a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/lib/map.sy
r051bc69a rc5cb943d 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.