Parse a function body; the caller will parse the surrounding "{}" { [type arg,] -> expr } { expr } // The no-argument function
()
| 1438 | * </pre> |
| 1439 | */ |
| 1440 | private Node func() { |
| 1441 | Ary<Type> ts = new Ary<>(Type.class); |
| 1442 | Ary<String> ids = new Ary<>(String.class); |
| 1443 | _lexer.skipWhiteSpace(); |
| 1444 | Lexer loc = loc(); // First argument location |
| 1445 | while( true ) { |
| 1446 | Type t = type(); // Arg type |
| 1447 | if( t==null ) break; |
| 1448 | String id = requireId(); |
| 1449 | ts .push(t ); // Push type/arg pairs |
| 1450 | ids.push(id); |
| 1451 | match(","); |
| 1452 | } |
| 1453 | require("->"); |
| 1454 | // Make a concrete function type, with a fidx |
| 1455 | TypeFunPtr tfp = _code.makeFun(TypeTuple.make(ts.asAry()),Type.BOTTOM); |
| 1456 | ReturnNode ret = parseFunctionBody(tfp,loc,ids.asAry()); |
| 1457 | return con(ret._fun.sig()); |
| 1458 | } |
| 1459 | |
| 1460 | /** |
| 1461 | * Parse function call arguments; caller will parse the surrounding "()" |
no test coverage detected