diff --git a/vlib/term/term_nix.v b/vlib/term/term_nix.v index fad629f752..b4c3cee361 100644 --- a/vlib/term/term_nix.v +++ b/vlib/term/term_nix.v @@ -4,8 +4,7 @@ import os #include -$if solaris -{ +$if solaris { #include // ioctl #include // TIOCGWINSZ } diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 8fb0634f3f..6f551c2338 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -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) { diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index fd6ce9d9e0..c4555a48c7 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -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()