Skip to content

Commit

Permalink
New ast types for user defined, including state variable fixes for in…
Browse files Browse the repository at this point in the history
…itial value
  • Loading branch information
0x19 committed Oct 18, 2023
1 parent 34a3f0c commit 1d7a45e
Show file tree
Hide file tree
Showing 14 changed files with 1,275 additions and 70 deletions.
2 changes: 2 additions & 0 deletions ast/state_variable.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package unpack.v1.ast;
import "ast/types.proto";
import "ast/src.proto";
import "ast/type_name.proto";
import "xds/type/v3/typed_struct.proto";

message StateVariable {
int64 id = 1;
Expand All @@ -19,4 +20,5 @@ message StateVariable {
unpack.v1.ast.Mutability state_mutability = 10;
unpack.v1.ast.TypeName type_name = 11;
unpack.v1.ast.TypeDescription type_description = 12;
xds.type.v3.TypedStruct initial_value = 13;
}
1 change: 1 addition & 0 deletions ast/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ enum NodeType {
YUL_VARIABLE_DECLARATION = 122;
YUL_EXPRESSION = 123;
HEX_NUMBER = 124;
USER_DEFINED_VALUE_TYPE = 125;
}

enum Mutability {
Expand Down
21 changes: 21 additions & 0 deletions ast/user_defined.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";
package unpack.v1.ast;
option go_package = "github.com/unpackdev/protos/dist/go/ast;ast_pb";

import "ast/types.proto";
import "ast/src.proto";
import "ast/type_name.proto";

message UserDefinedValueTypeDefinition {
int64 id = 1;
unpack.v1.ast.NodeType node_type = 2;
unpack.v1.ast.Src src = 3;
bool is = 4;
string type = 5;
unpack.v1.ast.Src type_location = 6;
string name = 7;
unpack.v1.ast.Src name_location = 8;
unpack.v1.ast.TypeName type_name = 9;
int64 referenced_declaration = 10;
unpack.v1.ast.TypeDescription type_description = 11;
}
175 changes: 175 additions & 0 deletions dist/docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10496,6 +10496,18 @@
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "initial_value",
"description": "",
"label": "",
"type": "TypedStruct",
"longType": "xds.type.v3.TypedStruct",
"fullType": "xds.type.v3.TypedStruct",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
}
]
}
Expand Down Expand Up @@ -12502,6 +12514,11 @@
"name": "HEX_NUMBER",
"number": "124",
"description": ""
},
{
"name": "USER_DEFINED_VALUE_TYPE",
"number": "125",
"description": ""
}
]
},
Expand Down Expand Up @@ -13118,6 +13135,164 @@
],
"services": []
},
{
"name": "ast/user_defined.proto",
"description": "",
"package": "unpack.v1.ast",
"hasEnums": false,
"hasExtensions": false,
"hasMessages": true,
"hasServices": false,
"enums": [],
"extensions": [],
"messages": [
{
"name": "UserDefinedValueTypeDefinition",
"longName": "UserDefinedValueTypeDefinition",
"fullName": "unpack.v1.ast.UserDefinedValueTypeDefinition",
"description": "",
"hasExtensions": false,
"hasFields": true,
"hasOneofs": false,
"extensions": [],
"fields": [
{
"name": "id",
"description": "",
"label": "",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "node_type",
"description": "",
"label": "",
"type": "NodeType",
"longType": "NodeType",
"fullType": "unpack.v1.ast.NodeType",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "src",
"description": "",
"label": "",
"type": "Src",
"longType": "Src",
"fullType": "unpack.v1.ast.Src",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "is",
"description": "",
"label": "",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "type",
"description": "",
"label": "",
"type": "string",
"longType": "string",
"fullType": "string",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "type_location",
"description": "",
"label": "",
"type": "Src",
"longType": "Src",
"fullType": "unpack.v1.ast.Src",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "name",
"description": "",
"label": "",
"type": "string",
"longType": "string",
"fullType": "string",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "name_location",
"description": "",
"label": "",
"type": "Src",
"longType": "Src",
"fullType": "unpack.v1.ast.Src",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "type_name",
"description": "",
"label": "",
"type": "TypeName",
"longType": "TypeName",
"fullType": "unpack.v1.ast.TypeName",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "referenced_declaration",
"description": "",
"label": "",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "type_description",
"description": "",
"label": "",
"type": "TypeDescription",
"longType": "TypeDescription",
"fullType": "unpack.v1.ast.TypeDescription",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
}
]
}
],
"services": []
},
{
"name": "ast/using.proto",
"description": "",
Expand Down
37 changes: 27 additions & 10 deletions dist/go/ast/state_variable.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1d7a45e

Please sign in to comment.