Skip to content

Commit

Permalink
[d] SortedSet.Contains.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Sep 11, 2024
1 parent 307c6cd commit 78f2698
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GenD.fu
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,13 @@ public class GenD : GenCCppD
Write(", true)");
break;
case FuId.HashSetClear:
case FuId.SortedSetClear:
case FuId.DictionaryClear:
case FuId.SortedDictionaryClear:
WritePostfix(obj, ".clear()");
break;
case FuId.HashSetContains:
case FuId.SortedSetContains:
case FuId.DictionaryContainsKey:
WriteChar('(');
args[0].Accept(this, FuPriority.Rel);
Expand Down
3 changes: 3 additions & 0 deletions libfut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17448,10 +17448,13 @@ void GenD::writeCallExpr(const FuExpr * obj, const FuMethod * method, const std:
write(", true)");
break;
case FuId::hashSetClear:
case FuId::sortedSetClear:
case FuId::dictionaryClear:
case FuId::sortedDictionaryClear:
writePostfix(obj, ".clear()");
break;
case FuId::hashSetContains:
case FuId::sortedSetContains:
case FuId::dictionaryContainsKey:
writeChar('(');
(*args)[0]->accept(this, FuPriority::rel);
Expand Down
3 changes: 3 additions & 0 deletions libfut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18008,10 +18008,13 @@ protected override void WriteCallExpr(FuExpr obj, FuMethod method, List<FuExpr>
Write(", true)");
break;
case FuId.HashSetClear:
case FuId.SortedSetClear:
case FuId.DictionaryClear:
case FuId.SortedDictionaryClear:
WritePostfix(obj, ".clear()");
break;
case FuId.HashSetContains:
case FuId.SortedSetContains:
case FuId.DictionaryContainsKey:
WriteChar('(');
args[0].Accept(this, FuPriority.Rel);
Expand Down
3 changes: 3 additions & 0 deletions libfut.js
Original file line number Diff line number Diff line change
Expand Up @@ -18543,10 +18543,13 @@ export class GenD extends GenCCppD
this.write(", true)");
break;
case FuId.HASH_SET_CLEAR:
case FuId.SORTED_SET_CLEAR:
case FuId.DICTIONARY_CLEAR:
case FuId.SORTED_DICTIONARY_CLEAR:
this.writePostfix(obj, ".clear()");
break;
case FuId.HASH_SET_CONTAINS:
case FuId.SORTED_SET_CONTAINS:
case FuId.DICTIONARY_CONTAINS_KEY:
this.writeChar(40);
args[0].accept(this, FuPriority.REL);
Expand Down
2 changes: 2 additions & 0 deletions test/SortedSet.fu
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public static class Test
ss.Add("foo");
string p = "bar";
ss.Add(p);
if (s.Contains(42) || !s.Contains(11) || !ss.Contains("foo") || ss.Contains("quux"))
return false;
int i = 0;
foreach (int x in s) { //FAIL: c - needs glib-2.68
const int[] expected = { 3, 11 };
Expand Down

0 comments on commit 78f2698

Please sign in to comment.