You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty sure that everywhere a string literal is encountered in the code above it is a string literal that is not part of the language (ie bit string literals, pragmas, etc. have been filtered out). So we could record a parse error here. Since we currently do not proceed with semantic analysis if there are parse errors, the panic mentioned above would not occur. But we'd still want to do something reasonable in place of the todo!.
I should also note that you can get a string literal at the level of the AST (really CST) although this should not be part of the language:
OQ3 supports neither a string type nor string literals. (It does support bit string literals, eg
"1001"
)Currently a string literal will cause a panic in
syntax_to_semantics.rs
herehere
openqasm3_parser/crates/oq3_semantics/src/syntax_to_semantics.rs
Line 702 in b9e9ae8
The lexer tokenizes string literals (eg
"abc"
) as tokenSTRING
. The parser then constructs the variantSyntaxKind::Literal
openqasm3_parser/crates/oq3_parser/src/grammar/expressions/atom.rs
Lines 11 to 30 in b9e9ae8
I'm pretty sure that everywhere a string literal is encountered in the code above it is a string literal that is not part of the language (ie bit string literals, pragmas, etc. have been filtered out). So we could record a parse error here. Since we currently do not proceed with semantic analysis if there are parse errors, the panic mentioned above would not occur. But we'd still want to do something reasonable in place of the
todo!
.I should also note that you can get a string literal at the level of the AST (really CST) although this should not be part of the language:
openqasm3_parser/crates/oq3_syntax/src/ast/expr_ext.rs
Lines 288 to 297 in b9e9ae8
version/commit
b9e9ae8
The text was updated successfully, but these errors were encountered: