1 // Copyright 2018 The Fuchsia 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// This is the library 6 library foo; 7 8using something.or.another as thing; 9 10struct arrays { 11array<handle>:1 handle_0; 12 }; 13// My oh my 14struct DirectoryObject { 15 int32 y; 16}; 17 18const uint64 w = 9021; 19 20// Random comment 21 22 23 const uint32 x= 9021; 24const uint32 y =9021; 25 26// My wonderful constant 27const uint32 z=9021; 28 29// Comment requiring space 30 31 32enum Enum2:uint32{ 33 enum_0 = 0; // More comments 34}; 35 36union MyUnion { // super annoying! 37 string? s; 38}; 39 40/// Doc comments 41 /// of multiple 42/// lines 43struct Foo { 44 request<Iface>? nullable_request; 45vector<handle<channel > > monoid; 46 vector<handle<channel>>drahvin; 47}; 48 49// This { should } not be indented 50// My interface is so wonderful. 51 // It is the most wonderful interface of them all. 52 [Discoverable] 53interface Iface 54{ 55 Foo() 56 -> (int i); 57 58 [Awesome] 59Analyze(handle<process> process, handle<thread> thread) 60-> (); 61 62 // Figure it out. 63 -> Bar ( int32 i,int32 k); 64 Baz(int32 j, string k ) -> ( int32 y ); 65 Nimon(int32 j, string k ) 66 -> ( int32 y ); 67 68 Cat(string? s) -> (bool b); Karfel( 69 int32 x) -> (int y); 70 71 Gavrok // ( heh heh -> 72 ( // ( An annoying comment. 73 int a, int b) -> (); 74 75 ->Goo(int32 p, string : 32 s); 76 Baz(int32 j, string:40 k 77 ) ->(int32 y ); 78 SomeMethodWithAResponse() -> (); 79 80 // A comment that isn't so annoying 81 MethodResponse(int a, int b, string:40 c, 82int d, int e) -> (int f, int g, 83int h); 84 85 MethodResponse2() 86 -> (); 87 88 MethodResponse3(int64 a) -> 89 (); 90 91 /// Doc Comment and 92 [Attribute] 93 -> End(); 94 95 /// Multiple 96 /// Doc Comments and 97 [Attribute] 98 -> End(); 99 100 -> End(); 101 -> End(); 102 103 } 104 105 106; 107 108// Comments at EOF 109 110