File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,16 +12,20 @@ import { Update } from './update';
1212
1313export * from './base' ;
1414
15+ class Match extends External < frontend . code . External > { }
16+ class Span extends External < frontend . code . Span > { }
17+ class Value extends External < frontend . code . Value > { }
18+
1519export default {
1620 And,
1721 IsEqual,
1822 Load,
19- Match : class Match extends External < frontend . code . External > { } ,
23+ Match,
2024 MulAdd,
2125 Or,
22- Span : class Span extends External < frontend . code . Span > { } ,
26+ Span,
2327 Store,
2428 Test,
2529 Update,
26- Value : class Value extends External < frontend . code . Value > { } ,
30+ Value,
2731} ;
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ export class CCompiler {
171171 const posField = ctx . spanPosField ( span . index ) ;
172172 let callback : string ;
173173 if ( span . callbacks . length === 1 ) {
174- callback = ctx . buildCode ( ctx . unwrapCode ( span . callbacks [ 0 ] ) ) ;
174+ callback = ctx . buildCode ( ctx . unwrapCode ( span . callbacks [ 0 ] ! ) ) ;
175175 } else {
176176 callback = `(${ info . prefix } __span_cb) ` + ctx . spanCbField ( span . index ) ;
177177 callback = `(${ callback } )` ;
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ import { TableLookup } from './table-lookup';
1313
1414export { Node } from './base' ;
1515
16+ class Error extends ErrorNode < frontend . node . Error > { }
17+
1618export default {
1719 Consume,
1820 Empty,
19- Error : class Error extends ErrorNode < frontend . node . Error > { } ,
21+ Error,
2022 Invoke,
2123 Pause,
2224 Sequence,
Original file line number Diff line number Diff line change @@ -39,11 +39,10 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
3939 const current = transform . build ( ctx , `*${ ctx . posArg ( ) } ` ) ;
4040 out . push ( `switch (${ table . name } [(uint8_t) ${ current } ]) {` ) ;
4141
42- for ( const [ index ] of this . ref . edges . entries ( ) ) {
42+ for ( const [ index , edge ] of this . ref . edges . entries ( ) ) {
4343 out . push ( ` case ${ index + 1 } : {` ) ;
4444
4545 const tmp : string [ ] = [ ] ;
46- const edge = this . ref . edges [ index ] ;
4746 this . tailTo ( tmp , {
4847 noAdvance : edge . noAdvance ,
4948 node : edge . node ,
@@ -77,7 +76,10 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
7776 }
7877
7978 const edge = this . ref . edges [ 0 ] ;
80- if ( edge . node . ref !== this . ref ) {
79+ if (
80+ ! edge ||
81+ edge . node . ref !== this . ref
82+ ) {
8183 return false ;
8284 }
8385
Original file line number Diff line number Diff line change 88 "declaration" : true ,
99 "pretty" : true ,
1010 "sourceMap" : true ,
11+ "noUncheckedIndexedAccess" : true ,
1112 "noUnusedLocals" : true
1213 },
1314 "include" : [
You can’t perform that action at this time.
0 commit comments