Changeset fd54fef for tests/sum.cfa


Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
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/sum.cfa

    r2f47ea4 rfd54fef  
    1818#include <stdlib.hfa>
    1919
    20 trait sumable( otype T ) {
     20trait sumable( T ) {
    2121        void ?{}( T &, zero_t );                                                        // 0 literal constructor
    2222        T ?+?( T, T );                                                                          // assortment of additions
     
    2626}; // sumable
    2727
    28 forall( otype T | sumable( T ) )                                                // use trait
     28forall( T | sumable( T ) )                                              // use trait
    2929T sum( size_t size, T a[] ) {
    3030        T total = 0;                                                                            // initialize by 0 constructor
     
    107107                 | sum( size, (S *)a ) | ", check" | (S)s;
    108108
    109         forall( otype Impl | sumable( Impl ) )
     109        forall( Impl | sumable( Impl ) )
    110110        struct GS {
    111111                Impl * x, * y;
     
    194194                 sum( size, (S *)a ).[i, j], s.[i, j] );
    195195
    196         forall( otype Impl | sumable( Impl ) )
     196        forall( Impl | sumable( Impl ) )
    197197        struct GS {
    198198                Impl * x, * y;
Note: See TracChangeset for help on using the changeset viewer.