##// END OF EJS Templates
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version

File last commit:

r115:691199f665e0 ioc ts support
r146:f3f5c56d3b3e v1.4.0-rc5 default
Show More
FormatScanner.ts
54 lines | 1.3 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / text / FormatScanner.ts
cin
working on text writer
r79 import { argumentNotEmptyString } from "../safe";
import { MapOf } from "../interfaces";
export const enum TokeType {
cin
StringBuilder, TextWriter, ConsoleWriter tests
r82 CurlOpen = 1,
CurlClose = 2,
Colon = 3,
Text = 4
cin
working on text writer
r79 }
const typeMap = {
"{": TokeType.CurlOpen,
"}": TokeType.CurlClose,
":": TokeType.Colon
} as MapOf<TokeType>;
export class FormatScanner {
private _text: string;
cin
corrected code to support ts strict mode...
r115 private _tokenType: TokeType | undefined;
private _tokenValue: string | undefined;
cin
working on text writer
r79 private _rx = /[^{}:]+|(.)/g;
constructor(text: string) {
argumentNotEmptyString(text, text);
this._text = text;
}
next() {
if (this._rx.lastIndex >= this._text.length)
return false;
const match = this._rx.exec(this._text);
cin
corrected code to support ts strict mode...
r115 if (match === null)
return false;
cin
working on text writer
r79 this._tokenType = typeMap[match[1]] || TokeType.Text;
this._tokenValue = match[0];
return true;
}
getTokenValue() {
cin
corrected code to support ts strict mode...
r115 if (this._tokenValue === undefined)
throw new Error("The scanner is before the first element");
cin
working on text writer
r79 return this._tokenValue;
}
getTokenType() {
cin
corrected code to support ts strict mode...
r115
if (this._tokenType === undefined)
throw new Error("The scanner is before the first element");
cin
working on text writer
r79 return this._tokenType;
}
}