Skip to content

Commit 1d7a45e

Browse files
committed
New ast types for user defined, including state variable fixes for initial value
1 parent 34a3f0c commit 1d7a45e

14 files changed

+1275
-70
lines changed

ast/state_variable.proto

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package unpack.v1.ast;
55
import "ast/types.proto";
66
import "ast/src.proto";
77
import "ast/type_name.proto";
8+
import "xds/type/v3/typed_struct.proto";
89

910
message StateVariable {
1011
int64 id = 1;
@@ -19,4 +20,5 @@ message StateVariable {
1920
unpack.v1.ast.Mutability state_mutability = 10;
2021
unpack.v1.ast.TypeName type_name = 11;
2122
unpack.v1.ast.TypeDescription type_description = 12;
23+
xds.type.v3.TypedStruct initial_value = 13;
2224
}

ast/types.proto

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ enum NodeType {
128128
YUL_VARIABLE_DECLARATION = 122;
129129
YUL_EXPRESSION = 123;
130130
HEX_NUMBER = 124;
131+
USER_DEFINED_VALUE_TYPE = 125;
131132
}
132133

133134
enum Mutability {

ast/user_defined.proto

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
syntax = "proto3";
2+
package unpack.v1.ast;
3+
option go_package = "github.com/unpackdev/protos/dist/go/ast;ast_pb";
4+
5+
import "ast/types.proto";
6+
import "ast/src.proto";
7+
import "ast/type_name.proto";
8+
9+
message UserDefinedValueTypeDefinition {
10+
int64 id = 1;
11+
unpack.v1.ast.NodeType node_type = 2;
12+
unpack.v1.ast.Src src = 3;
13+
bool is = 4;
14+
string type = 5;
15+
unpack.v1.ast.Src type_location = 6;
16+
string name = 7;
17+
unpack.v1.ast.Src name_location = 8;
18+
unpack.v1.ast.TypeName type_name = 9;
19+
int64 referenced_declaration = 10;
20+
unpack.v1.ast.TypeDescription type_description = 11;
21+
}

dist/docs/docs.json

+175
Original file line numberDiff line numberDiff line change
@@ -10496,6 +10496,18 @@
1049610496
"isoneof": false,
1049710497
"oneofdecl": "",
1049810498
"defaultValue": ""
10499+
},
10500+
{
10501+
"name": "initial_value",
10502+
"description": "",
10503+
"label": "",
10504+
"type": "TypedStruct",
10505+
"longType": "xds.type.v3.TypedStruct",
10506+
"fullType": "xds.type.v3.TypedStruct",
10507+
"ismap": false,
10508+
"isoneof": false,
10509+
"oneofdecl": "",
10510+
"defaultValue": ""
1049910511
}
1050010512
]
1050110513
}
@@ -12502,6 +12514,11 @@
1250212514
"name": "HEX_NUMBER",
1250312515
"number": "124",
1250412516
"description": ""
12517+
},
12518+
{
12519+
"name": "USER_DEFINED_VALUE_TYPE",
12520+
"number": "125",
12521+
"description": ""
1250512522
}
1250612523
]
1250712524
},
@@ -13118,6 +13135,164 @@
1311813135
],
1311913136
"services": []
1312013137
},
13138+
{
13139+
"name": "ast/user_defined.proto",
13140+
"description": "",
13141+
"package": "unpack.v1.ast",
13142+
"hasEnums": false,
13143+
"hasExtensions": false,
13144+
"hasMessages": true,
13145+
"hasServices": false,
13146+
"enums": [],
13147+
"extensions": [],
13148+
"messages": [
13149+
{
13150+
"name": "UserDefinedValueTypeDefinition",
13151+
"longName": "UserDefinedValueTypeDefinition",
13152+
"fullName": "unpack.v1.ast.UserDefinedValueTypeDefinition",
13153+
"description": "",
13154+
"hasExtensions": false,
13155+
"hasFields": true,
13156+
"hasOneofs": false,
13157+
"extensions": [],
13158+
"fields": [
13159+
{
13160+
"name": "id",
13161+
"description": "",
13162+
"label": "",
13163+
"type": "int64",
13164+
"longType": "int64",
13165+
"fullType": "int64",
13166+
"ismap": false,
13167+
"isoneof": false,
13168+
"oneofdecl": "",
13169+
"defaultValue": ""
13170+
},
13171+
{
13172+
"name": "node_type",
13173+
"description": "",
13174+
"label": "",
13175+
"type": "NodeType",
13176+
"longType": "NodeType",
13177+
"fullType": "unpack.v1.ast.NodeType",
13178+
"ismap": false,
13179+
"isoneof": false,
13180+
"oneofdecl": "",
13181+
"defaultValue": ""
13182+
},
13183+
{
13184+
"name": "src",
13185+
"description": "",
13186+
"label": "",
13187+
"type": "Src",
13188+
"longType": "Src",
13189+
"fullType": "unpack.v1.ast.Src",
13190+
"ismap": false,
13191+
"isoneof": false,
13192+
"oneofdecl": "",
13193+
"defaultValue": ""
13194+
},
13195+
{
13196+
"name": "is",
13197+
"description": "",
13198+
"label": "",
13199+
"type": "bool",
13200+
"longType": "bool",
13201+
"fullType": "bool",
13202+
"ismap": false,
13203+
"isoneof": false,
13204+
"oneofdecl": "",
13205+
"defaultValue": ""
13206+
},
13207+
{
13208+
"name": "type",
13209+
"description": "",
13210+
"label": "",
13211+
"type": "string",
13212+
"longType": "string",
13213+
"fullType": "string",
13214+
"ismap": false,
13215+
"isoneof": false,
13216+
"oneofdecl": "",
13217+
"defaultValue": ""
13218+
},
13219+
{
13220+
"name": "type_location",
13221+
"description": "",
13222+
"label": "",
13223+
"type": "Src",
13224+
"longType": "Src",
13225+
"fullType": "unpack.v1.ast.Src",
13226+
"ismap": false,
13227+
"isoneof": false,
13228+
"oneofdecl": "",
13229+
"defaultValue": ""
13230+
},
13231+
{
13232+
"name": "name",
13233+
"description": "",
13234+
"label": "",
13235+
"type": "string",
13236+
"longType": "string",
13237+
"fullType": "string",
13238+
"ismap": false,
13239+
"isoneof": false,
13240+
"oneofdecl": "",
13241+
"defaultValue": ""
13242+
},
13243+
{
13244+
"name": "name_location",
13245+
"description": "",
13246+
"label": "",
13247+
"type": "Src",
13248+
"longType": "Src",
13249+
"fullType": "unpack.v1.ast.Src",
13250+
"ismap": false,
13251+
"isoneof": false,
13252+
"oneofdecl": "",
13253+
"defaultValue": ""
13254+
},
13255+
{
13256+
"name": "type_name",
13257+
"description": "",
13258+
"label": "",
13259+
"type": "TypeName",
13260+
"longType": "TypeName",
13261+
"fullType": "unpack.v1.ast.TypeName",
13262+
"ismap": false,
13263+
"isoneof": false,
13264+
"oneofdecl": "",
13265+
"defaultValue": ""
13266+
},
13267+
{
13268+
"name": "referenced_declaration",
13269+
"description": "",
13270+
"label": "",
13271+
"type": "int64",
13272+
"longType": "int64",
13273+
"fullType": "int64",
13274+
"ismap": false,
13275+
"isoneof": false,
13276+
"oneofdecl": "",
13277+
"defaultValue": ""
13278+
},
13279+
{
13280+
"name": "type_description",
13281+
"description": "",
13282+
"label": "",
13283+
"type": "TypeDescription",
13284+
"longType": "TypeDescription",
13285+
"fullType": "unpack.v1.ast.TypeDescription",
13286+
"ismap": false,
13287+
"isoneof": false,
13288+
"oneofdecl": "",
13289+
"defaultValue": ""
13290+
}
13291+
]
13292+
}
13293+
],
13294+
"services": []
13295+
},
1312113296
{
1312213297
"name": "ast/using.proto",
1312313298
"description": "",

dist/go/ast/state_variable.pb.go

+27-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)