forked from sveltejs/svelte-eslint-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.ts
43 lines (40 loc) · 768 Bytes
/
common.ts
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
import type { BaseNode } from "./base.js";
export interface Position {
/** >= 1 */
line: number;
/** >= 0 */
column: number;
}
export type Range = [number, number];
export interface SourceLocation {
start: Position;
end: Position;
}
export interface Locations {
loc: SourceLocation;
range: Range;
}
export interface Token extends BaseNode {
type:
| "Boolean"
| "Null"
| "Identifier"
| "Keyword"
| "Punctuator"
| "JSXIdentifier"
| "JSXText"
| "Numeric"
| "String"
| "RegularExpression"
| "Template"
// HTML
| "HTMLText"
| "HTMLIdentifier"
| "MustacheKeyword"
| "HTMLComment";
value: string;
}
export interface Comment extends BaseNode {
type: "Line" | "Block";
value: string;
}