mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: allow types that start with &&; cgen: allow ++/-- exprs for now
This commit is contained in:
@@ -186,7 +186,7 @@ fn (p mut Parser) fn_args() ([]table.Arg,bool) {
|
||||
mut args := []table.Arg
|
||||
mut is_variadic := false
|
||||
// `int, int, string` (no names, just types)
|
||||
types_only := p.tok.kind in [.amp] || (p.peek_tok.kind == .comma && p.table.known_type(p.tok.lit)) || p.peek_tok.kind == .rpar
|
||||
types_only := p.tok.kind in [.amp, .and] || (p.peek_tok.kind == .comma && p.table.known_type(p.tok.lit)) || p.peek_tok.kind == .rpar
|
||||
if types_only {
|
||||
// p.warn('types only')
|
||||
mut arg_no := 1
|
||||
|
@@ -896,7 +896,7 @@ pub fn (p mut Parser) expr(precedence int) ast.Expr {
|
||||
pos: p.tok.position()
|
||||
}
|
||||
p.next()
|
||||
return node
|
||||
// return node // TODO bring back, only allow ++/-- in exprs in translated code
|
||||
}
|
||||
else {
|
||||
return node
|
||||
|
@@ -1,3 +1,5 @@
|
||||
fn C.strlen() int
|
||||
|
||||
fn test_cstring() {
|
||||
w := c'world'
|
||||
hlen := C.strlen(c'hello')
|
||||
|
Reference in New Issue
Block a user