comparison cbackend.js @ 316:df4b67d8d2bc

Minor improvement to error message about invalid c type expressions
author Michael Pavone <pavone@retrodev.com>
date Thu, 19 Mar 2015 22:39:18 -0700
parents d1dc2d70bdfd
children 1debeb21dd47
comparison
equal deleted inserted replaced
315:f987bb2a1911 316:df4b67d8d2bc
315 argtypes += this.args[i].toCTypeName(); 315 argtypes += this.args[i].toCTypeName();
316 } 316 }
317 return [rettype.toCTypeName() + '(*', ')(' + argtypes + ')']; 317 return [rettype.toCTypeName() + '(*', ')(' + argtypes + ')'];
318 break; 318 break;
319 default: 319 default:
320 throw new Error('invalid use of funcall expression where a C type name is expected'); 320 throw new Error('invalid use of funcall expression where a C type name is expected: ' + this.name);
321 } 321 }
322 }; 322 };
323 funcall.prototype.toCLines = function(vars, needsreturn) { 323 funcall.prototype.toCLines = function(vars, needsreturn) {
324 var lines = []; 324 var lines = [];
325 var name = this.name[this.name.length-1] == ':' ? this.name.substr(0, this.name.length-1) : this.name; 325 var name = this.name[this.name.length-1] == ':' ? this.name.substr(0, this.name.length-1) : this.name;