types improved

pull/5370/head
aniket-engg 5 years ago committed by Aniket
parent c398a6db25
commit d93e039d79
  1. 70
      remix-analyzer/src/types.ts

@ -41,9 +41,15 @@ export interface CompilationResult {
} }
} }
///////////////////////////////////////////// /////////////////////////////////////////////////////////////
///////////// Specfic AST Nodes ///////////// ///////////// Specfic AST Nodes /////////////////////////////
///////////////////////////////////////////// ///////////// (ToDo: YUL ones need to be added) /////////////
/////////////////////////////////////////////////////////////
interface TypeDescription {
typeIdentifier: string
typeString: string
}
export interface SourceUnitAstNode { export interface SourceUnitAstNode {
id: number id: number
@ -79,11 +85,11 @@ export interface ContractDefinitionAstNode {
name: string name: string
documentation: object | null documentation: object | null
contractKind: 'interface' | 'contract' | 'library' contractKind: 'interface' | 'contract' | 'library'
abstract: string abstract: boolean
fullyImplemented: object fullyImplemented: boolean
linearizedBaseContracts: object linearizedBaseContracts: Array<number>
baseContracts: object baseContracts: Array<any>
contractDependencies: object contractDependencies: Array<any>
nodes: Array<AstNode> nodes: Array<AstNode>
scope: number scope: number
} }
@ -135,7 +141,7 @@ export interface ParameterListAstNode {
id: number id: number
nodeType: 'ParameterList' nodeType: 'ParameterList'
src: string src: string
parameters: object parameters: Array<any>
} }
export interface OverrideSpecifierAstNode { export interface OverrideSpecifierAstNode {
@ -152,13 +158,13 @@ export interface FunctionDefinitionAstNode {
name: string name: string
documentation: object | null documentation: object | null
kind: string kind: string
stateMutability: string stateMutability: 'pure' | 'view' | 'nonpayable' | 'payable'
visibility: string visibility: string
virtual: boolean virtual: boolean
overrides: object | null overrides: object | null
parameters: object parameters: ParameterListAstNode
returnParameters: object returnParameters: ParameterListAstNode
modifiers: object modifiers: Array<any>
body: object | null body: object | null
implemented: boolean implemented: boolean
scope: number scope: number
@ -177,9 +183,9 @@ export interface VariableDeclarationAstNode {
storageLocation: 'storage' | 'memory' | 'calldata' | 'default' storageLocation: 'storage' | 'memory' | 'calldata' | 'default'
overrides: object | null overrides: object | null
visibility: string visibility: string
value: object | null value: string | null
scope: number scope: number
typeDescriptions: object typeDescriptions: TypeDescription
functionSelector?: string functionSelector?: string
indexed?: boolean indexed?: boolean
baseFunctions?: object baseFunctions?: object
@ -222,7 +228,7 @@ export interface ElementaryTypeNameAstNode {
nodeType: 'ElementaryTypeName' nodeType: 'ElementaryTypeName'
src: string src: string
name: string name: string
typeDescriptions: object typeDescriptions: TypeDescription
stateMutability?: string stateMutability?: string
} }
@ -263,7 +269,7 @@ export interface ArrayTypeNameAstNode {
src: string src: string
baseType: object baseType: object
length: object length: object
typeDescriptions: object typeDescriptions: TypeDescription
} }
export interface InlineAssemblyAstNode { export interface InlineAssemblyAstNode {
@ -271,7 +277,7 @@ export interface InlineAssemblyAstNode {
nodeType: 'InlineAssembly' nodeType: 'InlineAssembly'
src: string src: string
AST: object AST: object
externalReferences: object externalReferences: Array<any>
evmVersion: string evmVersion: string
} }
@ -279,7 +285,7 @@ export interface BlockAstNode {
id: number id: number
nodeType: 'Block' nodeType: 'Block'
src: string src: string
statements: object statements: Array<any>
} }
export interface PlaceholderStatementAstNode { export interface PlaceholderStatementAstNode {
@ -349,7 +355,7 @@ export interface ReturnAstNode {
nodeType: 'Return' nodeType: 'Return'
src: string src: string
expression: object expression: object
functionReturnParameters: object functionReturnParameters: number
} }
export interface ThrowAstNode { export interface ThrowAstNode {
@ -369,8 +375,8 @@ export interface VariableDeclarationStatementAstNode {
id: number id: number
nodeType: 'VariableDeclarationStatement' nodeType: 'VariableDeclarationStatement'
src: string src: string
assignments: object assignments: Array<number>
declarations: object declarations: Array<any>
initialValue: object initialValue: object
} }
@ -382,12 +388,12 @@ export interface ExpressionStatementAstNode {
} }
interface ExpressionAttributes { interface ExpressionAttributes {
typeDescriptions: object typeDescriptions: TypeDescription
isConstant: boolean isConstant: boolean
isPure: boolean isPure: boolean
isLValue: boolean isLValue: boolean
lValueRequested: boolean lValueRequested: boolean
argumentTypes: object argumentTypes: object | null
} }
export interface ConditionalAstNode extends ExpressionAttributes { export interface ConditionalAstNode extends ExpressionAttributes {
@ -413,7 +419,7 @@ export interface TupleExpressionAstNode extends ExpressionAttributes {
nodeType: 'TupleExpression' nodeType: 'TupleExpression'
src: string src: string
isInlineArray: boolean isInlineArray: boolean
components: object components: Array<any>
} }
export interface UnaryOperationAstNode extends ExpressionAttributes { export interface UnaryOperationAstNode extends ExpressionAttributes {
@ -430,9 +436,9 @@ export interface BinaryOperationAstNode extends ExpressionAttributes {
nodeType: 'BinaryOperation' nodeType: 'BinaryOperation'
src: string src: string
operator: string operator: string
leftExpression: object leftExpression: LiteralAstNode
rightExpression: object rightExpression: LiteralAstNode
commonType: object commonType: TypeDescription
} }
export interface FunctionCallAstNode extends ExpressionAttributes { export interface FunctionCallAstNode extends ExpressionAttributes {
@ -510,10 +516,10 @@ export interface IdentifierAstNode {
nodeType: 'Identifier' nodeType: 'Identifier'
src: string src: string
name: string name: string
referencedDeclaration: object referencedDeclaration: number
overloadedDeclarations: object overloadedDeclarations: Array<any>
typeDescriptions: object typeDescriptions: TypeDescription
argumentTypes: object argumentTypes: object | null
} }
export interface StructuredDocumentationAstNode { export interface StructuredDocumentationAstNode {

Loading…
Cancel
Save