1.2.36. test/regress/rt-1.01.36

Start felix section to test/regress/rt-1.01.36-0.flx[1 /1 ]
     1: #line 1373 "./lpsrc/flx_regress.pak"
     2: //Check generators
     3: #import <flx.flxh>
     4: 
     5: var cheat : int = 0;
     6: gen f():int = {
     7:   ++cheat;
     8:   //print "Generator "; print cheat; endl;
     9:   return cheat;
    10: }
    11: 
    12: print "F 1="; print$ f(); endl; // 1
    13: 
    14: body """
    15:   static int x = 0;
    16:   int g() { ++x; return x; }
    17: """;
    18: 
    19: gen g : 1 -> int;
    20: 
    21: print "C 1="; print$ g(); endl; // 1
    22: 
    23: fun d(x:int) => x + x;
    24: 
    25: // all these should be even
    26: print "F Even? "; print$ d(f()); endl; // 4
    27: print "F Even? "; print$ d(f()); endl; // 6
    28: 
    29: print "C Even? "; print$ d(g()); endl; // 4
    30: print "C Even? "; print$ d(g()); endl; // 6
    31: 
    32: print "F 4="; print$ f(); endl; // 4
    33: print "C 4="; print$ g(); endl; // 4
End felix section to test/regress/rt-1.01.36-0.flx[1]
Start data section to test/regress/rt-1.01.36-0.expect[1 /1 ]
     1: F 1=1
     2: C 1=1
     3: F Even? 4
     4: F Even? 6
     5: C Even? 4
     6: C Even? 6
     7: F 4=4
     8: C 4=4
End data section to test/regress/rt-1.01.36-0.expect[1]