expression: add a check for raw strings

pull/2791/head
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'
}