Skip to content

Commit 923ca86

Browse files
committed
New environment
use qualified name new env lookup tests wip - compiles but lots is broken duplcate dict elem is now (k, v) removed named row wip all pass
1 parent b7f64f8 commit 923ca86

31 files changed

Lines changed: 1323 additions & 540 deletions

Sources/Compiler/Diagnostic.swift

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,46 @@ extension Diagnostic {
8080
)
8181
}
8282

83-
static func tableDoesNotExist(_ identifier: IdentifierSyntax) -> Diagnostic {
83+
static func tableAlreadyExists(_ identifier: IdentifierSyntax) -> Diagnostic {
8484
Diagnostic(
85-
"Table '\(identifier)' does not exist",
85+
"Table '\(identifier)' already exists",
8686
at: identifier.location
8787
)
8888
}
8989

90-
static func tableAlreadyExists(_ identifier: IdentifierSyntax) -> Diagnostic {
90+
static func tableDoesNotExist(_ table: Substring, at location: SourceLocation) -> Diagnostic {
9191
Diagnostic(
92-
"Table '\(identifier)' already exists",
93-
at: identifier.location
92+
"Table '\(table)' does not exist",
93+
at: location
94+
)
95+
}
96+
97+
static func tableDoesNotExist(_ identifier: IdentifierSyntax) -> Diagnostic {
98+
.tableDoesNotExist(identifier.value, at: identifier.location)
99+
}
100+
101+
static func columnDoesNotExist(_ column: Substring, at location: SourceLocation) -> Diagnostic {
102+
Diagnostic(
103+
"Column '\(column)' does not exist",
104+
at: location
94105
)
95106
}
96107

97108
static func columnDoesNotExist(_ identifier: IdentifierSyntax) -> Diagnostic {
109+
.columnDoesNotExist(identifier.value, at: identifier.location)
110+
}
111+
112+
static func schemaDoesNotExist(_ schema: Substring, at location: SourceLocation) -> Diagnostic {
98113
Diagnostic(
99-
"Column '\(identifier)' does not exist",
100-
at: identifier.location
114+
"Schema '\(schema)' does not exist",
115+
at: location
101116
)
102117
}
103118

119+
static func schemaDoesNotExist(_ identifier: IdentifierSyntax) -> Diagnostic {
120+
.schemaDoesNotExist(identifier.value, at: identifier.location)
121+
}
122+
104123
static func unexpectedToken(
105124
of kind: Token.Kind,
106125
expected: Token.Kind? = nil,

0 commit comments

Comments
 (0)