forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruleDescriptor.ts
More file actions
30 lines (24 loc) · 1.13 KB
/
ruleDescriptor.ts
File metadata and controls
30 lines (24 loc) · 1.13 KB
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
///<reference path='references.ts' />
/* @internal */
namespace ts.formatting {
export class RuleDescriptor {
constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) {
}
public toString(): string {
return "[leftRange=" + this.LeftTokenRange + "," +
"rightRange=" + this.RightTokenRange + "]";
}
static create1(left: SyntaxKind, right: SyntaxKind): RuleDescriptor {
return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), Shared.TokenRange.FromToken(right));
}
static create2(left: Shared.TokenRange, right: SyntaxKind): RuleDescriptor {
return RuleDescriptor.create4(left, Shared.TokenRange.FromToken(right));
}
static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor {
return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), right);
}
static create4(left: Shared.TokenRange, right: Shared.TokenRange): RuleDescriptor {
return new RuleDescriptor(left, right);
}
}
}