| 560 | } |
| 561 | function commasep(what, end, sep) { |
| 562 | function proceed(type, value) { |
| 563 | if (sep ? sep.indexOf(type) > -1 : type == ",") { |
| 564 | var lex = cx.state.lexical; |
| 565 | if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; |
| 566 | return cont(function(type, value) { |
| 567 | if (type == end || value == end) return pass() |
| 568 | return pass(what) |
| 569 | }, proceed); |
| 570 | } |
| 571 | if (type == end || value == end) return cont(); |
| 572 | if (sep && sep.indexOf(";") > -1) return pass(what) |
| 573 | return cont(expect(end)); |
| 574 | } |
| 575 | return function(type, value) { |
| 576 | if (type == end || value == end) return cont(); |
| 577 | return pass(what, proceed); |