File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,11 @@ export function parse(content: string): Definition[] {
58
58
} else {
59
59
const line = content . substring ( 0 , start + 1 ) . split ( "\n" ) . length ;
60
60
console . error (
61
- `Failed to parse function definition for ${ fn } at line ${ line } ` ,
61
+ `Failed to parse function definition for ' ${ fn } ' at line ${ line } : ` ,
62
62
) ;
63
+ console . error ( "----- block start -----" ) ;
64
+ console . error ( block ) ;
65
+ console . error ( "----- block end -----" ) ;
63
66
}
64
67
}
65
68
return definitions ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export function parse(content: string) {
29
29
30
30
const options : Option [ ] = [ ] ;
31
31
const succeeds = new Set < number > ( ) ;
32
- const errors : Array < { name : string ; start : number } > = [ ] ;
32
+ const errors : Array < { name : string ; start : number ; block : string } > = [ ] ;
33
33
let last = - 1 ;
34
34
for ( const match of content . matchAll ( / \* ' ( \w + ) ' \* / g) ) {
35
35
const name = match [ 1 ] ;
@@ -45,17 +45,20 @@ export function parse(content: string) {
45
45
succeeds . add ( start ) ;
46
46
last = end ;
47
47
} else {
48
- errors . push ( { name, start } ) ;
48
+ errors . push ( { name, start, block } ) ;
49
49
}
50
50
}
51
51
52
52
if ( errors . length ) {
53
- for ( const { name, start } of errors ) {
53
+ for ( const { name, start, block } of errors ) {
54
54
if ( ! succeeds . has ( start ) ) {
55
55
const line = content . substring ( 0 , start + 1 ) . split ( "\n" ) . length ;
56
56
console . error (
57
- `Failed to parse option definition for ${ name } at line ${ line } ` ,
57
+ `Failed to parse option definition for ' ${ name } ' at line ${ line } : ` ,
58
58
) ;
59
+ console . error ( "----- block start -----" ) ;
60
+ console . error ( block ) ;
61
+ console . error ( "----- block end -----" ) ;
59
62
}
60
63
}
61
64
}
You can’t perform that action at this time.
0 commit comments