Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 bad;
     17 // semicolon!
     18 package tests.errors.syntax@1.0
     19 
     20 // bad; // can't recover from this yet
     21 import IBad;
     22 import IGood
     23 import 1233;
     24 // bad; // can't recover from this yet
     25 import IBad;
     26 import IGood2;
     27 import IBad;
     28 
     29 enum ForgetASemicolon {
     30 }
     31 
     32 bad;
     33 interface IEx1 {
     34 
     35     bad;
     36     enum SomeBaseEnum : uint8_t {
     37         // 3 bad 33, // can't recover from this yet
     38         bar = 66,
     39         // foo = NonExistentEnum, // can't recover from this yet
     40         baz = 77,
     41         // good-day obj, // can't recover from this yet
     42         boo = 88,
     43         errorval = 3 + (4 + ) + 5,
     44         good = errorval + 1,
     45         // eat struct // can't recover from this yet
     46     };
     47 
     48     enum SomeEnum : SomeBaseEnum {
     49     };
     50 
     51     struct Fumble {
     52         bad;
     53         SomeBaseEnum myEnum;
     54         8Messy;
     55         SomeEnum myEnum2;
     56         int32_t missMySemicolon
     57         int32_t good;
     58         bad;
     59     };
     60 
     61     bad;
     62     typedef Fumble Gumble;
     63 
     64     struct Goober {
     65         bad;
     66     };
     67 
     68     typedef float[3] ThreeFloats;
     69     typedef float[5] FiveFloats;
     70 
     71     typedef bad;
     72 
     73     typedef ref<IEx1> NotAllowed;
     74     typedef mask<ForgetASemicolon> Ok;
     75     typedef vec<IEx1> OkToo;
     76     typedef mask<IEx1> NotAllowedToo;
     77 
     78     struct Quux {
     79         string first;
     80         typedef bad;
     81         string last;
     82     };
     83 
     84     // union bad; // can't recover from this yet
     85     // enum bad;  // can't recover from this yet
     86 
     87     struct MultiDimensional {
     88         bad;
     89     };
     90 
     91     doTheSame(
     92         // bad, // can't recover from this yet
     93         );
     94     doThat(bad bad);
     95     shouldPass();
     96     missASemicolon()
     97     whatAboutThis()
     98     struct NotGoodWithoutSemicolon {
     99 
    100     }
    101     struct Good {};
    102 
    103     duplicatedArg(int32_t bar, MultiDimensional bar);
    104     duplicatedResult() generates (uint32_t baz, bool baz);
    105 
    106 } // another semicolon
    107