remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-astwalker/tests/resources/newAST.ts

313 lines
9.1 KiB

import { Node } from '../../src/'
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const node: Node = {
"ast":
{
"absolutePath": "greeter.sol",
"exportedSymbols": {
"Greeter": [
25
]
},
"id": 26,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.5",
".0",
"<",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:31:0"
},
{
"absolutePath": "mortal.sol",
"file": "mortal.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 26,
"sourceUnit": 53,
"src": "32:20:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 3,
"name": "Mortal",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 52,
"src": "74:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Mortal_$52",
"typeString": "contract Mortal"
}
},
"id": 4,
"nodeType": "InheritanceSpecifier",
"src": "74:6:0"
}
],
"contractDependencies": [
52
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 25,
"linearizedBaseContracts": [
25,
52
],
"name": "Greeter",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 6,
"name": "greeting",
"nodeType": "VariableDeclaration",
"scope": 25,
"src": "141:15:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 5,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "141:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 15,
"nodeType": "Block",
"src": "257:37:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 11,
"name": "greeting",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "267:8:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 12,
"name": "_greeting",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "278:9:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "267:20:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 14,
"nodeType": "ExpressionStatement",
"src": "267:20:0"
}
]
},
"documentation": null,
"id": 16,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8,
"name": "_greeting",
"nodeType": "VariableDeclaration",
"scope": 16,
"src": "225:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 7,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "225:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "224:25:0"
},
"returnParameters": {
"id": 10,
"nodeType": "ParameterList",
"parameters": [],
"src": "257:0:0"
},
"scope": 25,
"src": "213:81:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 23,
"nodeType": "Block",
"src": "377:32:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 21,
"name": "greeting",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "394:8:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 20,
"id": 22,
"nodeType": "Return",
"src": "387:15:0"
}
]
},
"documentation": null,
"id": 24,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "greet",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [],
"src": "338:2:0"
},
"returnParameters": {
"id": 20,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 24,
"src": "362:13:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 18,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "362:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "361:15:0"
},
"scope": 25,
"src": "324:85:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 26,
"src": "54:357:0"
}
],
"src": "0:412:0"
}
}
node.source = `contract test {
int x;
int y;
function set(int _x) returns (int _r)
{
x = _x;
y = 10;
_r = x;
}
function get() returns (uint x, uint y)
{
}
}`
export default node;