forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinePosition.ts
More file actions
35 lines (28 loc) · 1.08 KB
/
Copy pathlinePosition.ts
File metadata and controls
35 lines (28 loc) · 1.08 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
31
32
33
34
35
///<reference path='references.ts' />
module TypeScript {
export class LineAndCharacter {
private _line: number = 0;
private _character: number = 0;
/**
* Initializes a new instance of a LinePosition with the given line and character. ArgumentOutOfRangeException if "line" or "character" is less than zero.
* @param line The line of the line position. The first line in a file is defined as line 0 (zero based line numbering).
* @param character The character position in the line.
*/
constructor(line: number, character: number) {
if (line < 0) {
throw Errors.argumentOutOfRange("line");
}
if (character < 0) {
throw Errors.argumentOutOfRange("character");
}
this._line = line;
this._character = character;
}
public line(): number {
return this._line;
}
public character(): number {
return this._character;
}
}
}