Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (16 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, enum, forall-pointer-decay, 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
  • libcfa/src/containers/maybe.cfa

    r2f47ea4 rfd54fef  
    1818
    1919
    20 forall(otype T)
     20forall(T)
    2121void ?{}(maybe(T) & this) {
    2222        this.has_value = false;
    2323}
    2424
    25 forall(otype T)
     25forall(T)
    2626void ?{}(maybe(T) & this, T value) {
    2727        this.has_value = true;
     
    2929}
    3030
    31 forall(otype T)
     31forall(T)
    3232void ?{}(maybe(T) & this, maybe(T) other) {
    3333        this.has_value = other.has_value;
     
    3737}
    3838
    39 forall(otype T)
     39forall(T)
    4040maybe(T) ?=?(maybe(T) & this, maybe(T) that) {
    4141        if (this.has_value && that.has_value) {
     
    5151}
    5252
    53 forall(otype T)
     53forall(T)
    5454void ^?{}(maybe(T) & this) {
    5555        if (this.has_value) {
     
    5858}
    5959
    60 forall(otype T)
     60forall(T)
    6161bool ?!=?(maybe(T) this, zero_t) {
    6262        return this.has_value;
    6363}
    6464
    65 forall(otype T)
     65forall(T)
    6666maybe(T) maybe_value(T value) {
    6767        return (maybe(T)){value};
    6868}
    6969
    70 forall(otype T)
     70forall(T)
    7171maybe(T) maybe_none() {
    7272        return (maybe(T)){};
    7373}
    7474
    75 forall(otype T)
     75forall(T)
    7676bool has_value(maybe(T) * this) {
    7777        return this->has_value;
    7878}
    7979
    80 forall(otype T)
     80forall(T)
    8181T get(maybe(T) * this) {
    8282        assertf(this->has_value, "attempt to get from maybe without value");
     
    8484}
    8585
    86 forall(otype T)
     86forall(T)
    8787void set(maybe(T) * this, T value) {
    8888        if (this->has_value) {
     
    9494}
    9595
    96 forall(otype T)
     96forall(T)
    9797void set_none(maybe(T) * this) {
    9898        if (this->has_value) {
Note: See TracChangeset for help on using the changeset viewer.