Commit 16cf3dc7
16cf3dc7c89dMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 3 files · +2 added · ~1 modified
Description
Merge pull request #220 from Halvanhelv/feat/integer-allbits
feat(codegen): add Integer#allbits?
Details
- Commit
- 16cf3dc7c89d
- Parent
- 40e27621372f
- Merge parent
- 6b4d146606af
spinel_codegen.rbmodifiedView file
@@ -2608,6 +2608,9 @@
26082608
if mname == "odd?"26092609
return "bool"26102610
end2611+
if mname == "allbits?"2612+
return "bool"2613+
end26112614
if mname == "zero?"26122615
return "bool"26132616
end@@ -18783,6 +18786,10 @@
1878318786
if mname == "odd?"1878418787
return "((" + rc + ") % 2 != 0)"1878518788
end18789+
if mname == "allbits?"18790+
mask = compile_arg0(nid)18791+
return "(((" + rc + ") & (" + mask + ")) == (" + mask + "))"18792+
end1878618793
if mname == "zero?"1878718794
return "((" + rc + ") == 0)"1878818795
endtest/integer_allbits.rbaddedView file
Loading diff…
test/integer_allbits.rb.expectedaddedView file
Loading diff…