parser: allow types that start with &&; cgen: allow ++/-- exprs for now
parent
56a9196be8
commit
48832200bb
|
@ -186,7 +186,7 @@ fn (p mut Parser) fn_args() ([]table.Arg,bool) {
|
||||||
mut args := []table.Arg
|
mut args := []table.Arg
|
||||||
mut is_variadic := false
|
mut is_variadic := false
|
||||||
// `int, int, string` (no names, just types)
|
// `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 {
|
if types_only {
|
||||||
// p.warn('types only')
|
// p.warn('types only')
|
||||||
mut arg_no := 1
|
mut arg_no := 1
|
||||||
|
|
|
@ -896,7 +896,7 @@ pub fn (p mut Parser) expr(precedence int) ast.Expr {
|
||||||
pos: p.tok.position()
|
pos: p.tok.position()
|
||||||
}
|
}
|
||||||
p.next()
|
p.next()
|
||||||
return node
|
// return node // TODO bring back, only allow ++/-- in exprs in translated code
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return node
|
return node
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
fn C.strlen() int
|
||||||
|
|
||||||
fn test_cstring() {
|
fn test_cstring() {
|
||||||
w := c'world'
|
w := c'world'
|
||||||
hlen := C.strlen(c'hello')
|
hlen := C.strlen(c'hello')
|
||||||
|
|
Loading…
Reference in New Issue