mirror of
https://github.com/vlang/v.git
synced 2025-09-08 06:41:58 -04:00
checker: allow \uxxxxx in raw strings (#21724)
This commit is contained in:
parent
e1d23429c7
commit
a536c03365
@ -3009,6 +3009,10 @@ pub fn (mut c Checker) expr(mut node ast.Expr) ast.Type {
|
||||
// string literal starts with "c": `C.printf(c'hello')`
|
||||
return ast.u8_type.set_nr_muls(1)
|
||||
}
|
||||
if node.is_raw {
|
||||
// raw strings don't need any sort of checking related to unicode
|
||||
return ast.string_type
|
||||
}
|
||||
return c.string_lit(mut node)
|
||||
}
|
||||
ast.StringInterLiteral {
|
||||
|
@ -17,6 +17,11 @@ fn test_raw_string_not_escaped_by_transformer() {
|
||||
assert 'a\nb' + r'a\nb' == 'a\nba\\nb'
|
||||
}
|
||||
|
||||
fn test_raw_string_backslash_u() {
|
||||
assert r'\u0000004B' == r'\u0000004B'
|
||||
println(r'\u0000004B')
|
||||
}
|
||||
|
||||
// this test will cause test failure (see #12604)
|
||||
// fn test_many_pluses() {
|
||||
// a := r'x\n'
|
||||
|
Loading…
x
Reference in New Issue
Block a user