Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (10 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
dafbde8
Parents:
2f47ea4
Message:

Converting the project to use the new syntax for otype, dtype and ttytpe.

Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/zombies/it_out.c

    r2f47ea4 rfd54fef  
    1616typedef unsigned long streamsize_type;
    1717
    18 trait ostream( dtype os_type ) {
     18trait ostream( os_type & ) {
    1919        os_type *write( os_type *, const char *, streamsize_type );
    2020        int fail( os_type * );
    2121};
    2222
    23 trait writeable( otype T ) {
    24         forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, T );
     23trait writeable( T ) {
     24        forall( os_type & | ostream( os_type ) ) os_type * ?<<?( os_type *, T );
    2525};
    2626
    27 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, char );
    28 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, int );
    29 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, const char * );
     27forall( os_type & | ostream( os_type ) ) os_type * ?<<?( os_type *, char );
     28forall( os_type & | ostream( os_type ) ) os_type * ?<<?( os_type *, int );
     29forall( os_type & | ostream( os_type ) ) os_type * ?<<?( os_type *, const char * );
    3030
    31 trait istream( dtype is_type ) {
     31trait istream( is_type & ) {
    3232        is_type *read( is_type *, char *, streamsize_type );
    3333        is_type *unread( is_type *, char );
     
    3636};
    3737
    38 trait readable( otype T ) {
    39         forall( dtype is_type | istream( is_type ) ) is_type * ?<<?( is_type *, T );
     38trait readable( T ) {
     39        forall( is_type & | istream( is_type ) ) is_type * ?<<?( is_type *, T );
    4040};
    4141
    42 forall( dtype is_type | istream( is_type ) ) is_type * ?>>?( is_type *, char* );
    43 forall( dtype is_type | istream( is_type ) ) is_type * ?>>?( is_type *, int* );
     42forall( is_type & | istream( is_type ) ) is_type * ?>>?( is_type *, char* );
     43forall( is_type & | istream( is_type ) ) is_type * ?>>?( is_type *, int* );
    4444
    45 trait iterator( otype iterator_type, otype elt_type ) {
     45trait iterator( iterator_type, elt_type ) {
    4646        iterator_type ?++( iterator_type* );
    4747        iterator_type ++?( iterator_type* );
     
    5252};
    5353
    54 forall( otype elt_type | writeable( elt_type ),
    55                 otype iterator_type | iterator( iterator_type, elt_type ),
    56                 dtype os_type | ostream( os_type ) )
     54forall( elt_type | writeable( elt_type ),
     55                iterator_type | iterator( iterator_type, elt_type ),
     56                os_type & | ostream( os_type ) )
    5757void write_all( iterator_type begin, iterator_type end, os_type *os );
    5858
    59 forall( otype elt_type | writeable( elt_type ),
    60                 otype iterator_type | iterator( iterator_type, elt_type ),
    61                 dtype os_type | ostream( os_type ) )
     59forall( elt_type | writeable( elt_type ),
     60                iterator_type | iterator( iterator_type, elt_type ),
     61                os_type & | ostream( os_type ) )
    6262void write_all( elt_type begin, iterator_type end, os_type *os ) {
    6363        os << begin;
Note: See TracChangeset for help on using the changeset viewer.