[parser] More support for interfaces: methods and self deduced param. (#2427)

Summary:

Extends the current support for parsing `interface`s. In particular, adds support for parsing functions and `me` params.
This commit is contained in:
Kareem Ergawy
2022-12-16 11:23:02 -08:00
committed by GitHub
parent 63487da665
commit c74e39dbb3
12 changed files with 494 additions and 59 deletions
@@ -0,0 +1,15 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// AUTOUPDATE
// RUN: %{carbon-run-parser}
// CHECK:STDOUT: [
// CHECK:STDOUT: {kind: 'DeclaredName', text: 'foo'},
// CHECK:STDOUT: {kind: 'InterfaceBodyStart', text: '{'},
// CHECK:STDOUT: {kind: 'InterfaceBody', text: '}', subtree_size: 2},
// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: 'interface', subtree_size: 4},
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
// CHECK:STDOUT: ]
interface foo {
}