Parse a function body; the caller will parse the surrounding "{}" { [type arg,] -> expr } { expr } // The no-argument function
()
| 1364 | * </pre> |
| 1365 | */ |
| 1366 | private Node func() { |
| 1367 | Ary<Type> ts = new Ary<>(Type.class); |
| 1368 | Ary<String> ids = new Ary<>(String.class); |
| 1369 | _lexer.skipWhiteSpace(); |
| 1370 | Lexer loc = loc(); // First argument location |
| 1371 | while( true ) { |
| 1372 | Type t = type(); // Arg type |
| 1373 | if( t==null ) break; |
| 1374 | String id = requireId(); |
| 1375 | ts .push(t ); // Push type/arg pairs |
| 1376 | ids.push(id); |
| 1377 | match(","); |
| 1378 | } |
| 1379 | require("->"); |
| 1380 | // Make a concrete function type, with a fidx |
| 1381 | TypeFunPtr tfp = _code.makeFun(TypeTuple.make(ts.asAry()),Type.BOTTOM); |
| 1382 | ReturnNode ret = parseFunctionBody(tfp,loc,ids.asAry()); |
| 1383 | return con(ret._fun.sig()); |
| 1384 | } |
| 1385 | |
| 1386 | /** |
| 1387 | * Parse function call arguments; caller will parse the surrounding "()" |
no test coverage detected