examples: fix news_fetcher on Windows

pull/1291/head
Alexander Medvednikov 2019-07-24 02:35:25 +02:00
parent fcb1f211e3
commit 7f29928aec
4 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,9 @@
## V 0.1.17
- @ for escaping keywords (e.g. `struct Foo { @type string }`).
- Windows Unicode fixes (V can now work with non-ASCII paths etc on Windows).
## V 0.1.16
*23 Jul 2019*
- V can now be used with Visual Studio!

View File

@ -401,7 +401,7 @@ _thread_so = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&reload_so, 0, 0, 0);
cgen_name := p.table.cgen_name(f)
f.defer_text = ' ${cgen_name}_time += time__ticks() - _PROF_START;'
}
p.statements_no_curly_end()
p.statements_no_rcbr()
// Print counting result after all statements in main
if p.pref.is_prof && f.name == 'main' {
p.genln(p.print_prof_counters())

View File

@ -962,17 +962,17 @@ fn (p &Parser) print_tok() {
// statements() returns the type of the last statement
fn (p mut Parser) statements() string {
p.log('statements()')
typ := p.statements_no_curly_end()
typ := p.statements_no_rcbr()
if !p.inside_if_expr {
p.genln('}')
}
if p.fileis('if_expr') {
println('statements() ret=$typ line=$p.scanner.line_nr')
}
//if p.fileis('if_expr') {
//println('statements() ret=$typ line=$p.scanner.line_nr')
//}
return typ
}
fn (p mut Parser) statements_no_curly_end() string {
fn (p mut Parser) statements_no_rcbr() string {
p.cur_fn.open_scope()
if !p.inside_if_expr {
p.genln('')
@ -2819,7 +2819,7 @@ fn (p mut Parser) comp_time() {
p.genln('#ifdef $ifdef_name')
}
p.check(.lcbr)
p.statements_no_curly_end()
p.statements_no_rcbr()
if ! (p.tok == .dollar && p.peek() == .key_else) {
p.genln('#endif')
}
@ -2859,7 +2859,7 @@ fn (p mut Parser) comp_time() {
p.next()
p.check(.lcbr)
p.genln('#else')
p.statements_no_curly_end()
p.statements_no_rcbr()
p.genln('#endif')
}
else {

View File

@ -7,11 +7,11 @@ module sync
struct Mutex {
}
fn (m Mutex) lock() {
panic('not implemented')
pub fn (m Mutex) lock() {
//panic('not implemented')
}
fn (m Mutex) unlock() {
panic('not implemented')
pub fn (m Mutex) unlock() {
//panic('not implemented')
}