1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
|
=== tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts ===
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
// See LICENSE.txt in the project root for complete license information.
///<reference path='typescript.ts' />
module TypeScript {
>TypeScript : typeof TypeScript
export module CompilerDiagnostics {
>CompilerDiagnostics : typeof CompilerDiagnostics
export var debug = false;
>debug : boolean
>false : false
export interface IDiagnosticWriter {
Alert(output: string): void;
>Alert : (output: string) => void
>output : string
}
export var diagnosticWriter: IDiagnosticWriter = null;
>diagnosticWriter : IDiagnosticWriter
>null : null
export var analysisPass: number = 0;
>analysisPass : number
>0 : 0
export function Alert(output: string) {
>Alert : (output: string) => void
>output : string
if (diagnosticWriter) {
>diagnosticWriter : IDiagnosticWriter
diagnosticWriter.Alert(output);
>diagnosticWriter.Alert(output) : void
>diagnosticWriter.Alert : (output: string) => void
>diagnosticWriter : IDiagnosticWriter
>Alert : (output: string) => void
>output : string
}
}
export function debugPrint(s: string) {
>debugPrint : (s: string) => void
>s : string
if (debug) {
>debug : boolean
Alert(s);
>Alert(s) : void
>Alert : (output: string) => void
>s : string
}
}
export function assert(condition: boolean, s: string) {
>assert : (condition: boolean, s: string) => void
>condition : boolean
>s : string
if (debug) {
>debug : boolean
if (!condition) {
>!condition : boolean
>condition : boolean
Alert(s);
>Alert(s) : void
>Alert : (output: string) => void
>s : string
}
}
}
}
export interface ILogger {
information(): boolean;
>information : () => boolean
debug(): boolean;
>debug : () => boolean
warning(): boolean;
>warning : () => boolean
error(): boolean;
>error : () => boolean
fatal(): boolean;
>fatal : () => boolean
log(s: string): void;
>log : (s: string) => void
>s : string
}
export class NullLogger implements ILogger {
>NullLogger : NullLogger
public information(): boolean { return false; }
>information : () => boolean
>false : false
public debug(): boolean { return false; }
>debug : () => boolean
>false : false
public warning(): boolean { return false; }
>warning : () => boolean
>false : false
public error(): boolean { return false; }
>error : () => boolean
>false : false
public fatal(): boolean { return false; }
>fatal : () => boolean
>false : false
public log(s: string): void {
>log : (s: string) => void
>s : string
}
}
export class LoggerAdapter implements ILogger {
>LoggerAdapter : LoggerAdapter
private _information: boolean;
>_information : boolean
private _debug: boolean;
>_debug : boolean
private _warning: boolean;
>_warning : boolean
private _error: boolean;
>_error : boolean
private _fatal: boolean;
>_fatal : boolean
constructor (public logger: ILogger) {
>logger : ILogger
this._information = this.logger.information();
>this._information = this.logger.information() : boolean
>this._information : boolean
>this : this
>_information : boolean
>this.logger.information() : boolean
>this.logger.information : () => boolean
>this.logger : ILogger
>this : this
>logger : ILogger
>information : () => boolean
this._debug = this.logger.debug();
>this._debug = this.logger.debug() : boolean
>this._debug : boolean
>this : this
>_debug : boolean
>this.logger.debug() : boolean
>this.logger.debug : () => boolean
>this.logger : ILogger
>this : this
>logger : ILogger
>debug : () => boolean
this._warning = this.logger.warning();
>this._warning = this.logger.warning() : boolean
>this._warning : boolean
>this : this
>_warning : boolean
>this.logger.warning() : boolean
>this.logger.warning : () => boolean
>this.logger : ILogger
>this : this
>logger : ILogger
>warning : () => boolean
this._error = this.logger.error();
>this._error = this.logger.error() : boolean
>this._error : boolean
>this : this
>_error : boolean
>this.logger.error() : boolean
>this.logger.error : () => boolean
>this.logger : ILogger
>this : this
>logger : ILogger
>error : () => boolean
this._fatal = this.logger.fatal();
>this._fatal = this.logger.fatal() : boolean
>this._fatal : boolean
>this : this
>_fatal : boolean
>this.logger.fatal() : boolean
>this.logger.fatal : () => boolean
>this.logger : ILogger
>this : this
>logger : ILogger
>fatal : () => boolean
}
public information(): boolean { return this._information; }
>information : () => boolean
>this._information : boolean
>this : this
>_information : boolean
public debug(): boolean { return this._debug; }
>debug : () => boolean
>this._debug : boolean
>this : this
>_debug : boolean
public warning(): boolean { return this._warning; }
>warning : () => boolean
>this._warning : boolean
>this : this
>_warning : boolean
public error(): boolean { return this._error; }
>error : () => boolean
>this._error : boolean
>this : this
>_error : boolean
public fatal(): boolean { return this._fatal; }
>fatal : () => boolean
>this._fatal : boolean
>this : this
>_fatal : boolean
public log(s: string): void {
>log : (s: string) => void
>s : string
this.logger.log(s);
>this.logger.log(s) : void
>this.logger.log : (s: string) => void
>this.logger : ILogger
>this : this
>logger : ILogger
>log : (s: string) => void
>s : string
}
}
export class BufferedLogger implements ILogger {
>BufferedLogger : BufferedLogger
public logContents = [];
>logContents : any[]
>[] : undefined[]
public information(): boolean { return false; }
>information : () => boolean
>false : false
public debug(): boolean { return false; }
>debug : () => boolean
>false : false
public warning(): boolean { return false; }
>warning : () => boolean
>false : false
public error(): boolean { return false; }
>error : () => boolean
>false : false
public fatal(): boolean { return false; }
>fatal : () => boolean
>false : false
public log(s: string): void {
>log : (s: string) => void
>s : string
this.logContents.push(s);
>this.logContents.push(s) : number
>this.logContents.push : (...items: any[]) => number
>this.logContents : any[]
>this : this
>logContents : any[]
>push : (...items: any[]) => number
>s : string
}
}
export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any {
>timeFunction : (logger: ILogger, funcDescription: string, func: () => any) => any
>logger : ILogger
>funcDescription : string
>func : () => any
var start = +new Date();
>start : number
>+new Date() : number
>new Date() : Date
>Date : DateConstructor
var result = func();
>result : any
>func() : any
>func : () => any
var end = +new Date();
>end : number
>+new Date() : number
>new Date() : Date
>Date : DateConstructor
logger.log(funcDescription + " completed in " + (end - start) + " msec");
>logger.log(funcDescription + " completed in " + (end - start) + " msec") : void
>logger.log : (s: string) => void
>logger : ILogger
>log : (s: string) => void
>funcDescription + " completed in " + (end - start) + " msec" : string
>funcDescription + " completed in " + (end - start) : string
>funcDescription + " completed in " : string
>funcDescription : string
>" completed in " : " completed in "
>(end - start) : number
>end - start : number
>end : number
>start : number
>" msec" : " msec"
return result;
>result : any
}
export function stringToLiteral(value: string, length: number): string {
>stringToLiteral : (value: string, length: number) => string
>value : string
>length : number
var result = "";
>result : string
>"" : ""
var addChar = (index: number) => {
>addChar : (index: number) => void
>(index: number) => { var ch = value.charCodeAt(index); switch (ch) { case 0x09: // tab result += "\\t"; break; case 0x0a: // line feed result += "\\n"; break; case 0x0b: // vertical tab result += "\\v"; break; case 0x0c: // form feed result += "\\f"; break; case 0x0d: // carriage return result += "\\r"; break; case 0x22: // double quote result += "\\\""; break; case 0x27: // single quote result += "\\\'"; break; case 0x5c: // Backslash result += "\\"; break; default: result += value.charAt(index); } } : (index: number) => void
>index : number
var ch = value.charCodeAt(index);
>ch : number
>value.charCodeAt(index) : number
>value.charCodeAt : (index: number) => number
>value : string
>charCodeAt : (index: number) => number
>index : number
switch (ch) {
>ch : number
case 0x09: // tab
>0x09 : 9
result += "\\t";
>result += "\\t" : string
>result : string
>"\\t" : "\\t"
break;
case 0x0a: // line feed
>0x0a : 10
result += "\\n";
>result += "\\n" : string
>result : string
>"\\n" : "\\n"
break;
case 0x0b: // vertical tab
>0x0b : 11
result += "\\v";
>result += "\\v" : string
>result : string
>"\\v" : "\\v"
break;
case 0x0c: // form feed
>0x0c : 12
result += "\\f";
>result += "\\f" : string
>result : string
>"\\f" : "\\f"
break;
case 0x0d: // carriage return
>0x0d : 13
result += "\\r";
>result += "\\r" : string
>result : string
>"\\r" : "\\r"
break;
case 0x22: // double quote
>0x22 : 34
result += "\\\"";
>result += "\\\"" : string
>result : string
>"\\\"" : "\\\""
break;
case 0x27: // single quote
>0x27 : 39
result += "\\\'";
>result += "\\\'" : string
>result : string
>"\\\'" : "\\'"
break;
case 0x5c: // Backslash
>0x5c : 92
result += "\\";
>result += "\\" : string
>result : string
>"\\" : "\\"
break;
default:
result += value.charAt(index);
>result += value.charAt(index) : string
>result : string
>value.charAt(index) : string
>value.charAt : (pos: number) => string
>value : string
>charAt : (pos: number) => string
>index : number
}
}
var tooLong = (value.length > length);
>tooLong : boolean
>(value.length > length) : boolean
>value.length > length : boolean
>value.length : number
>value : string
>length : number
>length : number
if (tooLong) {
>tooLong : boolean
var mid = length >> 1;
>mid : number
>length >> 1 : number
>length : number
>1 : 1
for (var i = 0; i < mid; i++) addChar(i);
>i : number
>0 : 0
>i < mid : boolean
>i : number
>mid : number
>i++ : number
>i : number
>addChar(i) : void
>addChar : (index: number) => void
>i : number
result += "(...)";
>result += "(...)" : string
>result : string
>"(...)" : "(...)"
for (var i = value.length - mid; i < value.length; i++) addChar(i);
>i : number
>value.length - mid : number
>value.length : number
>value : string
>length : number
>mid : number
>i < value.length : boolean
>i : number
>value.length : number
>value : string
>length : number
>i++ : number
>i : number
>addChar(i) : void
>addChar : (index: number) => void
>i : number
}
else {
length = value.length;
>length = value.length : number
>length : number
>value.length : number
>value : string
>length : number
for (var i = 0; i < length; i++) addChar(i);
>i : number
>0 : 0
>i < length : boolean
>i : number
>length : number
>i++ : number
>i : number
>addChar(i) : void
>addChar : (index: number) => void
>i : number
}
return result;
>result : string
}
}
|