Changeset 948fdef for tests


Ignore:
Timestamp:
Feb 1, 2020, 1:27:09 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
33a484f
Parents:
c334ecd
Message:

change backquotes identifiers to xxx syntax, change priority of postfix function call

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/expression.cfa

    rc334ecd r948fdef  
     1struct S { int i; };
     2void ?{}( S & s, int i ) {}
     3int ?`mary( int );
     4int ?`mary( S );
     5[int] ?`mary( [int, int] );
     6int jack( int );
     7
    18int main() {
    2     struct s { int i; } x, *p = &x;
    3     int i = 3;
     9    int a[3] = { 0, 0, 0 };
     10    S s = { 3 }, * ps = &s;
     11    [int] t;
     12    * [int] pt = &t;
     13    int i = 3, j = 4;
    414
    515    // operators
     
    919    +i;
    1020    -i;
    11     *p;
    12     ++p;
    13     --p;
    14     p++;
    15     p--;
     21    *ps;
     22    ++ps;
     23    --ps;
     24    ps++;
     25    ps--;
    1626
    17     i+i;
    18     i-i;
    19     i*i;
     27    i+j;
     28    i-j;
     29    i*j;
    2030
    21     i/i;
    22     i%i;
    23     i^i;
    24     i&i;
    25     i|i;
    26     i<i;
    27     i>i;
    28     i=i;
     31    i/j;
     32    i%j;
     33    i^j;
     34    i&j;
     35    i|j;
     36    i<j;
     37    i>j;
     38    i=j;
    2939
    30     i==i;
    31     i!=i;
    32     i<<i;
    33     i>>i;
    34     i<=i;
    35     i>=i;
    36     i&&i;
    37     i||i;
    38     p->i;
    39     i*=i;
    40     i/=i;
    41     i%=i;
    42     i+=i;
    43     i-=i;
    44     i&=i;
    45     i|=i;
    46     i^=i;
    47     i<<=i;
    48     i>>=i;
     40    i==j;
     41    i!=j;
     42    i<<j;
     43    i>>j;
     44    i<=j;
     45    i>=j;
     46    i&&j;
     47    i||j;
     48    ps->i;
    4949
    50     i?i:i;
     50    i*=j;
     51    i/=j;
     52    i%=j;
     53    i+=j;
     54    i-=j;
     55    i&=j;
     56    i|=j;
     57    i^=j;
     58    i<<=j;
     59    i>>=j;
     60
     61    i?i:j;
     62
     63    // postfix function call
     64
     65    (3 + 4)`mary;
     66    ({3 + 4;})`mary;
     67    [3, 4]`mary;
     68    3`mary;
     69    a[0]`mary;
     70    a[0]`mary`mary;
     71    s{0}`mary;
     72    jack(3)`mary;
     73    s.i`mary;
     74    t.0`mary;
     75    s.[i]`mary;
     76    ps->i`mary;
     77    pt->0`mary;
     78    ps->[i]`mary;
     79    i++`mary;
     80    i--`mary;
     81    (S){2}`mary;
     82    (S)@{2}`mary;
    5183} // main
  • tests/quotedKeyword.cfa

    rc334ecd r948fdef  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:45:53 2018
    13 // Update Count     : 23
     12// Last Modified On : Sat Feb  1 00:02:22 2020
     13// Update Count     : 24
    1414//
    1515
     
    1717
    1818struct {
    19         int `otype`;
    20         int `struct`;
     19        int ``otype``;
     20        int ``struct``;
    2121} st = { 10, 10 };
    2222
    23 typedef int `forall`;
    24 `forall` xxx = 10;
     23typedef int ``forall``;
     24``forall`` xxx = 10;
    2525
    26 int `_Alignas`, `_Alignof`, `__alignof`, `__alignof__`, `asm`, `__asm`, `__asm__`, `_At`, `_Atomic`, `__attribute`,
    27         `__attribute__`, `auto`, `_Bool`, `break`, `case`, `catch`, `catchResume`, `char`, `choose`, `_Complex`, `__complex`,
    28         `__complex__`, `const`, `__const`, `__const__`, `continue`, `default`, `disable`, `do`, `double`, `dtype`, `else`,
    29         `enable`, `enum`, `__extension__`, `extern`, `fallthru`, `finally`, `float`, `__float128`, `for`, `forall`, `fortran`,
    30         `ftype`, `_Generic`, `goto`, `if`, `_Imaginary`, `__imag`, `__imag__`, `inline`, `__inline`, `__inline__`, `int`,
    31         `__int128`, `__label__`, `long`, `lvalue`, `_Noreturn`, `__builtin_offsetof`, `otype`, `register`, `restrict`,
    32         `__restrict`, `__restrict__`, `return`, `short`, `signed`, `__signed`, `__signed__`, `sizeof`, `static`,
    33         `_Static_assert`, `struct`, `switch`, `_Thread_local`, `throw`, `throwResume`, `trait`, `try`, `typedef`,
    34         `typeof`, `__typeof`, `__typeof__`, `union`, `unsigned`, `__builtin_va_list`, `void`, `volatile`, `__volatile`,
    35         `__volatile__`, `while`;
     26int ``_Alignas``, ``_Alignof``, ``__alignof``, ``__alignof__``, ``asm``, ``__asm``, ``__asm__``, ``_At``, ``_Atomic``, ``__attribute``,
     27        ``__attribute__``, ``auto``, ``_Bool``, ``break``, ``case``, ``catch``, ``catchResume``, ``char``, ``choose``, ``_Complex``, ``__complex``,
     28        ``__complex__``, ``const``, ``__const``, ``__const__``, ``continue``, ``default``, ``disable``, ``do``, ``double``, ``dtype``, ``else``,
     29        ``enable``, ``enum``, ``__extension__``, ``extern``, ``fallthru``, ``finally``, ``float``, ``__float128``, ``for``, ``forall``, ``fortran``,
     30        ``ftype``, ``_Generic``, ``goto``, ``if``, ``_Imaginary``, ``__imag``, ``__imag__``, ``inline``, ``__inline``, ``__inline__``, ``int``,
     31        ``__int128``, ``__label__``, ``long``, ``lvalue``, ``_Noreturn``, ``__builtin_offsetof``, ``otype``, ``register``, ``restrict``,
     32        ``__restrict``, ``__restrict__``, ``return``, ``short``, ``signed``, ``__signed``, ``__signed__``, ``sizeof``, ``static``,
     33        ``_Static_assert``, ``struct``, ``switch``, ``_Thread_local``, ``throw``, ``throwResume``, ``trait``, ``try``, ``typedef``,
     34        ``typeof``, ``__typeof``, ``__typeof__``, ``union``, ``unsigned``, ``__builtin_va_list``, ``void``, ``volatile``, ``__volatile``,
     35        ``__volatile__``, ``while``;
    3636
    3737int main() {
    38         int `if` = 0;
    39         `catch` = 1;
    40         st.`otype` = 2;
    41         st.`struct` = 3;
    42         `throw` = 4;
    43         sout | `catch` + st.`otype` + st.`struct` + `throw`;
     38        int ``if`` = 0;
     39        ``catch`` = 1;
     40        st.``otype`` = 2;
     41        st.``struct`` = 3;
     42        ``throw`` = 4;
     43        sout | ``catch`` + st.``otype`` + st.``struct`` + ``throw``;
    4444}
    4545
Note: See TracChangeset for help on using the changeset viewer.