8000 Ending scope stack as a list of ints · github/semantic@dbc5d99 · GitHub
[go: up one dir, main page]

Skip to content
8000
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit dbc5d99

Browse files
committed
Ending scope stack as a list of ints
1 parent a09b34d commit dbc5d99

File tree

2 files changed

+56
-34
lines changed

2 files changed

+56
-34
lines changed

proto/semantic.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ message StackGraphPath {
202202
int64 from = 3;
203203
string edges = 4;
204204
int64 to = 5;
205-
repeated string ending_scope_stack = 6;
205+
repeated int64 ending_scope_stack = 6;
206206
repeated string ending_symbol_stack = 7;
207207
}

src/Proto/Semantic.hs

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5469,8 +5469,8 @@ instance Control.DeepSeq.NFData StackGraphNode where
54695469
* 'Proto.Semantic_Fields.from' @:: Lens' StackGraphPath Data.Int.Int64@
54705470
* 'Proto.Semantic_Fields.edges' @:: Lens' StackGraphPath Data.Text.Text@
54715471
* 'Proto.Semantic_Fields.to' @:: Lens' StackGraphPath Data.Int.Int64@
5472-
* 'Proto.Semantic_Fields.endingScopeStack' @:: Lens' StackGraphPath [Data.Text.Text]@
5473-
* 'Proto.Semantic_Fields.vec'endingScopeStack' @:: Lens' StackGraphPath (Data.Vector.Vector Data.Text.Text)@
5472+
* 'Proto.Semantic_Fields.endingScopeStack' @:: Lens' StackGraphPath [Data.Int.Int64]@
5473+
* 'Proto.Semantic_Fields.vec'endingScopeStack' @:: Lens' StackGraphPath (Data.Vector.Unboxed.Vector Data.Int.Int64)@
54745474
* 'Proto.Semantic_Fields.endingSymbolStack' @:: Lens' StackGraphPath [Data.Text.Text]@
54755475
* 'Proto.Semantic_Fields.vec'endingSymbolStack' @:: Lens' StackGraphPath (Data.Vector.Vector Data.Text.Text)@ -}
54765476
data StackGraphPath
@@ -5479,7 +5479,7 @@ data StackGraphPath
54795479
_StackGraphPath'from :: !Data.Int.Int64,
54805480
_StackGraphPath'edges :: !Data.Text.Text,
54815481
_StackGraphPath'to :: !Data.Int.Int64,
5482-
_StackGraphPath'endingScopeStack :: !(Data.Vector.Vector Data.Text.Text),
5482+
_StackGraphPath'endingScopeStack :: !(Data.Vector.Unboxed.Vector Data.Int.Int64),
54835483
_StackGraphPath'endingSymbolStack :: !(Data.Vector.Vector Data.Text.Text),
54845484
_StackGraphPath'_unknownFields :: !Data.ProtoLens.FieldSet}
54855485
deriving (Prelude.Eq, Prelude.Ord)
@@ -5532,7 +5532,7 @@ instance Data.ProtoLens.Field.HasField StackGraphPath "to" Data.Int.Int64 where
55325532
(Lens.Family2.Unchecked.lens
55335533
_StackGraphPath'to (\ x__ y__ -> x__ {_StackGraphPath'to = y__}))
55345534
Prelude.id
5535-
instance Data.ProtoLens.Field.HasField StackGraphPath "endingScopeStack" [Data.Text.Text] where
5535+
instance Data.ProtoLens.Field.HasField StackGraphPath "endingScopeStack" [Data.Int.Int64] where
55365536
fieldOf _
55375537
= (Prelude..)
55385538
(Lens.Family2.Unchecked.lens
@@ -5541,7 +5541,7 @@ instance Data.ProtoLens.Field.HasField StackGraphPath "endingScopeStack" [Data.T
55415541
(Lens.Family2.Unchecked.lens
55425542
Data.Vector.Generic.toList
55435543
(\ _ y__ -> Data.Vector.Generic.fromList y__))
5544-
instance Data.ProtoLens.Field.HasField StackGraphPath "vec'endingScopeStack" (Data.Vector.Vector Data.Text.Text) where
5544+
instance Data.ProtoLens.Field.HasField StackGraphPath "vec'endingScopeStack" (Data.Vector.Unboxed.Vector Data.Int.Int64) where
55455545
fieldOf _
55465546
= (Prelude..)
55475547
(Lens.Family2.Unchecked.lens
@@ -5613,10 +5613,10 @@ instance Data.ProtoLens.Message StackGraphPath where
56135613
endingScopeStack__field_descriptor
56145614
= Data.ProtoLens.FieldDescriptor
56155615
"ending_scope_stack"
5616-
(Data.ProtoLens.ScalarField Data.ProtoLens.StringField ::
5617-
Data.ProtoLens.FieldTypeDescriptor Data.Text.Text)
5616+
(Data.ProtoLens.ScalarField Data.ProtoLens.Int64Field ::
5617+
Data.ProtoLens.FieldTypeDescriptor Data.Int.Int64)
56185618
(Data.ProtoLens.RepeatedField
5619-
Data.ProtoLens.Unpacked
5619+
Data.ProtoLens.Packed
56205620
(Data.ProtoLens.Field.field @"endingScopeStack")) ::
56215621
Data.ProtoLens.FieldDescriptor StackGraphPath
56225622
endingSymbolStack__field_descriptor
@@ -5655,7 +5655,7 @@ instance Data.ProtoLens.Message StackGraphPath where
56555655
= let
56565656
loop ::
56575657
StackGraphPath
5658-
-> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector Data.ProtoLens.Encoding.Growing.RealWorld Data.Text.Text
5658+
-> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Unboxed.Vector Data.ProtoLens.Encoding.Growing.RealWorld Data.Int.Int64
56595659
-> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector Data.ProtoLens.Encoding.Growing.RealWorld Data.Text.Text
56605660
-> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector Data.ProtoLens.Encoding.Growing.RealWorld Data.Text.Text
56615661
-> Data.ProtoLens.Encoding.Bytes.Parser StackGraphPath
@@ -5766,21 +5766,38 @@ instance Data.ProtoLens.Message StackGraphPath where
57665766
mutable'endingScopeStack
57675767
mutable'endingSymbolStack
57685768
mutable'startingSymbolStack
5769-
50
5769+
48
57705770
-> do !y <- (Data.ProtoLens.Encoding.Bytes.<?>)
5771-
(do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt
5772-
Data.ProtoLens.Encoding.Bytes.getBytes
5773-
(Prelude.fromIntegral len)
5774-
Data.ProtoLens.Encoding.Bytes.runEither
5775-
(case Data.Text.Encoding.decodeUtf8' value of
5776-
(Prelude.Left err)
5777-
-> Prelude.Left (Prelude.show err)
5778-
(Prelude.Right r) -> Prelude.Right r))
5771+
(Prelude.fmap
5772+
Prelude.fromIntegral
5773+
Data.ProtoLens.Encoding.Bytes.getVarInt)
57795774
"ending_scope_stack"
57805775
v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
57815776
(Data.ProtoLens.Encoding.Growing.append
57825777
mutable'endingScopeStack y)
57835778
loop x v mutable'endingSymbolStack mutable'startingSymbolStack
5779+
50
5780+
-> do y <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt
5781+
Data.ProtoLens.Encoding.Bytes.isolate
5782+
(Prelude.fromIntegral len)
5783+
((let
5784+
ploop qs
5785+
= do packedEnd <- Data.ProtoLens.Encoding.Bytes.atEnd
5786+
if packedEnd then
5787+
Prelude.return qs
5788+
else
5789+
do !q <- (Data.ProtoLens.Encoding.Bytes.<?>)
5790+
(Prelude.fmap
5791+
Prelude.fromIntegral
5792+
Data.ProtoLens.Encoding.Bytes.getVarInt)
5793+
"ending_scope_stack"
5794+
qs' <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
5795+
(Data.ProtoLens.Encoding.Growing.append
5796+
qs q)
5797+
ploop qs'
5798+
in ploop)
5799+
mutable'endingScopeStack)
5800+
loop x y mutable'endingSymbolStack mutable'startingSymbolStack
57845801
58
57855802
-> do !y <- (Data.ProtoLens.Encoding.Bytes.<?>)
57865803
(do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt
@@ -5889,21 +5906,26 @@ instance Data.ProtoLens.Message StackGraphPath where
58895906
Prelude.fromIntegral
58905907
_v))
58915908
((Data.Monoid.<>)
5892-
(Data.ProtoLens.Encoding.Bytes.foldMapBuilder
5893-
(\ _v
5894-
-> (Data.Monoid.<>)
5895-
(Data.ProtoLens.Encoding.Bytes.putVarInt 50)
5896-
((Prelude..)
5897-
(\ bs
5898-
-> (Data.Monoid.<>)
5899-
(Data.ProtoLens.Encoding.Bytes.putVarInt
5900-
(Prelude.fromIntegral
5901-
(Data.ByteString.length bs)))
5902-
(Data.ProtoLens.Encoding.Bytes.putBytes bs))
5903-
Data.Text.Encoding.encodeUtf8
5904-
_v))
5905-
(Lens.Family2.view
5906-
(Data.ProtoLens.Field.field @"vec'endingScopeStack") _x))
5909+
(let
5910+
p = Lens.Family2.view
5911+
(Data.ProtoLens.Field.field @"vec'endingScopeStack") _x
5912+
in
5913+
if Data.Vector.Generic.null p then
5914+
Data.Monoid.mempty
5915+
else
5916+
(Data.Monoid.<>)
5917+
(Data.ProtoLens.Encoding.Bytes.putVarInt 50)
5918+
((\ bs
5919+
-> (Data.Monoid.<>)
5920+
(Data.ProtoLens.Encoding.Bytes.putVarInt
5921+
(Prelude.fromIntegral (Data.ByteString.length bs)))
5922+
(Data.ProtoLens.Encoding.Bytes.putBytes bs))
5923+
(Data.ProtoLens.Encoding.Bytes.runBuilder
5924+
(Data.ProtoLens.Encoding.Bytes.foldMapBuilder
5925+
((Prelude..)
5926+
Data.ProtoLens.Encoding.Bytes.putVarInt
5927+
Prelude.fromIntegral)
5928+
p))))
59075929
((Data.Monoid.<>)
59085930
(Data.ProtoLens.Encoding.Bytes.foldMapBuilder
59095931
(\ _v

0 commit comments

Comments
 (0)
0