(token, messageFormat)
| 144074 | return node; |
| 144075 | } // Throw an exception |
| 144076 | function throwError(token, messageFormat) { |
| 144077 | var error, args = Array.prototype.slice.call(arguments, 2), msg = messageFormat.replace(/%(\d)/g, (whole, index1)=>{ |
| 144078 | assert(index1 < args.length, "Message reference must be in range"); |
| 144079 | return args[index1]; |
| 144080 | }); |
| 144081 | error = new Error(msg); |
| 144082 | error.index = index; |
| 144083 | error.description = msg; |
| 144084 | throw error; |
| 144085 | } // Throw an exception because of the token. |
| 144086 | function throwUnexpected(token) { |
| 144087 | if (token.type === TokenEOF) throwError(token, MessageUnexpectedEOS); |
| 144088 | if (token.type === TokenNumericLiteral) throwError(token, MessageUnexpectedNumber); |
no test coverage detected