Crate oq3_source_file
source ·Expand description
Management of source files for OpenQASM 3 parsing and semantic analysis. The main struct here
is SourceFile which contains the path to a source file and the AST produced by the parser. It
also contains a Vec<SourceFile> representing source files that are included via
include. Nested includes are handled naturally this way.
report_error formats error messages using the external crate ariadne.
Structs§
- Structure for managing parsing QASM from a string with no associated source file.
fake_file_pathcontains something like “no file” and is present in order to make it easier to avoid duplicating code supporing QASM read from source files.
Traits§
Functions§
- Print compiler errors. Diagnostics include text take from
source. The fileinfo_file_pathis only used for printing error messages. In particular, it does not need to correspond to an existing file. In caseinfo_file_pathis indeed the source file, thensourceis read before calling this function. - Read source from
file_pathand parse to the syntactic AST. Parse and store included files recursively. - Read source from
file_pathand parse to the syntactic AST. Parse and store included files recursively.