| 1 |
// unit test for single-line comments followed by end-of-file |
| 2 |
// |
| 3 |
// verified: was crashing when the code was parsed by ck compiler |
| 4 |
// using flex/bison through yy_scan_string() -- e.g., |
| 5 |
// how `Machine.eval()` is parsed or originating from |
| 6 |
// a code buffer in miniAudicle or WebChucK IDE |
| 7 |
// |
| 8 |
// issue seems related to the `comment_hack` macro |
| 9 |
// in chuck.lex; we have since moved to a different |
| 10 |
// way of handling single-line comments; this checks |
| 11 |
// it still works! |
| 12 |
// |
| 13 |
// https://github.com/ccrma/chuck/issues/366 |
| 14 |
|
| 15 |
// try single-line comment |
| 16 |
Machine.eval( "<<< \"success\" >>>; // " ); |
| 17 |
|
| 18 |
// try block comment |
| 19 |
Machine.eval( "<<< \"success\" >>>; /*" ); |
| 20 |
Machine.eval( "<<< \"success\" >>>; /* " ); |
| 21 |
Machine.eval( "<<< \"success\" >>>; /* " ); |
| 22 |
Machine.eval( "<<< \"success\" >>>; /**" ); |
| 23 |
Machine.eval( "<<< \"success\" >>>; /* *" ); |
| 24 |
Machine.eval( "<<< \"success\" >>>; /* */" ); |
| 25 |
Machine.eval( "<<< \"success\" >>>; /* */ " ); |