-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from ConsenSys/support-solidity-088-089
Support for Solidity 0.8.8, 0.8.9 and 0.8.10
- Loading branch information
Showing
34 changed files
with
7,449 additions
and
3,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
"prepare": "npm run build" | ||
}, | ||
"dependencies": { | ||
"findup-sync": "^4.0.0", | ||
"findup-sync": "^5.0.0", | ||
"fs-extra": "^10.0.0", | ||
"jsel": "^1.1.6", | ||
"minimist": "^1.2.5", | ||
|
@@ -91,30 +91,33 @@ | |
"solc-0.8.5": "npm:[email protected]", | ||
"solc-0.8.6": "npm:[email protected]", | ||
"solc-0.8.7": "npm:[email protected]", | ||
"solc-0.8.8": "npm:[email protected]", | ||
"solc-0.8.9": "npm:[email protected]", | ||
"solc-0.8.10": "npm:[email protected]", | ||
"src-location": "^1.1.0", | ||
"web3-eth-abi": "^1.5.2" | ||
"web3-eth-abi": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@types/fs-extra": "^9.0.12", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/minimist": "^1.2.2", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^12.20.20", | ||
"@types/semver": "^7.3.8", | ||
"@typescript-eslint/eslint-plugin": "^4.29.2", | ||
"@typescript-eslint/parser": "^4.29.2", | ||
"@types/node": "^12.20.37", | ||
"@types/semver": "^7.3.9", | ||
"@typescript-eslint/eslint-plugin": "^5.3.1", | ||
"@typescript-eslint/parser": "^5.3.1", | ||
"codecov": "^3.8.3", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.2.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.1", | ||
"expect": "^27.0.6", | ||
"mocha": "^9.1.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"expect": "^27.3.1", | ||
"mocha": "^9.1.3", | ||
"nyc": "^15.1.0", | ||
"peggy": "^1.2.0", | ||
"prettier": "2.3.2", | ||
"ts-node": "^10.2.1", | ||
"ts-pegjs": "^1.1.1", | ||
"typedoc": "^0.21.6", | ||
"typescript": "^4.3.5" | ||
"prettier": "2.4.1", | ||
"ts-node": "^10.4.0", | ||
"ts-pegjs": "^1.2.1", | ||
"typedoc": "^0.22.8", | ||
"typescript": "^4.4.4" | ||
}, | ||
"homepage": "https://consensys.github.io/solc-typed-ast", | ||
"bugs": "https://github.com/ConsenSys/solc-typed-ast/issues", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/ast/implementation/declaration/user_defined_value_type_definition.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { ASTNode } from "../../ast_node"; | ||
import { SourceUnit } from "../meta/source_unit"; | ||
import { ElementaryTypeName } from "../type/elementary_type_name"; | ||
import { ContractDefinition } from "./contract_definition"; | ||
|
||
export class UserDefinedValueTypeDefinition extends ASTNode { | ||
/** | ||
* The name of the user-defined value type definition | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Canonical name (or qualified name), e.g. `DefiningContract.SomeType`. | ||
* Is `undefined` for Solidity 0.8.8. Available since Solidity 0.8.9. | ||
*/ | ||
canonicalName?: string; | ||
|
||
/** | ||
* The source range for name string | ||
*/ | ||
nameLocation?: string; | ||
|
||
/** | ||
* Aliased value type | ||
*/ | ||
underlyingType: ElementaryTypeName; | ||
|
||
constructor( | ||
id: number, | ||
src: string, | ||
type: string, | ||
name: string, | ||
canonicalName: string | undefined, | ||
underlyingType: ElementaryTypeName, | ||
nameLocation?: string, | ||
raw?: any | ||
) { | ||
super(id, src, type, raw); | ||
|
||
this.name = name; | ||
this.canonicalName = canonicalName; | ||
this.underlyingType = underlyingType; | ||
this.nameLocation = nameLocation; | ||
|
||
this.acceptChildren(); | ||
} | ||
|
||
get children(): readonly ASTNode[] { | ||
return this.pickNodes(this.underlyingType); | ||
} | ||
|
||
/** | ||
* Reference to its scoped contract or source unit | ||
*/ | ||
get vScope(): ContractDefinition | SourceUnit { | ||
return this.parent as ContractDefinition | SourceUnit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/ast/modern/user_defined_value_type_definition_processor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ASTReader, ASTReaderConfiguration } from "../ast_reader"; | ||
import { UserDefinedValueTypeDefinition } from "../implementation/declaration/user_defined_value_type_definition"; | ||
import { ElementaryTypeName } from "../implementation/type/elementary_type_name"; | ||
import { ModernNodeProcessor } from "./node_processor"; | ||
|
||
export class ModernUserDefinedValueTypeDefinitionProcessor extends ModernNodeProcessor<UserDefinedValueTypeDefinition> { | ||
process( | ||
reader: ASTReader, | ||
config: ASTReaderConfiguration, | ||
raw: any | ||
): ConstructorParameters<typeof UserDefinedValueTypeDefinition> { | ||
const [id, src, type] = super.process(reader, config, raw); | ||
|
||
const name: string = raw.name; | ||
const canonicalName: string = raw.canonicalName; | ||
const nameLocation: string | undefined = raw.nameLocation; | ||
const underlyingType = reader.convert(raw.underlyingType, config) as ElementaryTypeName; | ||
|
||
return [id, src, type, name, canonicalName, underlyingType, nameLocation, raw]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.