Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-ld-prime
Commits
2b1aabc2
Commit
2b1aabc2
authored
Jul 30, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'moar-codegen'
parents
ac99bd4d
1dfcc6db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
node/gendemo/tMsg3.go
node/gendemo/tMsg3.go
+3
-0
schema/gen/go/genStruct.go
schema/gen/go/genStruct.go
+7
-2
No files found.
node/gendemo/tMsg3.go
View file @
2b1aabc2
...
...
@@ -361,6 +361,7 @@ func (ma *_Msg3__Assembler) AssembleEntry(k string) (ipld.NodeAssembler, error)
}
ma
.
s
+=
fieldBit__Msg3_Whee
ma
.
state
=
maState_midValue
ma
.
f
=
0
ma
.
ca_whee
.
w
=
&
ma
.
w
.
whee
ma
.
ca_whee
.
m
=
&
ma
.
cm
return
&
ma
.
ca_whee
,
nil
...
...
@@ -370,6 +371,7 @@ func (ma *_Msg3__Assembler) AssembleEntry(k string) (ipld.NodeAssembler, error)
}
ma
.
s
+=
fieldBit__Msg3_Woot
ma
.
state
=
maState_midValue
ma
.
f
=
1
ma
.
ca_woot
.
w
=
&
ma
.
w
.
woot
ma
.
ca_woot
.
m
=
&
ma
.
cm
return
&
ma
.
ca_woot
,
nil
...
...
@@ -379,6 +381,7 @@ func (ma *_Msg3__Assembler) AssembleEntry(k string) (ipld.NodeAssembler, error)
}
ma
.
s
+=
fieldBit__Msg3_Waga
ma
.
state
=
maState_midValue
ma
.
f
=
2
ma
.
ca_waga
.
w
=
&
ma
.
w
.
waga
ma
.
ca_waga
.
m
=
&
ma
.
cm
return
&
ma
.
ca_waga
,
nil
...
...
schema/gen/go/genStruct.go
View file @
2b1aabc2
...
...
@@ -424,10 +424,13 @@ func (g structBuilderGenerator) emitMapAssemblerMethods(w io.Writer) {
}
ma.s += fieldBit__{{ $type | TypeSymbol }}_{{ $field | FieldSymbolUpper }}
ma.state = maState_midValue
ma.f = {{ $i }}
{{- if $field.IsMaybe }}
ma.ca_{{ $field | FieldSymbolLower }}.w = {{if not (MaybeUsesPtr $field.Type) }}&{{end}}ma.w.{{ $field | FieldSymbolLower }}.v
ma.ca_{{ $field | FieldSymbolLower }}.m = &ma.w.{{ $field | FieldSymbolLower }}.m
{{if $field.IsNullable }}ma.w.{{ $field | FieldSymbolLower }}.m = allowNull{{end}}
{{- if $field.IsNullable }}
ma.w.{{ $field | FieldSymbolLower }}.m = allowNull
{{- end}}
{{- else}}
ma.ca_{{ $field | FieldSymbolLower }}.w = &ma.w.{{ $field | FieldSymbolLower }}
ma.ca_{{ $field | FieldSymbolLower }}.m = &ma.cm
...
...
@@ -476,7 +479,9 @@ func (g structBuilderGenerator) emitMapAssemblerMethods(w io.Writer) {
{{- if $field.IsMaybe }}
ma.ca_{{ $field | FieldSymbolLower }}.w = {{if not (MaybeUsesPtr $field.Type) }}&{{end}}ma.w.{{ $field | FieldSymbolLower }}.v
ma.ca_{{ $field | FieldSymbolLower }}.m = &ma.w.{{ $field | FieldSymbolLower }}.m
{{if $field.IsNullable }}ma.w.{{ $field | FieldSymbolLower }}.m = allowNull{{end}}
{{- if $field.IsNullable }}
ma.w.{{ $field | FieldSymbolLower }}.m = allowNull
{{- end}}
{{- else}}
ma.ca_{{ $field | FieldSymbolLower }}.w = &ma.w.{{ $field | FieldSymbolLower }}
ma.ca_{{ $field | FieldSymbolLower }}.m = &ma.cm
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment