Python: Add Str class

This makes the AST viewer (which annotates string constant nodes as
`Str`) a bit more consistent.
This commit is contained in:
Taus
2022-07-19 12:25:10 +00:00
committed by GitHub
parent 410167671f
commit bde47836d0

View File

@@ -616,8 +616,11 @@ private string non_byte_prefix() {
not result.charAt(_) in ["b", "B"]
}
/** A string constant. This is a placeholder class -- use `StrConst` instead. */
class Str extends Str_ { }
/** A string constant. */
class StrConst extends Str_, ImmutableLiteral {
class StrConst extends Str, ImmutableLiteral {
/* syntax: "hello" */
predicate isUnicode() {
this.getPrefix() = unicode_prefix()