# Any kind of string form with augmentations from prefixes or suffixes
class AugmentedStringFormExpr
super AAugmentedLiteral
redef var delimiter_start = '"'
redef var delimiter_end = '"'
# Is `self` a regular String object ?
fun is_string: Bool do return prefix == "" or prefix == "raw"
# Is `self` a Regular Expression ?
fun is_re: Bool do return prefix == "re"
# Is `self` a Byte String ?
fun is_bytestring: Bool do return prefix == "b"
redef fun is_valid_augmentation do
if is_string and suffix == "" then return true
if is_bytestring and suffix == "" then return true
if is_re then
var suf = suffix
for i in suf.chars do
if i == 'i' then continue
if i == 'm' then continue
if i == 'b' then continue
return false
end
return true
end
if prefix != "" or suffix != "" then return false
return true
end
end
src/literal.nit:159,1--191,3