Home | History | Annotate | Download | only in test_parser
      1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
      2    Use of this source code is governed by a BSD-style license that can be
      3   found in the LICENSE file. */
      4 
      5 /* Test Callback productions
      6 
      7 Run with --test to generate an AST and verify that all comments accurately
      8 reflect the state of the Nodes.
      9 
     10 BUILD Type(Name)
     11 This comment signals that a node of type <Type> is created with the
     12 name <Name>.
     13 
     14 ERROR Error String
     15 This comment signals that a error of <Error String> is generated.  The error
     16 is not assigned to a node, but are expected in order.
     17 
     18 PROP Key=Value
     19 This comment signals that a property has been set on the Node such that
     20 <Key> = <Value>.
     21 
     22 TREE
     23 Type(Name)
     24   Type(Name)
     25   Type(Name)
     26     Type(Name)
     27     ...
     28 This comment signals that a tree of nodes matching the BUILD comment
     29 symatics should exist.  This is an exact match.
     30 */
     31 
     32 
     33 /* TREE
     34  *Callback(VoidFunc)
     35  *  Type()
     36  *    PrimitiveType(void)
     37  *  Arguments()
     38  */
     39 callback VoidFunc = void();
     40 
     41 /* TREE
     42  *Callback(VoidFuncLongErr)
     43  *  Type()
     44  *    PrimitiveType(void)
     45  *  Arguments()
     46  *    Error(Unexpected ).)
     47  */
     48 callback VoidFuncLongErr = void ( long );
     49 
     50 /* TREE
     51  *Callback(VoidFuncLong)
     52  *  Type()
     53  *    PrimitiveType(void)
     54  *  Arguments()
     55  *    Argument(L1)
     56  *      Type()
     57  *        PrimitiveType(long)
     58  */
     59 callback VoidFuncLong = void ( long L1 );
     60 
     61 /* TREE
     62  *Callback(VoidFuncLongArray)
     63  *  Type()
     64  *    PrimitiveType(void)
     65  *  Arguments()
     66  *    Argument(L1)
     67  *      Type()
     68  *        PrimitiveType(long)
     69  *        Array()
     70  */
     71 callback VoidFuncLongArray = void ( long[] L1 );
     72 
     73 /* TREE
     74  *Callback(VoidFuncLongArray5)
     75  *  Type()
     76  *    PrimitiveType(void)
     77  *  Arguments()
     78  *    Argument(L1)
     79  *      Type()
     80  *        PrimitiveType(long)
     81  *        Array(5)
     82  */
     83 callback VoidFuncLongArray5 = void ( long[5] L1 );
     84 
     85 
     86 /* TREE
     87  *Callback(VoidFuncLongArray54)
     88  *  Type()
     89  *    PrimitiveType(void)
     90  *  Arguments()
     91  *    Argument(L1)
     92  *      Type()
     93  *        PrimitiveType(long)
     94  *        Array(5)
     95  *    Argument(L2)
     96  *      Type()
     97  *        PrimitiveType(long long)
     98  *        Array(4)
     99  */
    100 callback VoidFuncLongArray54 = void ( long[5] L1, long long [4] L2 );
    101 
    102 
    103 /* TREE
    104  *Callback(VoidFuncLongIdent)
    105  *  Type()
    106  *    PrimitiveType(void)
    107  *  Arguments()
    108  *    Argument(L1)
    109  *      Type()
    110  *        PrimitiveType(long)
    111  *        Array(5)
    112  *    Argument(L2)
    113  *      Type()
    114  *        Typeref(VoidFuncLongArray)
    115  */
    116 callback VoidFuncLongIdent = void ( long[5] L1, VoidFuncLongArray L2 );
    117