Skip to content

Commit 3a07453

Browse files
committed
Change error type for redefined functions
s/duplicate/redefined for functions
1 parent bf53c56 commit 3a07453

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl ModuleAST {
194194
// TODO: Use HashSet to store functions in ModuleAST.
195195
for function in &self.functions {
196196
if function.as_ref().borrow().name == other.name {
197-
return Err(QccErrorKind::DuplicateFunction.into());
197+
return Err(QccErrorKind::RedefinedFunction.into());
198198
}
199199
}
200200

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub enum QccErrorKind {
7272
ExpectedIf,
7373
ExpectedOpenCurly,
7474
ExpectedCloseCurly,
75-
DuplicateFunction,
75+
RedefinedFunction,
7676
ExpectedIdentifier,
7777
}
7878

@@ -127,7 +127,7 @@ impl Display for QccErrorKind {
127127
ExpectedIf => "expected 'if'",
128128
ExpectedOpenCurly => "expected '{'",
129129
ExpectedCloseCurly => "expected '}'",
130-
DuplicateFunction => "duplicate function",
130+
RedefinedFunction => "redefined function",
131131
ExpectedIdentifier => "expected a variable name",
132132
}
133133
})(self))

0 commit comments

Comments
 (0)