| 507 | } |
| 508 | function commasep(what, end, sep) { |
| 509 | function proceed(type, value) { |
| 510 | if (sep ? sep.indexOf(type) > -1 : type == ",") { |
| 511 | var lex = cx.state.lexical; |
| 512 | if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; |
| 513 | return cont(function(type, value) { |
| 514 | if (type == end || value == end) return pass() |
| 515 | return pass(what) |
| 516 | }, proceed); |
| 517 | } |
| 518 | if (type == end || value == end) return cont(); |
| 519 | return cont(expect(end)); |
| 520 | } |
| 521 | return function(type, value) { |
| 522 | if (type == end || value == end) return cont(); |
| 523 | return pass(what, proceed); |