#include <perms.h>

                                                                //      1  ! Testing comment removal
                                                                //      2  %begin
#line 2 "regression-run-tmp/semicomment.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      3  
                                                                //      4  %constintegerarray fred(0:2) = ;! A comment here???!
#line 4 "regression-run-tmp/semicomment.imp"
const int FRED[3] = { 1, 2, 3,  };
                                                                //      5            1,2,
                                                                //      6            ! comment?
                                                                //      7            3
                                                                //      8  
                                                                //      9  %routine jim(%integer p,
#line 9 "regression-run-tmp/semicomment.imp"
void JIM( int P, int Q )
#line 9 "regression-run-tmp/semicomment.imp"
{
                                                                //     10               %integer q)
                                                                //     11  %end
#line 11 "regression-run-tmp/semicomment.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block JIM at level 2
                                                                //     12  
                                                                //     13  
                                                                //     14  ! Imp77 allows multiple blank lines following a continuation (%c or ',' or '=')
                                                                //     15  
                                                                //     16  %constc
                                                                //     17  
                                                                //     18  
                                                                //     19  %integerarray sheila(0:2) =
#line 19 "regression-run-tmp/semicomment.imp"
const int SHEILA[3] = { 1, 2, 3,  };
                                                                //     20  
                                                                //     21  
                                                                //     22            1,2,
                                                                //     23  
                                                                //     24            3
                                                                //     25  
                                                                //     26  
                                                                //     27  %switch lab(1:4)
#line 27 "regression-run-tmp/semicomment.imp"
static int sw1_LAB_idx;
static const void * /*SWITCH*/ sw1_LAB[4] = { &&sw1_LAB_1, &&sw1_LAB_2, &&sw1_LAB_3, &&sw1_LAB_4,  };
                                                                //     28  %integer i
#line 28 "regression-run-tmp/semicomment.imp"
int I;
                                                                //     29  %constinteger one=1, two=2, three=3
                                                                //     30  
                                                                //     31  i = sheila(2)
#line 31 "regression-run-tmp/semicomment.imp"
I = SHEILA[2];
                                                                //     32  
                                                                //     33  lab(':'+one+two-':'):  !    i=9
#line 33 "regression-run-tmp/semicomment.imp"
sw1_LAB_3:;
                                                                //     34                                          ;! %commc
                                                                //     35                                           ! %ment { here
                                                                //     36  print string("test 0"); newline
#line 36 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 0"));
#line 36 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     37  print string("If there is output mentioning test 0 above, test 0 passed"); newline
#line 37 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("If there is output mentioning test 0 above, test 0 passed"));
#line 37 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     38  
                                                                //     39  %comment %c {}
                                                                //     40  print string("test 1"); newline   ;! The {} after the %c nullifies the continuation.
#line 40 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 1"));
#line 40 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     41  print string("If there is output mentioning test 1 above, test 1 passed"); newline
#line 41 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("If there is output mentioning test 1 above, test 1 passed"));
#line 41 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     42  
                                                                //     43  %comment %c
                                                                //     44  print string("test 2a failed - this is part of the comment above") %and newline; print string("test 2b failed - semicolons should not be honoured in %comments"); newline
                                                                //     45  print string("If there is no output mentioning test 2 above, test2 passed"); newline
#line 45 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("If there is no output mentioning test 2 above, test2 passed"));
#line 45 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     46  ! Trailing space below:
                                                                //     47  %comment %c 
                                                                //     48  print string("test 3"); newline
#line 48 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 3"));
#line 48 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     49  print string("If there is output mentioning test 3 above, test 3 passed"); newline
#line 49 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("If there is output mentioning test 3 above, test 3 passed"));
#line 49 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     50  
                                                                //     51  ! Trailing tab below:
                                                                //     52  %comment %c      
                                                                //     53  print string("test 4"); newline
#line 53 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 4"));
#line 53 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     54  print string("If there is output mentioning test 4 above, test 4 passed"); newline
#line 54 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("If there is output mentioning test 4 above, test 4 passed"));
#line 54 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     55  
                                                                //     56  
                                                                //     57  lab(':'+two+two*':'-':'*3): %comment %c
#line 57 "regression-run-tmp/semicomment.imp"
sw1_LAB_2:;
                                                                //     58  error?
                                                                //     59  
                                                                //     60                                          %comment ' { again
                                                                //     61                                          %comment   { 'again
                                                                //     62                                          %comment   { again } '
                                                                //     63  
                                                                //     64  %comment %c
                                                                //     65  
                                                                //     66  This this part of the comment in Imp77!
                                                                //     67  
                                                                //     68  ! %c
                                                                //     69  print string("Note that %c is not honoured within a '!' comment..."); newline
#line 69 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("Note that %c is not honoured within a '!' comment..."));
#line 69 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     70  
                                                                //     71  !  a comment with an unbalanced ' is a problem
                                                                //     72  print string("test 5 passed"); newline
#line 72 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 5 passed"));
#line 72 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     73  
                                                                //     74  {  a comment with an unbalanced ' is a problem
                                                                //     75  print string("test 6 passed"); newline
#line 75 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 6 passed"));
#line 75 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     76  
                                                                //     77  {  a comment with an unbalanced ' is a problem }
                                                                //     78  print string("test 7 passed"); newline
#line 78 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 7 passed"));
#line 78 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     79  
                                                                //     80  %comment  a comment with an unbalanced ' is a problem
                                                                //     81  print string("test 8 passed"); newline
#line 81 "regression-run-tmp/semicomment.imp"
_imp_PRINTSTRING(_imp_str_literal("test 8 passed"));
#line 81 "regression-run-tmp/semicomment.imp"
_imp_NEWLINE();
                                                                //     82  
                                                                //     83  lab(*):
#line 83 "regression-run-tmp/semicomment.imp"
sw1_LAB_default:;
                                                                //     84  !}
                                                                //     85  
                                                                //     86  ! The conclusion from these tests is that "!" or "{" after a label don't need special handling
                                                                //     87  ! but that we should pass "%comment" through untouched
                                                                //     88  
                                                                //     89  ! And that whitespace characters after "%c" are significant.
                                                                //     90  
                                                                //     91  %end{}%of%pro %gram
#line 91 "regression-run-tmp/semicomment.imp"
/* Remove %on %event handler here if present for this block */
return 0;
sw1_LAB_1:;
sw1_LAB_4:;
goto sw1_LAB_default;
} // End of block _imp_main at level 1
#line 91 "regression-run-tmp/semicomment.imp"
// End of file
