mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: $if blocks for headers
This commit is contained in:
parent
f798a0937a
commit
3dc3b11435
@ -4,8 +4,7 @@ import os
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
$if solaris
|
||||
{
|
||||
$if solaris {
|
||||
#include <unistd.h> // ioctl
|
||||
#include <sys/termios.h> // TIOCGWINSZ
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ fn (g mut Gen) expr(node ast.Expr) {
|
||||
}
|
||||
}
|
||||
ast.Assoc {
|
||||
g.write('/* assoc */')
|
||||
g.assoc(it)
|
||||
}
|
||||
ast.BoolLiteral {
|
||||
g.write(it.val.str())
|
||||
@ -1348,6 +1348,9 @@ fn (g mut Gen) const_decl(node ast.ConstDecl) {
|
||||
}
|
||||
}
|
||||
|
||||
// { user | name: 'new name' }
|
||||
fn (g mut Gen) assoc(node ast.Assoc) {}
|
||||
|
||||
fn (g mut Gen) call_args(args []ast.CallArg) {
|
||||
for i, arg in args {
|
||||
if table.type_is_variadic(arg.expected_type) {
|
||||
|
@ -370,6 +370,9 @@ pub fn (p mut Parser) stmt() ast.Stmt {
|
||||
stmts: stmts
|
||||
}
|
||||
}
|
||||
.hash {
|
||||
return p.hash()
|
||||
}
|
||||
.key_defer {
|
||||
p.next()
|
||||
stmts := p.parse_block()
|
||||
|
Loading…
Reference in New Issue
Block a user