Skip to content

Commit

Permalink
Merge branch 'khieta-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rtik committed Jul 11, 2022
2 parents 45354c9 + 28a2542 commit 5d7ef3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/openQASM.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ let parse_with_error lexbuf =

(* core parsing routine *)
let get_ast f =
let lexbuf = Lexing.from_channel (open_in f) in
parse_with_error lexbuf
let ch = open_in_bin f in
Fun.protect ~finally: (fun () -> close_in ch) begin fun () ->
let lexbuf = Lexing.from_channel ch in
parse_with_error lexbuf
end

module AST = AST

0 comments on commit 5d7ef3a

Please sign in to comment.