style(lint): re-format modules/@angular
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
import {SetWrapper} from '../facade/collection';
|
||||
import {NumberWrapper, StringJoiner, StringWrapper, isPresent} from '../facade/lang';
|
||||
import {BaseException} from '../facade/exceptions';
|
||||
import {NumberWrapper, StringJoiner, StringWrapper, isPresent} from '../facade/lang';
|
||||
|
||||
export enum TokenType {
|
||||
Character,
|
||||
@ -27,8 +28,9 @@ export class Lexer {
|
||||
}
|
||||
|
||||
export class Token {
|
||||
constructor(public index: number, public type: TokenType, public numValue: number,
|
||||
public strValue: string) {}
|
||||
constructor(
|
||||
public index: number, public type: TokenType, public numValue: number,
|
||||
public strValue: string) {}
|
||||
|
||||
isCharacter(code: number): boolean {
|
||||
return (this.type == TokenType.Character && this.numValue == code);
|
||||
@ -47,20 +49,20 @@ export class Token {
|
||||
isKeyword(): boolean { return (this.type == TokenType.Keyword); }
|
||||
|
||||
isKeywordDeprecatedVar(): boolean {
|
||||
return (this.type == TokenType.Keyword && this.strValue == "var");
|
||||
return (this.type == TokenType.Keyword && this.strValue == 'var');
|
||||
}
|
||||
|
||||
isKeywordLet(): boolean { return (this.type == TokenType.Keyword && this.strValue == "let"); }
|
||||
isKeywordLet(): boolean { return (this.type == TokenType.Keyword && this.strValue == 'let'); }
|
||||
|
||||
isKeywordNull(): boolean { return (this.type == TokenType.Keyword && this.strValue == "null"); }
|
||||
isKeywordNull(): boolean { return (this.type == TokenType.Keyword && this.strValue == 'null'); }
|
||||
|
||||
isKeywordUndefined(): boolean {
|
||||
return (this.type == TokenType.Keyword && this.strValue == "undefined");
|
||||
return (this.type == TokenType.Keyword && this.strValue == 'undefined');
|
||||
}
|
||||
|
||||
isKeywordTrue(): boolean { return (this.type == TokenType.Keyword && this.strValue == "true"); }
|
||||
isKeywordTrue(): boolean { return (this.type == TokenType.Keyword && this.strValue == 'true'); }
|
||||
|
||||
isKeywordFalse(): boolean { return (this.type == TokenType.Keyword && this.strValue == "false"); }
|
||||
isKeywordFalse(): boolean { return (this.type == TokenType.Keyword && this.strValue == 'false'); }
|
||||
|
||||
toNumber(): number {
|
||||
// -1 instead of NULL ok?
|
||||
@ -104,11 +106,11 @@ function newStringToken(index: number, text: string): Token {
|
||||
}
|
||||
|
||||
function newNumberToken(index: number, n: number): Token {
|
||||
return new Token(index, TokenType.Number, n, "");
|
||||
return new Token(index, TokenType.Number, n, '');
|
||||
}
|
||||
|
||||
|
||||
export var EOF: Token = new Token(-1, TokenType.Character, 0, "");
|
||||
export var EOF: Token = new Token(-1, TokenType.Character, 0, '');
|
||||
|
||||
export const $EOF = /*@ts2dart_const*/ 0;
|
||||
export const $TAB = /*@ts2dart_const*/ 9;
|
||||
@ -237,8 +239,8 @@ class _Scanner {
|
||||
return this.scanComplexOperator(start, StringWrapper.fromCharCode(peek), $EQ, '=');
|
||||
case $BANG:
|
||||
case $EQ:
|
||||
return this.scanComplexOperator(start, StringWrapper.fromCharCode(peek), $EQ, '=', $EQ,
|
||||
'=');
|
||||
return this.scanComplexOperator(
|
||||
start, StringWrapper.fromCharCode(peek), $EQ, '=', $EQ, '=');
|
||||
case $AMPERSAND:
|
||||
return this.scanComplexOperator(start, '&', $AMPERSAND, '&');
|
||||
case $BAR:
|
||||
@ -274,8 +276,9 @@ class _Scanner {
|
||||
* @param three third symbol (part of the operator when provided and matches source expression)
|
||||
* @returns {Token}
|
||||
*/
|
||||
scanComplexOperator(start: number, one: string, twoCode: number, two: string, threeCode?: number,
|
||||
three?: string): Token {
|
||||
scanComplexOperator(
|
||||
start: number, one: string, twoCode: number, two: string, threeCode?: number,
|
||||
three?: string): Token {
|
||||
this.advance();
|
||||
var str: string = one;
|
||||
if (this.peek == twoCode) {
|
||||
@ -406,7 +409,7 @@ export function isIdentifier(input: string): boolean {
|
||||
|
||||
function isIdentifierPart(code: number): boolean {
|
||||
return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) ||
|
||||
(code == $_) || (code == $$);
|
||||
(code == $_) || (code == $$);
|
||||
}
|
||||
|
||||
function isDigit(code: number): boolean {
|
||||
@ -443,29 +446,8 @@ function unescape(code: number): number {
|
||||
}
|
||||
|
||||
var OPERATORS = SetWrapper.createFromList([
|
||||
'+',
|
||||
'-',
|
||||
'*',
|
||||
'/',
|
||||
'%',
|
||||
'^',
|
||||
'=',
|
||||
'==',
|
||||
'!=',
|
||||
'===',
|
||||
'!==',
|
||||
'<',
|
||||
'>',
|
||||
'<=',
|
||||
'>=',
|
||||
'&&',
|
||||
'||',
|
||||
'&',
|
||||
'|',
|
||||
'!',
|
||||
'?',
|
||||
'#',
|
||||
'?.'
|
||||
'+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<',
|
||||
'>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.'
|
||||
]);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user