1.2. Bad tests
All these should fail gracefully at (felix) compile time.
Run the compiler with the -e option to invert
the return code parity.
Start felix section to test/bt01.flx[1
/1
]
1: #line 798 "./lpsrc/flx_regress.pak"
2: basic parser error
3:
Start felix section to test/bt02.flx[1
/1
]
1: #line 801 "./lpsrc/flx_regress.pak"
2: module X { proc p(){} }
3: module Y { proc p(){} }
4: open X;
5: open Y;
6: p;
7:
Start felix section to test/bt03.flx[1
/1
]
1: #line 808 "./lpsrc/flx_regress.pak"
2:
3:
4: interface I { proc print_endl:int; }
5: module X {
6: module M { proc print_endl (a:int) { print a; endl; } }
7: module B = M:I;
8: }
9: open X;
10: open B;
11: print_endl 1;
12:
Start felix section to test/bt04.flx[1
/1
]
1: #line 820 "./lpsrc/flx_regress.pak"
2:
3:
4: val aa = bb + 1;
5: val bb = aa + 1;
6:
Start felix section to test/bt05.flx[1
/1
]
1: #line 826 "./lpsrc/flx_regress.pak"
2:
3: type int = "int";
4: fun neg(a:int) = { return -a; }
5:
Start felix section to test/bt06.flx[1
/1
]
1: #line 831 "./lpsrc/flx_regress.pak"
2:
3:
4:
5: module X
6: {
7: private fun f:int -> int = "$1";
8: val x = f 1;
9: }
10: open X;
11: val x = f 1;
12:
Start felix section to test/bt07.flx[1
/1
]
1: #line 843 "./lpsrc/flx_regress.pak"
2:
3:
4:
Start data section to test/bt08.imp[1
/1
]
Start felix section to test/bt08.flx[1
/1
]
1: #line 850 "./lpsrc/flx_regress.pak"
2:
3:
4:
Start felix section to test/bt09.flx[1
/1
]
1: #line 854 "./lpsrc/flx_regress.pak"
2:
3:
4:
5: /*
6: [skaller@pelican] ~/links/flx>g++ -w -I. sss.cpp
7: sss.cpp: In member function `virtual flx::rtl::con_t*
8: _i12_p11__init_::resume()':
9: sss.cpp:256: no matching function for call to `_i15_p6__lam_1::call(
10: flx::rtl::con_t*&, _i18_f8__lam_2*&)'
11: sss.cpp:121: candidates are: virtual flx::rtl::con_t*
12: _i15_p6__lam_1::call(flx::rtl::con_t*)
13: */
14: ctypes int;
15: { var x:int; read x; }
16:
17: { {var x:int; read x; } }
18:
19: ;
20:
Start felix section to test/bt10.flx[1
/1
]
1: #line 874 "./lpsrc/flx_regress.pak"
2:
3:
4: fun f(x:int):int =
5: {
6: if x == 1 do return 1; done;
7: }
8: print (f 1); endl;
9: