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
|
tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
==== tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts (1 errors) ====
// 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' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export module CompilerDiagnostics {
export var debug = false;
export interface IDiagnosticWriter {
Alert(output: string): void;
}
export var diagnosticWriter: IDiagnosticWriter = null;
export var analysisPass: number = 0;
export function Alert(output: string) {
if (diagnosticWriter) {
diagnosticWriter.Alert(output);
}
}
export function debugPrint(s: string) {
if (debug) {
Alert(s);
}
}
export function assert(condition: boolean, s: string) {
if (debug) {
if (!condition) {
Alert(s);
}
}
}
}
export interface ILogger {
information(): boolean;
debug(): boolean;
warning(): boolean;
error(): boolean;
fatal(): boolean;
log(s: string): void;
}
export class NullLogger implements ILogger {
public information(): boolean { return false; }
public debug(): boolean { return false; }
public warning(): boolean { return false; }
public error(): boolean { return false; }
public fatal(): boolean { return false; }
public log(s: string): void {
}
}
export class LoggerAdapter implements ILogger {
private _information: boolean;
private _debug: boolean;
private _warning: boolean;
private _error: boolean;
private _fatal: boolean;
constructor (public logger: ILogger) {
this._information = this.logger.information();
this._debug = this.logger.debug();
this._warning = this.logger.warning();
this._error = this.logger.error();
this._fatal = this.logger.fatal();
}
public information(): boolean { return this._information; }
public debug(): boolean { return this._debug; }
public warning(): boolean { return this._warning; }
public error(): boolean { return this._error; }
public fatal(): boolean { return this._fatal; }
public log(s: string): void {
this.logger.log(s);
}
}
export class BufferedLogger implements ILogger {
public logContents = [];
public information(): boolean { return false; }
public debug(): boolean { return false; }
public warning(): boolean { return false; }
public error(): boolean { return false; }
public fatal(): boolean { return false; }
public log(s: string): void {
this.logContents.push(s);
}
}
export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any {
var start = +new Date();
var result = func();
var end = +new Date();
logger.log(funcDescription + " completed in " + (end - start) + " msec");
return result;
}
export function stringToLiteral(value: string, length: number): string {
var result = "";
var addChar = (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);
}
}
var tooLong = (value.length > length);
if (tooLong) {
var mid = length >> 1;
for (var i = 0; i < mid; i++) addChar(i);
result += "(...)";
for (var i = value.length - mid; i < value.length; i++) addChar(i);
}
else {
length = value.length;
for (var i = 0; i < length; i++) addChar(i);
}
return result;
}
}
|