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

cgen: generate #ifdefs

This commit is contained in:
Alexander Medvednikov
2020-03-22 13:55:39 +01:00
parent 8d8907b61e
commit c2ce06eba7
4 changed files with 70 additions and 6 deletions

View File

@@ -11,13 +11,14 @@ pub fn (p mut Parser) comp_if() ast.CompIf {
if p.tok.kind == .not {
p.next()
}
p.check_name()
val := p.check_name()
if p.tok.kind == .question {
p.next()
}
mut node := ast.CompIf{
stmts: p.parse_block()
pos: pos
val: val
}
if p.tok.kind == .dollar && p.peek_tok.kind == .key_else {
p.next()