1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

expression: add a check for raw strings

This commit is contained in:
Swastik Baranwal 2019-11-17 00:45:22 +05:30 committed by Alexander Medvednikov
parent 8d1eb759f7
commit 5d5268a53d
2 changed files with 2 additions and 3 deletions

View File

@ -1,2 +1 @@
println('Hello, World!')
println('Hello, World!')

View File

@ -161,7 +161,7 @@ fn (p mut Parser) name_expr() string {
mut name := p.lit
// Raw string (`s := r'hello \n ')
if (name == 'r' || name == 'c') && p.peek() == .str {
if (name == 'r' || name == 'c') && p.peek() == .str && p.prev_tok != .dollar {
p.string_expr()
return 'string'
}