mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
format
This commit is contained in:
parent
c68daa2d93
commit
7e88b8fb12
22
src/check.rs
22
src/check.rs
|
@ -33,13 +33,11 @@ pub fn check<'a>(data: &'a ProgramData, ast: &ast::Program) -> Vec<Check<'a>> {
|
|||
line_start: 1,
|
||||
fold: true,
|
||||
origin: Some(&data.filename),
|
||||
annotations: vec![
|
||||
SourceAnnotation {
|
||||
annotations: vec![SourceAnnotation {
|
||||
label: "unexpected statement",
|
||||
annotation_type: AnnotationType::Error,
|
||||
range: statement.span.into(),
|
||||
},
|
||||
],
|
||||
}],
|
||||
}],
|
||||
opt: FormatOptions {
|
||||
color: true,
|
||||
|
@ -64,13 +62,11 @@ pub fn check<'a>(data: &'a ProgramData, ast: &ast::Program) -> Vec<Check<'a>> {
|
|||
line_start: 1,
|
||||
fold: true,
|
||||
origin: Some(&data.filename),
|
||||
annotations: vec![
|
||||
SourceAnnotation {
|
||||
annotations: vec![SourceAnnotation {
|
||||
label: "unexpected statement",
|
||||
annotation_type: AnnotationType::Error,
|
||||
range: statement.span.into(),
|
||||
},
|
||||
],
|
||||
}],
|
||||
}],
|
||||
opt: FormatOptions {
|
||||
color: true,
|
||||
|
@ -80,7 +76,7 @@ pub fn check<'a>(data: &'a ProgramData, ast: &ast::Program) -> Vec<Check<'a>> {
|
|||
|
||||
let dl = DisplayList::from(snippet);
|
||||
errors.push(Check::Error(dl));
|
||||
},
|
||||
}
|
||||
Statement::Return(_x) => {
|
||||
// can't have a top level assignment yet.
|
||||
let snippet = Snippet {
|
||||
|
@ -95,13 +91,11 @@ pub fn check<'a>(data: &'a ProgramData, ast: &ast::Program) -> Vec<Check<'a>> {
|
|||
line_start: 1,
|
||||
fold: true,
|
||||
origin: Some(&data.filename),
|
||||
annotations: vec![
|
||||
SourceAnnotation {
|
||||
annotations: vec![SourceAnnotation {
|
||||
label: "unexpected return",
|
||||
annotation_type: AnnotationType::Error,
|
||||
range: statement.span.into(),
|
||||
},
|
||||
],
|
||||
}],
|
||||
}],
|
||||
opt: FormatOptions {
|
||||
color: true,
|
||||
|
@ -111,7 +105,7 @@ pub fn check<'a>(data: &'a ProgramData, ast: &ast::Program) -> Vec<Check<'a>> {
|
|||
|
||||
let dl = DisplayList::from(snippet);
|
||||
errors.push(Check::Error(dl));
|
||||
},
|
||||
}
|
||||
Statement::Function(_function) => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue