OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/rewrite_logical_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__rewrite_logical_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const rewrite_logical_test = Object.create(null); |
| 11 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); |
| 12 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 rewrite_logical_test.cneg_and = function(x, y) { |
| 15 if (dart.test(x) && dart.test(y) ? false : true) { |
| 16 return 0; |
| 17 } else { |
| 18 return 1; |
| 19 } |
| 20 }; |
| 21 dart.fn(rewrite_logical_test.cneg_and, dynamicAnddynamicTodynamic()); |
| 22 rewrite_logical_test.cneg_and_not = function(x, y) { |
| 23 if (dart.test(x) && (dart.test(y) ? false : true) ? false : true) { |
| 24 return 0; |
| 25 } else { |
| 26 return 1; |
| 27 } |
| 28 }; |
| 29 dart.fn(rewrite_logical_test.cneg_and_not, dynamicAnddynamicTodynamic()); |
| 30 rewrite_logical_test.cneg_not_and = function(x, y) { |
| 31 if ((dart.test(x) ? false : true) && dart.test(y) ? false : true) { |
| 32 return 0; |
| 33 } else { |
| 34 return 1; |
| 35 } |
| 36 }; |
| 37 dart.fn(rewrite_logical_test.cneg_not_and, dynamicAnddynamicTodynamic()); |
| 38 rewrite_logical_test.cneg_not_and_not = function(x, y) { |
| 39 if ((dart.test(x) ? false : true) && (dart.test(y) ? false : true) ? false :
true) { |
| 40 return 0; |
| 41 } else { |
| 42 return 1; |
| 43 } |
| 44 }; |
| 45 dart.fn(rewrite_logical_test.cneg_not_and_not, dynamicAnddynamicTodynamic()); |
| 46 rewrite_logical_test.cneg_or = function(x, y) { |
| 47 if (dart.test(x) || dart.test(y) ? false : true) { |
| 48 return 0; |
| 49 } else { |
| 50 return 1; |
| 51 } |
| 52 }; |
| 53 dart.fn(rewrite_logical_test.cneg_or, dynamicAnddynamicTodynamic()); |
| 54 rewrite_logical_test.cneg_or_not = function(x, y) { |
| 55 if (dart.test(x) || (dart.test(y) ? false : true) ? false : true) { |
| 56 return 0; |
| 57 } else { |
| 58 return 1; |
| 59 } |
| 60 }; |
| 61 dart.fn(rewrite_logical_test.cneg_or_not, dynamicAnddynamicTodynamic()); |
| 62 rewrite_logical_test.cneg_not_or = function(x, y) { |
| 63 if ((dart.test(x) ? false : true) || dart.test(y) ? false : true) { |
| 64 return 0; |
| 65 } else { |
| 66 return 1; |
| 67 } |
| 68 }; |
| 69 dart.fn(rewrite_logical_test.cneg_not_or, dynamicAnddynamicTodynamic()); |
| 70 rewrite_logical_test.cneg_not_or_not = function(x, y) { |
| 71 if ((dart.test(x) ? false : true) || (dart.test(y) ? false : true) ? false :
true) { |
| 72 return 0; |
| 73 } else { |
| 74 return 1; |
| 75 } |
| 76 }; |
| 77 dart.fn(rewrite_logical_test.cneg_not_or_not, dynamicAnddynamicTodynamic()); |
| 78 rewrite_logical_test.value_tobool = function(x) { |
| 79 return dart.test(x) ? true : false; |
| 80 }; |
| 81 dart.fn(rewrite_logical_test.value_tobool, dynamicTodynamic()); |
| 82 rewrite_logical_test.value_negate = function(x) { |
| 83 return dart.test(x) ? false : true; |
| 84 }; |
| 85 dart.fn(rewrite_logical_test.value_negate, dynamicTodynamic()); |
| 86 rewrite_logical_test.value_and = function(x, y) { |
| 87 return dart.test(x) ? dart.test(y) ? true : false : false; |
| 88 }; |
| 89 dart.fn(rewrite_logical_test.value_and, dynamicAnddynamicTodynamic()); |
| 90 rewrite_logical_test.value_or = function(x, y) { |
| 91 return dart.test(x) ? true : dart.test(y) ? true : false; |
| 92 }; |
| 93 dart.fn(rewrite_logical_test.value_or, dynamicAnddynamicTodynamic()); |
| 94 rewrite_logical_test.value_and_not = function(x, y) { |
| 95 return dart.test(x) ? dart.test(y) ? false : true : false; |
| 96 }; |
| 97 dart.fn(rewrite_logical_test.value_and_not, dynamicAnddynamicTodynamic()); |
| 98 rewrite_logical_test.value_not_and = function(x, y) { |
| 99 return dart.test(x) ? false : dart.test(y) ? true : false; |
| 100 }; |
| 101 dart.fn(rewrite_logical_test.value_not_and, dynamicAnddynamicTodynamic()); |
| 102 rewrite_logical_test.value_not_and_not = function(x, y) { |
| 103 return dart.test(x) ? false : dart.test(y) ? false : true; |
| 104 }; |
| 105 dart.fn(rewrite_logical_test.value_not_and_not, dynamicAnddynamicTodynamic()); |
| 106 rewrite_logical_test.value_or_not = function(x, y) { |
| 107 return dart.test(x) ? true : dart.test(y) ? false : true; |
| 108 }; |
| 109 dart.fn(rewrite_logical_test.value_or_not, dynamicAnddynamicTodynamic()); |
| 110 rewrite_logical_test.value_not_or = function(x, y) { |
| 111 return dart.test(x) ? dart.test(y) ? true : false : true; |
| 112 }; |
| 113 dart.fn(rewrite_logical_test.value_not_or, dynamicAnddynamicTodynamic()); |
| 114 rewrite_logical_test.value_not_or_not = function(x, y) { |
| 115 return dart.test(x) ? dart.test(y) ? false : true : true; |
| 116 }; |
| 117 dart.fn(rewrite_logical_test.value_not_or_not, dynamicAnddynamicTodynamic()); |
| 118 rewrite_logical_test.if_negate = function(x) { |
| 119 if (dart.test(x) ? false : true) { |
| 120 return 1; |
| 121 } else { |
| 122 return 0; |
| 123 } |
| 124 }; |
| 125 dart.fn(rewrite_logical_test.if_negate, dynamicTodynamic()); |
| 126 rewrite_logical_test.if_and = function(x, y) { |
| 127 if (dart.test(x) ? dart.test(y) ? true : false : false) { |
| 128 return 1; |
| 129 } else { |
| 130 return 0; |
| 131 } |
| 132 }; |
| 133 dart.fn(rewrite_logical_test.if_and, dynamicAnddynamicTodynamic()); |
| 134 rewrite_logical_test.if_or = function(x, y) { |
| 135 if (dart.test(dart.test(x) ? true : y)) { |
| 136 return 1; |
| 137 } else { |
| 138 return 0; |
| 139 } |
| 140 }; |
| 141 dart.fn(rewrite_logical_test.if_or, dynamicAnddynamicTodynamic()); |
| 142 rewrite_logical_test.if_and_not = function(x, y) { |
| 143 if (dart.test(x) ? dart.test(y) ? false : true : false) { |
| 144 return 1; |
| 145 } else { |
| 146 return 0; |
| 147 } |
| 148 }; |
| 149 dart.fn(rewrite_logical_test.if_and_not, dynamicAnddynamicTodynamic()); |
| 150 rewrite_logical_test.if_not_and = function(x, y) { |
| 151 if (dart.test(dart.test(x) ? false : y)) { |
| 152 return 1; |
| 153 } else { |
| 154 return 0; |
| 155 } |
| 156 }; |
| 157 dart.fn(rewrite_logical_test.if_not_and, dynamicAnddynamicTodynamic()); |
| 158 rewrite_logical_test.if_not_and_not = function(x, y) { |
| 159 if (dart.test(x) ? false : dart.test(y) ? false : true) { |
| 160 return 1; |
| 161 } else { |
| 162 return 0; |
| 163 } |
| 164 }; |
| 165 dart.fn(rewrite_logical_test.if_not_and_not, dynamicAnddynamicTodynamic()); |
| 166 rewrite_logical_test.if_or_not = function(x, y) { |
| 167 if (dart.test(x) ? true : dart.test(y) ? false : true) { |
| 168 return 1; |
| 169 } else { |
| 170 return 0; |
| 171 } |
| 172 }; |
| 173 dart.fn(rewrite_logical_test.if_or_not, dynamicAnddynamicTodynamic()); |
| 174 rewrite_logical_test.if_not_or = function(x, y) { |
| 175 if (dart.test(dart.test(x) ? y : true)) { |
| 176 return 1; |
| 177 } else { |
| 178 return 0; |
| 179 } |
| 180 }; |
| 181 dart.fn(rewrite_logical_test.if_not_or, dynamicAnddynamicTodynamic()); |
| 182 rewrite_logical_test.if_not_or_not = function(x, y) { |
| 183 if (dart.test(x) ? dart.test(y) ? false : true : true) { |
| 184 return 1; |
| 185 } else { |
| 186 return 0; |
| 187 } |
| 188 }; |
| 189 dart.fn(rewrite_logical_test.if_not_or_not, dynamicAnddynamicTodynamic()); |
| 190 rewrite_logical_test.main = function() { |
| 191 expect$.Expect.equals(1, rewrite_logical_test.cneg_and(true, true)); |
| 192 expect$.Expect.equals(0, rewrite_logical_test.cneg_and(true, false)); |
| 193 expect$.Expect.equals(0, rewrite_logical_test.cneg_and(false, true)); |
| 194 expect$.Expect.equals(0, rewrite_logical_test.cneg_and(false, false)); |
| 195 expect$.Expect.equals(0, rewrite_logical_test.cneg_and_not(true, true)); |
| 196 expect$.Expect.equals(1, rewrite_logical_test.cneg_and_not(true, false)); |
| 197 expect$.Expect.equals(0, rewrite_logical_test.cneg_and_not(false, true)); |
| 198 expect$.Expect.equals(0, rewrite_logical_test.cneg_and_not(false, false)); |
| 199 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and(true, true)); |
| 200 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and(true, false)); |
| 201 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_and(false, true)); |
| 202 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and(false, false)); |
| 203 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and_not(true, true)); |
| 204 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and_not(true, false))
; |
| 205 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_and_not(false, true))
; |
| 206 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_and_not(false, false)
); |
| 207 expect$.Expect.equals(1, rewrite_logical_test.cneg_or(true, true)); |
| 208 expect$.Expect.equals(1, rewrite_logical_test.cneg_or(true, false)); |
| 209 expect$.Expect.equals(1, rewrite_logical_test.cneg_or(false, true)); |
| 210 expect$.Expect.equals(0, rewrite_logical_test.cneg_or(false, false)); |
| 211 expect$.Expect.equals(1, rewrite_logical_test.cneg_or_not(true, true)); |
| 212 expect$.Expect.equals(1, rewrite_logical_test.cneg_or_not(true, false)); |
| 213 expect$.Expect.equals(0, rewrite_logical_test.cneg_or_not(false, true)); |
| 214 expect$.Expect.equals(1, rewrite_logical_test.cneg_or_not(false, false)); |
| 215 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or(true, true)); |
| 216 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_or(true, false)); |
| 217 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or(false, true)); |
| 218 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or(false, false)); |
| 219 expect$.Expect.equals(0, rewrite_logical_test.cneg_not_or_not(true, true)); |
| 220 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or_not(true, false)); |
| 221 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or_not(false, true)); |
| 222 expect$.Expect.equals(1, rewrite_logical_test.cneg_not_or_not(false, false))
; |
| 223 expect$.Expect.equals(true, rewrite_logical_test.value_tobool(true)); |
| 224 expect$.Expect.equals(false, rewrite_logical_test.value_tobool(false)); |
| 225 expect$.Expect.equals(false, rewrite_logical_test.value_negate(true)); |
| 226 expect$.Expect.equals(true, rewrite_logical_test.value_negate(false)); |
| 227 expect$.Expect.equals(true, rewrite_logical_test.value_and(true, true)); |
| 228 expect$.Expect.equals(false, rewrite_logical_test.value_and(true, false)); |
| 229 expect$.Expect.equals(false, rewrite_logical_test.value_and(false, true)); |
| 230 expect$.Expect.equals(false, rewrite_logical_test.value_and(false, false)); |
| 231 expect$.Expect.equals(false, rewrite_logical_test.value_and_not(true, true))
; |
| 232 expect$.Expect.equals(true, rewrite_logical_test.value_and_not(true, false))
; |
| 233 expect$.Expect.equals(false, rewrite_logical_test.value_and_not(false, true)
); |
| 234 expect$.Expect.equals(false, rewrite_logical_test.value_and_not(false, false
)); |
| 235 expect$.Expect.equals(false, rewrite_logical_test.value_not_and(true, true))
; |
| 236 expect$.Expect.equals(false, rewrite_logical_test.value_not_and(true, false)
); |
| 237 expect$.Expect.equals(true, rewrite_logical_test.value_not_and(false, true))
; |
| 238 expect$.Expect.equals(false, rewrite_logical_test.value_not_and(false, false
)); |
| 239 expect$.Expect.equals(false, rewrite_logical_test.value_not_and_not(true, tr
ue)); |
| 240 expect$.Expect.equals(false, rewrite_logical_test.value_not_and_not(true, fa
lse)); |
| 241 expect$.Expect.equals(false, rewrite_logical_test.value_not_and_not(false, t
rue)); |
| 242 expect$.Expect.equals(true, rewrite_logical_test.value_not_and_not(false, fa
lse)); |
| 243 expect$.Expect.equals(true, rewrite_logical_test.value_or(true, true)); |
| 244 expect$.Expect.equals(true, rewrite_logical_test.value_or(true, false)); |
| 245 expect$.Expect.equals(true, rewrite_logical_test.value_or(false, true)); |
| 246 expect$.Expect.equals(false, rewrite_logical_test.value_or(false, false)); |
| 247 expect$.Expect.equals(true, rewrite_logical_test.value_or_not(true, true)); |
| 248 expect$.Expect.equals(true, rewrite_logical_test.value_or_not(true, false)); |
| 249 expect$.Expect.equals(false, rewrite_logical_test.value_or_not(false, true))
; |
| 250 expect$.Expect.equals(true, rewrite_logical_test.value_or_not(false, false))
; |
| 251 expect$.Expect.equals(true, rewrite_logical_test.value_not_or(true, true)); |
| 252 expect$.Expect.equals(false, rewrite_logical_test.value_not_or(true, false))
; |
| 253 expect$.Expect.equals(true, rewrite_logical_test.value_not_or(false, true)); |
| 254 expect$.Expect.equals(true, rewrite_logical_test.value_not_or(false, false))
; |
| 255 expect$.Expect.equals(false, rewrite_logical_test.value_not_or_not(true, tru
e)); |
| 256 expect$.Expect.equals(true, rewrite_logical_test.value_not_or_not(true, fals
e)); |
| 257 expect$.Expect.equals(true, rewrite_logical_test.value_not_or_not(false, tru
e)); |
| 258 expect$.Expect.equals(true, rewrite_logical_test.value_not_or_not(false, fal
se)); |
| 259 expect$.Expect.equals(0, rewrite_logical_test.if_negate(true)); |
| 260 expect$.Expect.equals(1, rewrite_logical_test.if_negate(false)); |
| 261 expect$.Expect.equals(1, rewrite_logical_test.if_and(true, true)); |
| 262 expect$.Expect.equals(0, rewrite_logical_test.if_and(true, false)); |
| 263 expect$.Expect.equals(0, rewrite_logical_test.if_and(false, true)); |
| 264 expect$.Expect.equals(0, rewrite_logical_test.if_and(false, false)); |
| 265 expect$.Expect.equals(0, rewrite_logical_test.if_and_not(true, true)); |
| 266 expect$.Expect.equals(1, rewrite_logical_test.if_and_not(true, false)); |
| 267 expect$.Expect.equals(0, rewrite_logical_test.if_and_not(false, true)); |
| 268 expect$.Expect.equals(0, rewrite_logical_test.if_and_not(false, false)); |
| 269 expect$.Expect.equals(0, rewrite_logical_test.if_not_and(true, true)); |
| 270 expect$.Expect.equals(0, rewrite_logical_test.if_not_and(true, false)); |
| 271 expect$.Expect.equals(1, rewrite_logical_test.if_not_and(false, true)); |
| 272 expect$.Expect.equals(0, rewrite_logical_test.if_not_and(false, false)); |
| 273 expect$.Expect.equals(0, rewrite_logical_test.if_not_and_not(true, true)); |
| 274 expect$.Expect.equals(0, rewrite_logical_test.if_not_and_not(true, false)); |
| 275 expect$.Expect.equals(0, rewrite_logical_test.if_not_and_not(false, true)); |
| 276 expect$.Expect.equals(1, rewrite_logical_test.if_not_and_not(false, false)); |
| 277 expect$.Expect.equals(1, rewrite_logical_test.if_or(true, true)); |
| 278 expect$.Expect.equals(1, rewrite_logical_test.if_or(true, false)); |
| 279 expect$.Expect.equals(1, rewrite_logical_test.if_or(false, true)); |
| 280 expect$.Expect.equals(0, rewrite_logical_test.if_or(false, false)); |
| 281 expect$.Expect.equals(1, rewrite_logical_test.if_or_not(true, true)); |
| 282 expect$.Expect.equals(1, rewrite_logical_test.if_or_not(true, false)); |
| 283 expect$.Expect.equals(0, rewrite_logical_test.if_or_not(false, true)); |
| 284 expect$.Expect.equals(1, rewrite_logical_test.if_or_not(false, false)); |
| 285 expect$.Expect.equals(1, rewrite_logical_test.if_not_or(true, true)); |
| 286 expect$.Expect.equals(0, rewrite_logical_test.if_not_or(true, false)); |
| 287 expect$.Expect.equals(1, rewrite_logical_test.if_not_or(false, true)); |
| 288 expect$.Expect.equals(1, rewrite_logical_test.if_not_or(false, false)); |
| 289 expect$.Expect.equals(0, rewrite_logical_test.if_not_or_not(true, true)); |
| 290 expect$.Expect.equals(1, rewrite_logical_test.if_not_or_not(true, false)); |
| 291 expect$.Expect.equals(1, rewrite_logical_test.if_not_or_not(false, true)); |
| 292 expect$.Expect.equals(1, rewrite_logical_test.if_not_or_not(false, false)); |
| 293 }; |
| 294 dart.fn(rewrite_logical_test.main, VoidTodynamic()); |
| 295 // Exports: |
| 296 exports.rewrite_logical_test = rewrite_logical_test; |
| 297 }); |
OLD | NEW |