Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (9 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/polymorphism.cfa

    r2f47ea4 rfd54fef  
    1818#include <fstream.hfa>
    1919
    20 forall(otype T)
     20forall(T)
    2121T f(T x, T y) {
    2222        x = y;
     
    2424}
    2525
    26 forall(otype T) T ident(T x) {
     26forall(T) T ident(T x) {
    2727        return x;
    2828}
    2929
    30 forall( otype T, otype U )
     30forall( T, U )
    3131size_t struct_size( T i, U j ) {
    3232        struct S { T i; U j; };
     
    3434}
    3535
    36 forall( otype T, otype U )
     36forall( T, U )
    3737size_t union_size( T i, U j ) {
    3838        union B { T i; U j; };
     
    4141
    4242// perform some simple operations on aggregates of T and U
    43 forall( otype T | { void print(T); int ?==?(T, T); }, otype U | { void print(U); U ?=?(U&, zero_t); } )
     43forall( T | { void print(T); int ?==?(T, T); }, U | { void print(U); U ?=?(U&, zero_t); } )
    4444U foo(T i, U j) {
    4545        struct S { T i; U j; };
Note: See TracChangeset for help on using the changeset viewer.