mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
C string literals (c'str'); bare builtin module; bare println()
This commit is contained in:
@@ -2125,7 +2125,8 @@ fn format_str(_str string) string {
|
||||
|
||||
fn (p mut Parser) string_expr() {
|
||||
is_raw := p.tok == .name && p.lit == 'r'
|
||||
if is_raw {
|
||||
is_cstr := p.tok == .name && p.lit == 'c'
|
||||
if is_raw || is_cstr {
|
||||
p.next()
|
||||
}
|
||||
str := p.lit
|
||||
@@ -2137,7 +2138,7 @@ fn (p mut Parser) string_expr() {
|
||||
Calling a C function sometimes requires a call to a string method
|
||||
C.fun('ssss'.to_wide()) => fun(string_to_wide(tos3("ssss")))
|
||||
*/
|
||||
if (p.calling_c && p.peek() != .dot) || p.pref.is_bare || (p.pref.translated && p.mod == 'main') {
|
||||
if (p.calling_c && p.peek() != .dot) || is_cstr || (p.pref.translated && p.mod == 'main') {
|
||||
p.gen('"$f"')
|
||||
}
|
||||
else if p.is_sql {
|
||||
|
||||
Reference in New Issue
Block a user