-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExpression.ts
More file actions
60 lines (47 loc) · 1018 Bytes
/
Copy pathExpression.ts
File metadata and controls
60 lines (47 loc) · 1018 Bytes
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { Annotation, ArrayType, ObjectType } from "./Project";
export type Expression =
| ExpressionList
| Annotation
| Literal
| ConstructorInvocation
| Name
| Token
| Unknown;
export class ExpressionList {
expressions: Expression[];
constructor(expressions: Expression[]) {
this.expressions = expressions;
}
}
export class Literal {
value: string | number | boolean | null;
constructor(value: string | number | boolean | null) {
this.value = value;
}
}
export class ConstructorInvocation {
target: ObjectType | ArrayType;
arguments: Expression[];
constructor(target: ObjectType | ArrayType, args: Expression[] = []) {
this.target = target;
this.arguments = args;
}
}
export class Name {
name: string;
constructor(name: string) {
this.name = name;
}
}
export class Token {
code: string;
constructor(code: string) {
this.code = code;
}
}
export class Unknown {
code: string;
constructor(code: string) {
this.code = code;
}
}