mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Adds basic support for class functions and methods. (#1057)
* adding methods to the ast * pre commit stuff? * implementation of class functions * implemented methods * some cleanup * more cleanup * add newlines in test programs * pre-commit fixups * added include of return_term.h * a test of a method calling another method * replacing Member with Declaration * removing the member.h etc files * clarify a type annotation * update uses of FunctionDeclaration * remove ReturnTarget, no longer needed * more cleanup * more cleanup * yet more cleanup, playing with pre-commit * did a pre-commit run --all-files * fixed const issue * remove comment * checking dependencies in BUILD files and headers * pre-commit working now * refactor NominalClassType to just hold a pointer to the class declaration * remove Member from rtti * responding to Geoffreys review * change field_types to a non-member function
This commit is contained in:
@@ -77,8 +77,8 @@ cc_library(
|
||||
],
|
||||
deps = [
|
||||
":ast_node",
|
||||
":member",
|
||||
":pattern",
|
||||
":return_term",
|
||||
":source_location",
|
||||
":statement",
|
||||
":static_scope",
|
||||
@@ -89,6 +89,18 @@ cc_library(
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "return_term",
|
||||
hdrs = ["return_term.h"],
|
||||
deps = [
|
||||
":source_location",
|
||||
"//common:check",
|
||||
"//common:ostream",
|
||||
"//executable_semantics/common:nonnull",
|
||||
"@llvm-project//llvm:Support",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "expression",
|
||||
srcs = ["expression.cpp"],
|
||||
@@ -119,20 +131,6 @@ cc_test(
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "member",
|
||||
srcs = ["member.cpp"],
|
||||
hdrs = ["member.h"],
|
||||
deps = [
|
||||
":expression",
|
||||
":pattern",
|
||||
":source_location",
|
||||
"//common:ostream",
|
||||
"//executable_semantics/common:arena",
|
||||
"@llvm-project//llvm:Support",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "library_name",
|
||||
hdrs = ["library_name.h"],
|
||||
@@ -186,7 +184,6 @@ cc_library(
|
||||
":source_location",
|
||||
":value_category",
|
||||
"//common:check",
|
||||
"//executable_semantics/common:arena",
|
||||
"//executable_semantics/common:error",
|
||||
"//executable_semantics/common:nonnull",
|
||||
],
|
||||
@@ -209,6 +206,7 @@ cc_library(
|
||||
":ast_node",
|
||||
":expression",
|
||||
":pattern",
|
||||
":return_term",
|
||||
":source_location",
|
||||
":static_scope",
|
||||
":value_category",
|
||||
|
||||
Reference in New Issue
Block a user