Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
volsa committed Jun 4, 2024
1 parent b3b59d7 commit ea3e606
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 360 deletions.
16 changes: 10 additions & 6 deletions compiler/plc_diagnostics/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,16 @@ impl Diagnostic {
.with_error_code("E006")
}

pub fn invalid_parameter_count(expected: usize, received: usize, location: SourceLocation) -> Diagnostic {
Diagnostic::new(
format!(
"Invalid parameter count. Received {received} parameters while {expected} parameters were expected.",
)).with_error_code("E032")
.with_location(location)
pub fn invalid_argument_count(
expected: usize,
actual: usize,
location: impl Into<SourceLocation>,
) -> Diagnostic {
Diagnostic::new(format!(
"this POU takes {expected} argument(s) but {actual} argument(s) were supplied",
))
.with_error_code("E032")
.with_location(location.into())
}

pub fn unknown_type(type_name: &str, location: SourceLocation) -> Diagnostic {
Expand Down
Loading

0 comments on commit ea3e606

Please sign in to comment.