@@ -5,6 +5,11 @@ export enum IssueType { LEXICAL, SYNTACTIC, SEMANTIC}
5
5
6
6
export enum IssueSeverity { ERROR , WARNING , INFO }
7
7
8
+ export interface IssueArg {
9
+ name : string ;
10
+ value : string ;
11
+ }
12
+
8
13
export class Issue {
9
14
10
15
constructor (
@@ -14,25 +19,25 @@ export class Issue {
14
19
public readonly position ?: Position ,
15
20
public readonly node ?: Node ,
16
21
public readonly code ?: string ,
17
- public readonly args : { [ key : string ] : string } = { }
22
+ public readonly args : IssueArg [ ] = [ ]
18
23
) {
19
24
if ( ! position ) {
20
25
this . position = node ?. position ;
21
26
}
22
27
}
23
28
24
29
static lexical ( message : string , severity : IssueSeverity = IssueSeverity . ERROR , position ?: Position ,
25
- node ?: Node , code ?: string , args : { [ key : string ] : string } = { } ) : Issue {
30
+ node ?: Node , code ?: string , args : IssueArg [ ] = [ ] ) : Issue {
26
31
return new Issue ( IssueType . LEXICAL , message , severity , position , node , code , args ) ;
27
32
}
28
33
29
34
static syntactic ( message : string , severity : IssueSeverity = IssueSeverity . ERROR , position ?: Position ,
30
- node ?: Node , code ?: string , args : { [ key : string ] : string } = { } ) : Issue {
35
+ node ?: Node , code ?: string , args : IssueArg [ ] = [ ] ) : Issue {
31
36
return new Issue ( IssueType . SYNTACTIC , message , severity , position , node , code , args ) ;
32
37
}
33
38
34
39
static semantic ( message : string , severity : IssueSeverity = IssueSeverity . ERROR , position ?: Position ,
35
- node ?: Node , code ?: string , args : { [ key : string ] : string } = { } ) : Issue {
40
+ node ?: Node , code ?: string , args : IssueArg [ ] = [ ] ) : Issue {
36
41
return new Issue ( IssueType . SEMANTIC , message , severity , position , node , code , args ) ;
37
42
}
38
43
}
0 commit comments