(arg, msg, index)
| 3124 | } |
| 3125 | |
| 3126 | function expect(arg, msg, index) { |
| 3127 | // some older browsers return typeof 'function' for RegExp |
| 3128 | var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); |
| 3129 | if (result) { |
| 3130 | return result; |
| 3131 | } |
| 3132 | error(msg || (typeof arg === 'string' ? "expected '" + arg + "' got '" + parserInput.currentChar() + "'" |
| 3133 | : "unexpected token")); |
| 3134 | } |
| 3135 | |
| 3136 | // Specialization of expect() |
| 3137 | function expectChar(arg, msg) { |