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

another map bug fix + fix some warnings

This commit is contained in:
Alexander Medvednikov
2019-07-31 10:46:00 +02:00
parent fa24a0cec5
commit ddb4f45b02
4 changed files with 9 additions and 9 deletions

View File

@ -193,6 +193,7 @@ fn (v mut V) compile() {
#include <signal.h>
#include <stdarg.h> // for va_list
#include <inttypes.h> // int64_t etc
#include <string.h> // memcpy
#define STRUCT_DEFAULT_VALUE {}
#define EMPTY_STRUCT_DECLARATION

View File

@ -2309,19 +2309,17 @@ fn format_str(str string) string {
}
fn (p mut Parser) string_expr() {
// println('.str EXPR')
str := p.lit
// No ${}, just return a simple string
if p.peek() != .dollar {
p.fgen('\'$str\'')
// println('before format: "$str"')
f := format_str(str)
// println('after format: "$str"')
// `C.puts('hi')` => `puts("hi");`
if p.calling_c || (p.pref.translated && p.mod == 'main') {
p.gen('"$f"')
}
else {
p.gen('tos2("$f")')
p.gen('tos2((byte*)"$f")')
}
p.next()
return
@ -2387,8 +2385,8 @@ fn (p mut Parser) string_expr() {
}
}
if complex_inter {
p.fgen('}')
}
p.fgen('}')
}
p.fgen('\'')
// println("hello %d", num) optimization.
if p.cgen.nogen {