fix(solidity-parser-antlr): fix visitor definition

The visitor's return value should really be that `false | any` which is equal to `any`.
See https://github.com/federicobond/solidity-parser-antlr/blob/73c6818452ba2eb50338b6a857acb82e976c34be/src/index.js#L97 . Current master version of `solidity-parser-antlr` only cares whether it's `false`.
This commit is contained in:
Xiao Liang
2019-02-11 03:15:52 +08:00
committed by GitHub
parent f203e28594
commit b45d238cec
+82 -82
View File
@@ -246,88 +246,88 @@ export type ASTNode =
| BinaryOperation
| Conditional;
export interface Visitor {
SourceUnit?: (node: SourceUnit) => void;
PragmaDirective?: (node: PragmaDirective) => void;
PragmaName?: (node: PragmaName) => void;
PragmaValue?: (node: PragmaValue) => void;
Version?: (node: Version) => void;
VersionOperator?: (node: VersionOperator) => void;
VersionConstraint?: (node: VersionConstraint) => void;
ImportDeclaration?: (node: ImportDeclaration) => void;
ImportDirective?: (node: ImportDirective) => void;
ContractDefinition?: (node: ContractDefinition) => void;
InheritanceSpecifier?: (node: InheritanceSpecifier) => void;
ContractPart?: (node: ContractPart) => void;
StateVariableDeclaration?: (node: StateVariableDeclaration) => void;
UsingForDeclaration?: (node: UsingForDeclaration) => void;
StructDefinition?: (node: StructDefinition) => void;
ModifierDefinition?: (node: ModifierDefinition) => void;
ModifierInvocation?: (node: ModifierInvocation) => void;
FunctionDefinition?: (node: FunctionDefinition) => void;
ReturnParameters?: (node: ReturnParameters) => void;
ModifierList?: (node: ModifierList) => void;
EventDefinition?: (node: EventDefinition) => void;
EnumValue?: (node: EnumValue) => void;
EnumDefinition?: (node: EnumDefinition) => void;
ParameterList?: (node: ParameterList) => void;
Parameter?: (node: Parameter) => void;
EventParameterList?: (node: EventParameterList) => void;
EventParameter?: (node: EventParameter) => void;
FunctionTypeParameterList?: (node: FunctionTypeParameterList) => void;
FunctionTypeParameter?: (node: FunctionTypeParameter) => void;
VariableDeclaration?: (node: VariableDeclaration) => void;
TypeName?: (node: TypeName) => void;
UserDefinedTypeName?: (node: UserDefinedTypeName) => void;
Mapping?: (node: Mapping) => void;
FunctionTypeName?: (node: FunctionTypeName) => void;
StorageLocation?: (node: StorageLocation) => void;
StateMutability?: (node: StateMutability) => void;
Block?: (node: Block) => void;
Statement?: (node: Statement) => void;
ExpressionStatement?: (node: ExpressionStatement) => void;
IfStatement?: (node: IfStatement) => void;
WhileStatement?: (node: WhileStatement) => void;
SimpleStatement?: (node: SimpleStatement) => void;
ForStatement?: (node: ForStatement) => void;
InlineAssemblyStatement?: (node: InlineAssemblyStatement) => void;
DoWhileStatement?: (node: DoWhileStatement) => void;
ContinueStatement?: (node: ContinueStatement) => void;
BreakStatement?: (node: BreakStatement) => void;
ReturnStatement?: (node: ReturnStatement) => void;
ThrowStatement?: (node: ThrowStatement) => void;
VariableDeclarationStatement?: (node: VariableDeclarationStatement) => void;
IdentifierList?: (node: IdentifierList) => void;
ElementaryTypeName?: (node: ElementaryTypeName) => void;
Expression?: (node: Expression) => void;
PrimaryExpression?: (node: PrimaryExpression) => void;
ExpressionList?: (node: ExpressionList) => void;
NameValueList?: (node: NameValueList) => void;
NameValue?: (node: NameValue) => void;
FunctionCallArguments?: (node: FunctionCallArguments) => void;
AssemblyBlock?: (node: AssemblyBlock) => void;
AssemblyItem?: (node: AssemblyItem) => void;
AssemblyExpression?: (node: AssemblyExpression) => void;
AssemblyCall?: (node: AssemblyCall) => void;
AssemblyLocalDefinition?: (node: AssemblyLocalDefinition) => void;
AssemblyAssignment?: (node: AssemblyAssignment) => void;
AssemblyIdentifierOrList?: (node: AssemblyIdentifierOrList) => void;
AssemblyIdentifierList?: (node: AssemblyIdentifierList) => void;
AssemblyStackAssignment?: (node: AssemblyStackAssignment) => void;
LabelDefinition?: (node: LabelDefinition) => void;
AssemblySwitch?: (node: AssemblySwitch) => void;
AssemblyCase?: (node: AssemblyCase) => void;
AssemblyFunctionDefinition?: (node: AssemblyFunctionDefinition) => void;
AssemblyFunctionReturns?: (node: AssemblyFunctionReturns) => void;
AssemblyFor?: (node: AssemblyFor) => void;
AssemblyIf?: (node: AssemblyIf) => void;
AssemblyLiteral?: (node: AssemblyLiteral) => void;
SubAssembly?: (node: SubAssembly) => void;
TupleExpression?: (node: TupleExpression) => void;
ElementaryTypeNameExpression?: (node: ElementaryTypeNameExpression) => void;
NumberLiteral?: (node: NumberLiteral) => void;
Identifier?: (node: Identifier) => void;
BinaryOperation?: (node: BinaryOperation) => void;
Conditional?: (node: Conditional) => void;
SourceUnit?: (node: SourceUnit) => any;
PragmaDirective?: (node: PragmaDirective) => any;
PragmaName?: (node: PragmaName) => any;
PragmaValue?: (node: PragmaValue) => any;
Version?: (node: Version) => any;
VersionOperator?: (node: VersionOperator) => any;
VersionConstraint?: (node: VersionConstraint) => any;
ImportDeclaration?: (node: ImportDeclaration) => any;
ImportDirective?: (node: ImportDirective) => any;
ContractDefinition?: (node: ContractDefinition) => any;
InheritanceSpecifier?: (node: InheritanceSpecifier) => any;
ContractPart?: (node: ContractPart) => any;
StateVariableDeclaration?: (node: StateVariableDeclaration) => any;
UsingForDeclaration?: (node: UsingForDeclaration) => any;
StructDefinition?: (node: StructDefinition) => any;
ModifierDefinition?: (node: ModifierDefinition) => any;
ModifierInvocation?: (node: ModifierInvocation) => any;
FunctionDefinition?: (node: FunctionDefinition) => any;
ReturnParameters?: (node: ReturnParameters) => any;
ModifierList?: (node: ModifierList) => any;
EventDefinition?: (node: EventDefinition) => any;
EnumValue?: (node: EnumValue) => any;
EnumDefinition?: (node: EnumDefinition) => any;
ParameterList?: (node: ParameterList) => any;
Parameter?: (node: Parameter) => any;
EventParameterList?: (node: EventParameterList) => any;
EventParameter?: (node: EventParameter) => any;
FunctionTypeParameterList?: (node: FunctionTypeParameterList) => any;
FunctionTypeParameter?: (node: FunctionTypeParameter) => any;
VariableDeclaration?: (node: VariableDeclaration) => any;
TypeName?: (node: TypeName) => any;
UserDefinedTypeName?: (node: UserDefinedTypeName) => any;
Mapping?: (node: Mapping) => any;
FunctionTypeName?: (node: FunctionTypeName) => any;
StorageLocation?: (node: StorageLocation) => any;
StateMutability?: (node: StateMutability) => any;
Block?: (node: Block) => any;
Statement?: (node: Statement) => any;
ExpressionStatement?: (node: ExpressionStatement) => any;
IfStatement?: (node: IfStatement) => any;
WhileStatement?: (node: WhileStatement) => any;
SimpleStatement?: (node: SimpleStatement) => any;
ForStatement?: (node: ForStatement) => any;
InlineAssemblyStatement?: (node: InlineAssemblyStatement) => any;
DoWhileStatement?: (node: DoWhileStatement) => any;
ContinueStatement?: (node: ContinueStatement) => any;
BreakStatement?: (node: BreakStatement) => any;
ReturnStatement?: (node: ReturnStatement) => any;
ThrowStatement?: (node: ThrowStatement) => any;
VariableDeclarationStatement?: (node: VariableDeclarationStatement) => any;
IdentifierList?: (node: IdentifierList) => any;
ElementaryTypeName?: (node: ElementaryTypeName) => any;
Expression?: (node: Expression) => any;
PrimaryExpression?: (node: PrimaryExpression) => any;
ExpressionList?: (node: ExpressionList) => any;
NameValueList?: (node: NameValueList) => any;
NameValue?: (node: NameValue) => any;
FunctionCallArguments?: (node: FunctionCallArguments) => any;
AssemblyBlock?: (node: AssemblyBlock) => any;
AssemblyItem?: (node: AssemblyItem) => any;
AssemblyExpression?: (node: AssemblyExpression) => any;
AssemblyCall?: (node: AssemblyCall) => any;
AssemblyLocalDefinition?: (node: AssemblyLocalDefinition) => any;
AssemblyAssignment?: (node: AssemblyAssignment) => any;
AssemblyIdentifierOrList?: (node: AssemblyIdentifierOrList) => any;
AssemblyIdentifierList?: (node: AssemblyIdentifierList) => any;
AssemblyStackAssignment?: (node: AssemblyStackAssignment) => any;
LabelDefinition?: (node: LabelDefinition) => any;
AssemblySwitch?: (node: AssemblySwitch) => any;
AssemblyCase?: (node: AssemblyCase) => any;
AssemblyFunctionDefinition?: (node: AssemblyFunctionDefinition) => any;
AssemblyFunctionReturns?: (node: AssemblyFunctionReturns) => any;
AssemblyFor?: (node: AssemblyFor) => any;
AssemblyIf?: (node: AssemblyIf) => any;
AssemblyLiteral?: (node: AssemblyLiteral) => any;
SubAssembly?: (node: SubAssembly) => any;
TupleExpression?: (node: TupleExpression) => any;
ElementaryTypeNameExpression?: (node: ElementaryTypeNameExpression) => any;
NumberLiteral?: (node: NumberLiteral) => any;
Identifier?: (node: Identifier) => any;
BinaryOperation?: (node: BinaryOperation) => any;
Conditional?: (node: Conditional) => any;
}
export interface ParserOpts {
tolerant?: boolean;