Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
5614f90e
Commit
5614f90e
authored
Feb 15, 2021
by
Mccaskey, Alex
Browse files
fix bug where line was empty in staq compiler
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
c46fc6dd
Pipeline
#136059
passed with stage
in 20 minutes and 35 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/staq/compiler/staq_compiler.cpp
View file @
5614f90e
...
...
@@ -275,9 +275,10 @@ std::shared_ptr<IR> StaqCompiler::compile(const std::string &src,
std
::
string
preamble
=
"include
\"
qelib1.inc
\"
;"
;
auto
preamble_start
=
src
.
find
(
preamble
);
auto
preamble_start
=
_
src
.
find
(
preamble
);
// Add any required missing pre-defines that we
// Add any required missing pre-defines that we
// know the impl for.
std
::
vector
<
std
::
string
>
added
;
std
::
string
extra_insts
=
"
\n
"
;
...
...
@@ -288,7 +289,8 @@ std::shared_ptr<IR> StaqCompiler::compile(const std::string &src,
line
.
find
(
"include"
)
==
std
::
string
::
npos
&&
line
.
find
(
"measure"
)
==
std
::
string
::
npos
&&
line
.
find
(
"qreg"
)
==
std
::
string
::
npos
&&
line
.
find
(
"creg"
)
==
std
::
string
::
npos
)
{
line
.
find
(
"creg"
)
==
std
::
string
::
npos
&&
!
line
.
empty
())
{
auto
inst_name
=
split
(
line
,
' '
)[
0
];
if
(
inst_name
.
find
(
"("
)
!=
std
::
string
::
npos
)
{
inst_name
=
inst_name
.
substr
(
0
,
inst_name
.
find
(
"("
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment