about summary refs log tree commit diff stats
path: root/012transform.cc
Commit message (Expand)AuthorAgeFilesLines
* 3760 - force functions to use dependency-injectionKartik K. Agaram2017-03-071-0/+1
* 3561Kartik K. Agaram2016-10-221-2/+2
* 3555Kartik K. Agaram2016-10-221-1/+1
* 3522Kartik K. Agaram2016-10-191-6/+6
* 3520Kartik K. Agaram2016-10-181-3/+0
* 3437Kartik K. Agaram2016-10-041-1/+0
* 3436Kartik K. Agaram2016-10-041-2/+5
* 3435Kartik K. Agaram2016-10-041-0/+3
* 2882 - warn if programmer overuses transform_all()Kartik K. Agaram2016-04-281-0/+12
* 2815Kartik K. Agaram2016-03-271-1/+1
* 2799 - new approach to undoing changes in testsKartik K. Agaram2016-03-201-7/+0
* 2797 - bugfix: transform can create recipesKartik K. Agaram2016-03-191-0/+7
* 2796Kartik K. Agaram2016-03-191-5/+0
* 2775 - test rewrite-stash transformKartik K. Agaram2016-03-131-0/+5
* 2773 - switch to 'int'Kartik K. Agaram2016-03-131-5/+5
* 2728 - don't ignore /space: while checking typesKartik K. Agaram2016-03-041-0/+6
* 2494Kartik K. Agaram2015-11-281-0/+8
* 2458 - edit/: recipe side free of sandbox errorsKartik K. Agaram2015-11-181-0/+1
* 2393 - redo 2391Kartik K. Agaram2015-11-071-1/+1
* 2392 - undo 2391Kartik K. Agaram2015-11-071-1/+1
* 2391Kartik K. Agaram2015-11-071-1/+1
* 2382Kartik K. Agaram2015-11-061-0/+1
* 2374 - now edit works until layer 8Kartik K. Agaram2015-11-051-4/+0
* 2373 - bad bug: instruction was losing /lookupKartik K. Agaram2015-11-051-0/+4
* 2364Kartik K. Agaram2015-11-051-0/+10
* 2358 - starting to tackle the phase ordering problemKartik K. Agaram2015-11-041-1/+5
* 2316 - preparing for static dispatchKartik K. Agaram2015-10-291-1/+2
* 2311Kartik K. Agaram2015-10-291-0/+4
* 2154 - check types only after loading all layersKartik K. Agaram2015-09-051-0/+1
* 2095Kartik K. Agaram2015-08-281-2/+0
* 1702 - experiment: start using 'ordinal' in namesKartik K. Agaram2015-07-041-4/+4
* 1699 - first-class recipe typesKartik K. Agaram2015-07-031-0/+1
* 1399 - better 'unknown type' warningsKartik K. Agaram2015-05-181-1/+1
* 1391 - avoid unsigned integersKartik K. Agaram2015-05-171-5/+5
* 1387Kartik K. Agaram2015-05-161-2/+2
* 1357 - temporarily revert floating-point supportKartik K. Agaram2015-05-121-1/+1
* 1356 - snapshot #2: floating point supportKartik K. Agaram2015-05-121-1/+1
* 1343Kartik K. Agaram2015-05-111-1/+1
* 1323 - keyboard supports backspace and newlineKartik K. Agaram2015-05-101-5/+2
* 1299 - stop using [] in any vectorKartik K. Agaram2015-05-071-4/+4
* 1276 - make C++ version the defaultKartik K. Agaram2015-05-051-0/+55
003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# print msg to screen if a != b, otherwise print "."
fn check-ints-equal _a: int, b: int, msg: (addr array byte) {
  var a/eax: int <- copy _a
  compare a, b
  {
    break-if-!=
    draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg
    return
  }
  draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg
  move-cursor-to-left-margin-of-next-line 0/screen
  count-test-failure
}

fn test-check-ints-equal {
  check-ints-equal 0, 0, "abc"
}

fn check _a: boolean, msg: (addr array byte) {
  var a/eax: int <- copy _a
  compare a, 0/false
  {
    break-if-=
    draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg
    return
  }
  draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg
  move-cursor-to-left-margin-of-next-line 0/screen
  count-test-failure
}

fn check-not _a: boolean, msg: (addr array byte) {
  var a/eax: int <- copy _a
  compare a, 0/false
  {
    break-if-!=
    draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg
    return
  }
  draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg
  move-cursor-to-left-margin-of-next-line 0/screen
  count-test-failure
}
97 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939