(arg, msg)
| 87 | } |
| 88 | |
| 89 | function expect(arg, msg) { |
| 90 | // some older browsers return typeof 'function' for RegExp |
| 91 | const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); |
| 92 | if (result) { |
| 93 | return result; |
| 94 | } |
| 95 | |
| 96 | error(msg || (typeof arg === 'string' |
| 97 | ? `expected '${arg}' got '${parserInput.currentChar()}'` |
| 98 | : 'unexpected token')); |
| 99 | } |
| 100 | |
| 101 | // Specialization of expect() |
| 102 | function expectChar(arg, msg) { |
no test coverage detected