11import { NonterminalKind } from '@nomicfoundation/slang/cst' ;
2- import { joinExisting } from '../slang-utils/join-existing.js' ;
32import { extractVariant } from '../slang-utils/extract-variant.js' ;
43import { SlangNode } from './SlangNode.js' ;
54import { IdentifierPath } from './IdentifierPath.js' ;
@@ -13,7 +12,7 @@ import type { AstNode } from './types.d.ts';
1312export class RevertStatement extends SlangNode {
1413 readonly kind = NonterminalKind . RevertStatement ;
1514
16- error ? : IdentifierPath ;
15+ error : IdentifierPath ;
1716
1817 arguments : ArgumentsDeclaration [ 'variant' ] ;
1918
@@ -24,9 +23,7 @@ export class RevertStatement extends SlangNode {
2423 ) {
2524 super ( ast , collected ) ;
2625
27- if ( ast . error ) {
28- this . error = new IdentifierPath ( ast . error , collected ) ;
29- }
26+ this . error = new IdentifierPath ( ast . error , collected ) ;
3027 this . arguments = extractVariant (
3128 new ArgumentsDeclaration ( ast . arguments , collected , options )
3229 ) ;
@@ -36,7 +33,8 @@ export class RevertStatement extends SlangNode {
3633
3734 print ( path : AstPath < RevertStatement > , print : PrintFunction ) : Doc {
3835 return [
39- joinExisting ( ' ' , [ 'revert' , path . call ( print , 'error' ) ] ) ,
36+ 'revert ' ,
37+ path . call ( print , 'error' ) ,
4038 path . call ( print , 'arguments' ) ,
4139 ';'
4240 ] ;
0 commit comments