ADT
        arm-eh
        ast-experimental
        enum
        forall-pointer-decay
        jacob/cs343-translation
        new-ast-unique-expr
        pthread-emulation
        qualifiedEnum
      
      
        
          | Last change
 on this file since f03e11d was             07c77ce, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago | 
        
          | 
add test for quasi-keywords
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.2 KB | 
      
      
| Rev | Line |  | 
|---|
| [07c77ce] | 1 | // | 
|---|
|  | 2 | // Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo | 
|---|
|  | 3 | // | 
|---|
|  | 4 | // quasiKeyword.cfa -- test that quasi-keywords can be used for variable and functions names, as well as keywords in | 
|---|
|  | 5 | //                                         control structures. | 
|---|
|  | 6 | // | 
|---|
|  | 7 | // Author           : Peter A. Buhr | 
|---|
|  | 8 | // Created On       : Wed Feb 17 10:33:49 2021 | 
|---|
|  | 9 | // Last Modified By : Peter A. Buhr | 
|---|
|  | 10 | // Last Modified On : Sun Feb 21 15:52:04 2021 | 
|---|
|  | 11 | // Update Count     : 7 | 
|---|
|  | 12 | // | 
|---|
|  | 13 |  | 
|---|
|  | 14 | #include <exception.hfa> | 
|---|
|  | 15 |  | 
|---|
|  | 16 | TRIVIAL_EXCEPTION( E ); | 
|---|
|  | 17 |  | 
|---|
|  | 18 | void catch( int i ) {} | 
|---|
|  | 19 | void recover( int i ) {} | 
|---|
|  | 20 | void catchResume( int i ) {} | 
|---|
|  | 21 | void fixup( int i ) {} | 
|---|
|  | 22 | void finally( int i ) {} | 
|---|
|  | 23 |  | 
|---|
|  | 24 | int main(int argc, char const *argv[]) { | 
|---|
|  | 25 | int catch, recover, catchResume, fixup, finally; | 
|---|
|  | 26 | try { | 
|---|
|  | 27 | catch = 3; | 
|---|
|  | 28 | catch( catch ); | 
|---|
|  | 29 | recover = 3; | 
|---|
|  | 30 | recover( recover ); | 
|---|
|  | 31 | catchResume = 3; | 
|---|
|  | 32 | catchResume( catchResume ); | 
|---|
|  | 33 | fixup = 3; | 
|---|
|  | 34 | fixup( fixup ); | 
|---|
|  | 35 | finally = 3; | 
|---|
|  | 36 | finally( finally ); | 
|---|
|  | 37 | throw (E){}; | 
|---|
|  | 38 | report (E){}; | 
|---|
|  | 39 | throwResume (E){}; | 
|---|
|  | 40 | } catch ( E * ) { | 
|---|
|  | 41 | } recover ( E * ) {                                                                     // same as catch | 
|---|
|  | 42 | } catchResume ( E * ) { | 
|---|
|  | 43 | } fixup ( E * ) {                                                                       // same as catchResume | 
|---|
|  | 44 | } finally { | 
|---|
|  | 45 | } | 
|---|
|  | 46 |  | 
|---|
|  | 47 | if ( 3 ) | 
|---|
|  | 48 | try { | 
|---|
|  | 49 | } fixup ( E * ) { | 
|---|
|  | 50 | } finally { | 
|---|
|  | 51 | } | 
|---|
|  | 52 | else catch = 3; | 
|---|
|  | 53 |  | 
|---|
|  | 54 | #pragma message( "Compiled" )                                           // force non-empty .expect file | 
|---|
|  | 55 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.