Changeset 983f486 for libcfa/src


Ignore:
Timestamp:
May 7, 2024, 10:33:40 PM (6 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
c2a4b62, e542b02
Parents:
9b140bd
Message:

Reformat forall clause in enum.hfa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.hfa

    r9b140bd r983f486  
    11#pragma once
    22
    3 forall(E) trait Bounded {
    4     E lowerBound();
    5     E upperBound();
    6 };
     3forall(T) { // T is the based type of enum(T)
     4    forall(E) trait Bounded {
     5        E lowerBound();
     6        E upperBound();
     7    };
    78
    8 forall(E, T| Bounded(E)) trait Serial {
    9     unsigned fromInstance(E e);
    10     E fromInt(unsigned i);
    11     E succ(E e);
    12     E pred(E e);
    13 };
     9    forall(E| Bounded(E, T)) trait Serial {
     10        unsigned fromInstance(E e);
     11        E fromInt(unsigned i);
     12        E succ(E e);
     13        E pred(E e);
     14    };
    1415
    15 // Opague Enum + TypedEnum
    16 forall(E, T | Serial(E, T)) trait CfaEnum {
    17     char * labelE(E e);
    18     unsigned int posE(E e);
    19 };
     16    // Opague Enum + TypedEnum
     17    forall(E | Serial(E, T)) trait CfaEnum {
     18        char * labelE(E e);
     19        unsigned int posE(E e);
     20    };
    2021
    21 forall(E, T | CfaEnum(E, T)) trait TypedEnum {
    22     T valueE(E e);
    23 };
     22    forall(E | CfaEnum(E, T)) trait TypedEnum {
     23        T valueE(E e);
     24    };
     25}
    2426
    2527forall(E, T| TypedEnum(E, T)) {
     
    3436
    3537    // for testing; To be removed
     38    // char * typeEnumString(E e);
    3639    char * typeEnumString(E e);
    3740}
Note: See TracChangeset for help on using the changeset viewer.