Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions program_structure/src/abstract_syntax_tree/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ impl AST {
let mut reports = Vec::new();
for p in pragmas {
match p {
// TODO: don't panic
// Handle version pragma without panicking
Pragma::Version(location, file_id, ver) => match compiler_version {
Some(_) => reports.push(produce_report(
ReportCode::MultiplePragma,location.start..location.end, file_id)),
ReportCode::MultiplePragma, location.location.clone(), file_id)),
None => compiler_version = Some(ver),
},
Pragma::CustomGates(location, file_id ) => match custom_gates {
Some(_) => reports.push(produce_report(
ReportCode::MultiplePragma, location.start..location.end, file_id)),
ReportCode::MultiplePragma, location.location.clone(), file_id)),
None => custom_gates = Some(true),
},
Pragma::Unrecognized => {}, //This error is previously handled, and the
Expand Down Expand Up @@ -655,4 +655,4 @@ pub fn tuple_general_error(meta : Meta, msg : String) -> Report {
"This is the tuple whose use is not allowed".to_string(),
);
report
}
}