Implement Math/Mathf.exp; Initial math test suite

This commit is contained in:
dcodeIO
2018-03-25 17:42:56 +02:00
parent 70d2a0a425
commit e26734ef90
12 changed files with 7292 additions and 105 deletions

View File

@ -1269,6 +1269,20 @@ export class Tokenizer extends DiagnosticEmitter {
}
readFloat(): f64 {
// var text = this.source.text;
// if (text.charCodeAt(this.pos) == CharCode._0 && this.pos + 2 < this.end) {
// switch (text.charCodeAt(this.pos + 1)) {
// case CharCode.X:
// case CharCode.x: {
// this.pos += 2;
// return this.readHexFloat();
// }
// }
// }
return this.readDecimalFloat();
}
readDecimalFloat(): f64 {
var start = this.pos;
var text = this.source.text;
while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) {
@ -1300,6 +1314,10 @@ export class Tokenizer extends DiagnosticEmitter {
return parseFloat(text.substring(start, this.pos));
}
readHexFloat(): f64 {
throw new Error("not implemented"); // TBD
}
readUnicodeEscape(): string {
var remain = 4;
var value = 0;