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

foo()? syntax

This commit is contained in:
Alexander Medvednikov
2019-11-13 21:47:05 +03:00
parent 72249ce889
commit b1fa0d25f0
5 changed files with 34 additions and 10 deletions

View File

@ -103,7 +103,9 @@ fn (p mut Parser) comp_time() {
else_returns := p.returns
p.returns = if_returns && else_returns
//p.gen('/* returns $p.returns */')
}
} else if p.tok == .key_else {
p.error('use `$' + 'else` instead of `else` in comptime if statements')
}
}
else if p.tok == .key_for {
p.next()
@ -234,7 +236,7 @@ fn (p mut Parser) chash() {
p.cgen.includes << '#$hash'
}
}
// Don't parse a non-JS V file (`#-js` flag)
//// Don't parse a non-JS V file (`#-js` flag)
else if hash == '-js' {
$if js {
for p.tok != .eof {