File tree Expand file tree Collapse file tree 4 files changed +4
-192
lines changed
qsc_openqasm_compiler/src Expand file tree Collapse file tree 4 files changed +4
-192
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1717mod ast_builder;
1818pub mod compiler;
1919pub mod display_utils;
20- mod keyword;
2120mod types;
2221
2322#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -16,14 +16,17 @@ pub struct Complex {
1616}
1717
1818impl Complex {
19+ #[ must_use]
1920 pub fn new ( real : f64 , imag : f64 ) -> Self {
2021 Self { real, imag }
2122 }
2223
24+ #[ must_use]
2325 pub fn real ( real : f64 ) -> Self {
2426 Self { real, imag : 0. }
2527 }
2628
29+ #[ must_use]
2730 pub fn imag ( imag : f64 ) -> Self {
2831 Self { real : 0. , imag }
2932 }
@@ -109,6 +112,7 @@ impl Div for Complex {
109112
110113impl Complex {
111114 /// This mimics Q#'s `PowC` implementation.
115+ #[ must_use]
112116 pub fn pow ( self , rhs : Self ) -> Self {
113117 let ( a, b) = ( self . real , self . imag ) ;
114118 let ( c, d) = ( rhs. real , rhs. imag ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ use expect_test::Expect;
55use miette:: Report ;
66
77use crate :: io:: InMemorySourceResolver ;
8- use crate :: io:: SourceResolver ;
98use crate :: semantic:: QasmSemanticParseResult ;
109use crate :: semantic:: parse_source;
1110use std:: sync:: Arc ;
@@ -29,29 +28,6 @@ pub(crate) fn parse<S: Into<Arc<str>>>(
2928 Ok ( res)
3029}
3130
32- pub ( crate ) fn parse_all < P : Into < Arc < str > > > (
33- path : P ,
34- sources : impl IntoIterator < Item = ( Arc < str > , Arc < str > ) > ,
35- ) -> miette:: Result < QasmSemanticParseResult , Vec < Report > > {
36- let path = path. into ( ) ;
37- let mut resolver = InMemorySourceResolver :: from_iter ( sources) ;
38- let source = resolver
39- . resolve ( & path, & path)
40- . map_err ( |e| vec ! [ Report :: new( e) ] ) ?
41- . 1 ;
42- let res = parse_source ( source, path, & mut resolver) ;
43- if res. source . has_errors ( ) {
44- let errors = res
45- . errors ( )
46- . into_iter ( )
47- . map ( |e| Report :: new ( e. clone ( ) ) )
48- . collect ( ) ;
49- Err ( errors)
50- } else {
51- Ok ( res)
52- }
53- }
54-
5531pub fn check_qasm < S : Into < Arc < str > > > ( source : S , expect : & Expect ) {
5632 match parse ( source) {
5733 Ok ( res) => {
You can’t perform that action at this time.
0 commit comments