Skip to content

Commit 62bff35

Browse files
committed
Update gold
1 parent 963804b commit 62bff35

File tree

13 files changed

+591
-591
lines changed

13 files changed

+591
-591
lines changed

testdata/examples/append_log/append_log.gold.v

+30-30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Require Export New.code.github_com.goose_lang.primitive.disk.
44
Require Export New.code.github_com.tchajed.marshal.
55
Require Export New.code.sync.
66

7+
Definition append_log : go_string := "github.com/goose-lang/goose/testdata/examples/append_log".
8+
79
From New Require Import disk_prelude.
810
Module append_log.
911
Section code.
@@ -21,23 +23,21 @@ Definition Log__mkHdr : val :=
2123
exception_do (let: "log" := (ref_ty ptrT "log") in
2224
let: "enc" := (ref_ty marshal.Enc (zero_val marshal.Enc)) in
2325
let: "$r0" := (let: "$a0" := disk.BlockSize in
24-
(func_call #marshal.pkg_name' #"NewEnc"%go) "$a0") in
26+
(func_call #marshal #"NewEnc"%go) "$a0") in
2527
do: ("enc" <-[marshal.Enc] "$r0");;;
2628
do: (let: "$a0" := (![uint64T] (struct.field_ref Log "sz" (![ptrT] "log"))) in
27-
(method_call #marshal.pkg_name' #"Enc" #"PutInt" (![marshal.Enc] "enc")) "$a0");;;
29+
(method_call #marshal #"Enc" #"PutInt" (![marshal.Enc] "enc")) "$a0");;;
2830
do: (let: "$a0" := (![uint64T] (struct.field_ref Log "diskSz" (![ptrT] "log"))) in
29-
(method_call #marshal.pkg_name' #"Enc" #"PutInt" (![marshal.Enc] "enc")) "$a0");;;
30-
return: ((method_call #marshal.pkg_name' #"Enc" #"Finish" (![marshal.Enc] "enc")) #())).
31-
32-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/append_log".
31+
(method_call #marshal #"Enc" #"PutInt" (![marshal.Enc] "enc")) "$a0");;;
32+
return: ((method_call #marshal #"Enc" #"Finish" (![marshal.Enc] "enc")) #())).
3333

3434
(* go: append_log.go:29:17 *)
3535
Definition Log__writeHdr : val :=
3636
rec: "Log__writeHdr" "log" <> :=
3737
exception_do (let: "log" := (ref_ty ptrT "log") in
3838
do: (let: "$a0" := #(W64 0) in
39-
let: "$a1" := ((method_call #pkg_name' #"Log'ptr" #"mkHdr" (![ptrT] "log")) #()) in
40-
(func_call #disk.pkg_name' #"Write"%go) "$a0" "$a1")).
39+
let: "$a1" := ((method_call #append_log #"Log'ptr" #"mkHdr" (![ptrT] "log")) #()) in
40+
(func_call #disk #"Write"%go) "$a0" "$a1")).
4141

4242
(* go: append_log.go:33:6 *)
4343
Definition Init : val :=
@@ -64,25 +64,25 @@ Definition Init : val :=
6464
"diskSz" ::= "$diskSz"
6565
}])) in
6666
do: ("log" <-[ptrT] "$r0");;;
67-
do: ((method_call #pkg_name' #"Log'ptr" #"writeHdr" (![ptrT] "log")) #());;;
67+
do: ((method_call #append_log #"Log'ptr" #"writeHdr" (![ptrT] "log")) #());;;
6868
return: (![ptrT] "log", #true)).
6969

7070
(* go: append_log.go:42:6 *)
7171
Definition Open : val :=
7272
rec: "Open" <> :=
7373
exception_do (let: "hdr" := (ref_ty sliceT (zero_val sliceT)) in
7474
let: "$r0" := (let: "$a0" := #(W64 0) in
75-
(func_call #disk.pkg_name' #"Read"%go) "$a0") in
75+
(func_call #disk #"Read"%go) "$a0") in
7676
do: ("hdr" <-[sliceT] "$r0");;;
7777
let: "dec" := (ref_ty marshal.Dec (zero_val marshal.Dec)) in
7878
let: "$r0" := (let: "$a0" := (![sliceT] "hdr") in
79-
(func_call #marshal.pkg_name' #"NewDec"%go) "$a0") in
79+
(func_call #marshal #"NewDec"%go) "$a0") in
8080
do: ("dec" <-[marshal.Dec] "$r0");;;
8181
let: "sz" := (ref_ty uint64T (zero_val uint64T)) in
82-
let: "$r0" := ((method_call #marshal.pkg_name' #"Dec" #"GetInt" (![marshal.Dec] "dec")) #()) in
82+
let: "$r0" := ((method_call #marshal #"Dec" #"GetInt" (![marshal.Dec] "dec")) #()) in
8383
do: ("sz" <-[uint64T] "$r0");;;
8484
let: "diskSz" := (ref_ty uint64T (zero_val uint64T)) in
85-
let: "$r0" := ((method_call #marshal.pkg_name' #"Dec" #"GetInt" (![marshal.Dec] "dec")) #()) in
85+
let: "$r0" := ((method_call #marshal #"Dec" #"GetInt" (![marshal.Dec] "dec")) #()) in
8686
do: ("diskSz" <-[uint64T] "$r0");;;
8787
return: (ref_ty Log (let: "$m" := (ref_ty sync.Mutex (zero_val sync.Mutex)) in
8888
let: "$sz" := (![uint64T] "sz") in
@@ -104,7 +104,7 @@ Definition Log__get : val :=
104104
(if: (![uint64T] "i") < (![uint64T] "sz")
105105
then
106106
return: (let: "$a0" := (#(W64 1) + (![uint64T] "i")) in
107-
(func_call #disk.pkg_name' #"Read"%go) "$a0", #true)
107+
(func_call #disk #"Read"%go) "$a0", #true)
108108
else do: #());;;
109109
return: (#slice.nil, #false)).
110110

@@ -113,16 +113,16 @@ Definition Log__Get : val :=
113113
rec: "Log__Get" "log" "i" :=
114114
exception_do (let: "log" := (ref_ty ptrT "log") in
115115
let: "i" := (ref_ty uint64T "i") in
116-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
116+
do: ((method_call #sync #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
117117
let: "b" := (ref_ty boolT (zero_val boolT)) in
118118
let: "v" := (ref_ty sliceT (zero_val sliceT)) in
119119
let: ("$ret0", "$ret1") := (let: "$a0" := (![uint64T] "i") in
120-
(method_call #pkg_name' #"Log'ptr" #"get" (![ptrT] "log")) "$a0") in
120+
(method_call #append_log #"Log'ptr" #"get" (![ptrT] "log")) "$a0") in
121121
let: "$r0" := "$ret0" in
122122
let: "$r1" := "$ret1" in
123123
do: ("v" <-[sliceT] "$r0");;;
124124
do: ("b" <-[boolT] "$r1");;;
125-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
125+
do: ((method_call #sync #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
126126
return: (![sliceT] "v", ![boolT] "b")).
127127

128128
(* go: append_log.go:65:6 *)
@@ -138,7 +138,7 @@ Definition writeAll : val :=
138138
do: ("i" <-[intT] "$key");;;
139139
do: (let: "$a0" := ((![uint64T] "off") + (![intT] "i")) in
140140
let: "$a1" := (![sliceT] "bk") in
141-
(func_call #disk.pkg_name' #"Write"%go) "$a0" "$a1")))).
141+
(func_call #disk #"Write"%go) "$a0" "$a1")))).
142142

143143
(* go: append_log.go:71:17 *)
144144
Definition Log__append : val :=
@@ -154,23 +154,23 @@ Definition Log__append : val :=
154154
else do: #());;;
155155
do: (let: "$a0" := (![sliceT] "bks") in
156156
let: "$a1" := (#(W64 1) + (![uint64T] "sz")) in
157-
(func_call #pkg_name' #"writeAll"%go) "$a0" "$a1");;;
157+
(func_call #append_log.append_log #"writeAll"%go) "$a0" "$a1");;;
158158
do: ((struct.field_ref Log "sz" (![ptrT] "log")) <-[uint64T] ((![uint64T] (struct.field_ref Log "sz" (![ptrT] "log"))) + (let: "$a0" := (![sliceT] "bks") in
159159
slice.len "$a0")));;;
160-
do: ((method_call #pkg_name' #"Log'ptr" #"writeHdr" (![ptrT] "log")) #());;;
160+
do: ((method_call #append_log #"Log'ptr" #"writeHdr" (![ptrT] "log")) #());;;
161161
return: (#true)).
162162

163163
(* go: append_log.go:82:17 *)
164164
Definition Log__Append : val :=
165165
rec: "Log__Append" "log" "bks" :=
166166
exception_do (let: "log" := (ref_ty ptrT "log") in
167167
let: "bks" := (ref_ty sliceT "bks") in
168-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
168+
do: ((method_call #sync #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
169169
let: "b" := (ref_ty boolT (zero_val boolT)) in
170170
let: "$r0" := (let: "$a0" := (![sliceT] "bks") in
171-
(method_call #pkg_name' #"Log'ptr" #"append" (![ptrT] "log")) "$a0") in
171+
(method_call #append_log #"Log'ptr" #"append" (![ptrT] "log")) "$a0") in
172172
do: ("b" <-[boolT] "$r0");;;
173-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
173+
do: ((method_call #sync #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
174174
return: (![boolT] "b")).
175175

176176
(* go: append_log.go:89:17 *)
@@ -179,33 +179,33 @@ Definition Log__reset : val :=
179179
exception_do (let: "log" := (ref_ty ptrT "log") in
180180
let: "$r0" := #(W64 0) in
181181
do: ((struct.field_ref Log "sz" (![ptrT] "log")) <-[uint64T] "$r0");;;
182-
do: ((method_call #pkg_name' #"Log'ptr" #"writeHdr" (![ptrT] "log")) #())).
182+
do: ((method_call #append_log #"Log'ptr" #"writeHdr" (![ptrT] "log")) #())).
183183

184184
(* go: append_log.go:94:17 *)
185185
Definition Log__Reset : val :=
186186
rec: "Log__Reset" "log" <> :=
187187
exception_do (let: "log" := (ref_ty ptrT "log") in
188-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
189-
do: ((method_call #pkg_name' #"Log'ptr" #"reset" (![ptrT] "log")) #());;;
190-
do: ((method_call #sync.pkg_name' #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #())).
188+
do: ((method_call #sync #"Mutex'ptr" #"Lock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #());;;
189+
do: ((method_call #append_log #"Log'ptr" #"reset" (![ptrT] "log")) #());;;
190+
do: ((method_call #sync #"Mutex'ptr" #"Unlock" (![ptrT] (struct.field_ref Log "m" (![ptrT] "log")))) #())).
191191

192192
Definition vars' : list (go_string * go_type) := [].
193193

194194
Definition functions' : list (go_string * val) := [("Init"%go, Init); ("Open"%go, Open); ("writeAll"%go, writeAll)].
195195

196196
Definition msets' : list (go_string * (list (go_string * val))) := [("Log"%go, []); ("Log'ptr"%go, [("Append"%go, Log__Append); ("Get"%go, Log__Get); ("Reset"%go, Log__Reset); ("append"%go, Log__append); ("get"%go, Log__get); ("mkHdr"%go, Log__mkHdr); ("reset"%go, Log__reset); ("writeHdr"%go, Log__writeHdr)])].
197197

198-
#[global] Instance info' : PkgInfo pkg_name' :=
198+
#[global] Instance info' : PkgInfo append_log.append_log :=
199199
{|
200200
pkg_vars := vars';
201201
pkg_functions := functions';
202202
pkg_msets := msets';
203-
pkg_imported_pkgs := [sync.pkg_name'; marshal.pkg_name'; disk.pkg_name'];
203+
pkg_imported_pkgs := [sync; marshal; disk];
204204
|}.
205205

206206
Definition initialize' : val :=
207207
rec: "initialize'" <> :=
208-
globals.package_init pkg_name' (λ: <>,
208+
globals.package_init append_log.append_log (λ: <>,
209209
exception_do (do: disk.initialize';;;
210210
do: marshal.initialize';;;
211211
do: sync.initialize')

testdata/examples/async/async.gold.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
From New.golang Require Import defn.
33
Require Export New.code.github_com.goose_lang.primitive.async_disk.
44

5+
Definition async : go_string := "github.com/goose-lang/goose/testdata/examples/async".
6+
57
From New Require Import async_disk_prelude.
68
Module async.
79
Section code.
@@ -25,25 +27,23 @@ Definition UseDisk : val :=
2527
(interface.get "Write" (![disk.Disk] "d")) "$a0" "$a1");;;
2628
do: ((interface.get "Barrier" (![disk.Disk] "d")) #())).
2729

28-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/async".
29-
3030
Definition vars' : list (go_string * go_type) := [].
3131

3232
Definition functions' : list (go_string * val) := [("TakesDisk"%go, TakesDisk); ("UseDisk"%go, UseDisk)].
3333

3434
Definition msets' : list (go_string * (list (go_string * val))) := [].
3535

36-
#[global] Instance info' : PkgInfo pkg_name' :=
36+
#[global] Instance info' : PkgInfo async.async :=
3737
{|
3838
pkg_vars := vars';
3939
pkg_functions := functions';
4040
pkg_msets := msets';
41-
pkg_imported_pkgs := [async_disk.pkg_name'];
41+
pkg_imported_pkgs := [async_disk];
4242
|}.
4343

4444
Definition initialize' : val :=
4545
rec: "initialize'" <> :=
46-
globals.package_init pkg_name' (λ: <>,
46+
globals.package_init async.async (λ: <>,
4747
exception_do (do: async_disk.initialize')
4848
).
4949

testdata/examples/comments/comments.gold.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(* autogenerated from github.com/goose-lang/goose/testdata/examples/comments *)
22
From New.golang Require Import defn.
33

4+
Definition comments : go_string := "github.com/goose-lang/goose/testdata/examples/comments".
5+
46
Module comments.
57
Section code.
68
Context `{ffi_syntax}.
@@ -14,15 +16,13 @@ Definition Foo : go_type := structT [
1416
"a" :: boolT
1517
].
1618

17-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/comments".
18-
1919
Definition vars' : list (go_string * go_type) := [].
2020

2121
Definition functions' : list (go_string * val) := [].
2222

2323
Definition msets' : list (go_string * (list (go_string * val))) := [("Foo"%go, []); ("Foo'ptr"%go, [])].
2424

25-
#[global] Instance info' : PkgInfo pkg_name' :=
25+
#[global] Instance info' : PkgInfo comments.comments :=
2626
{|
2727
pkg_vars := vars';
2828
pkg_functions := functions';
@@ -32,7 +32,7 @@ Definition msets' : list (go_string * (list (go_string * val))) := [("Foo"%go, [
3232

3333
Definition initialize' : val :=
3434
rec: "initialize'" <> :=
35-
globals.package_init pkg_name' (λ: <>,
35+
globals.package_init comments.comments (λ: <>,
3636
exception_do (do: #())
3737
).
3838

testdata/examples/externalglobals/externalglobals.gold.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
From New.golang Require Import defn.
33
Require Export New.code.github_com.goose_lang.goose.testdata.examples.unittest.
44

5+
Definition externalglobals : go_string := "github.com/goose-lang/goose/testdata/examples/externalglobals".
6+
57
From New Require Import disk_prelude.
68
Module externalglobals.
79
Section code.
810

911

10-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/externalglobals".
11-
1212
(* go: g.go:7:6 *)
1313
Definition f : val :=
1414
rec: "f" <> :=
1515
exception_do (let: "$r0" := #(W64 11) in
16-
do: ((globals.get #unittest.pkg_name' #"GlobalX"%go) <-[uint64T] "$r0")).
16+
do: ((globals.get #unittest #"GlobalX"%go) <-[uint64T] "$r0")).
1717

1818
Definition vars' : list (go_string * go_type) := [].
1919

2020
Definition functions' : list (go_string * val) := [("f"%go, f)].
2121

2222
Definition msets' : list (go_string * (list (go_string * val))) := [].
2323

24-
#[global] Instance info' : PkgInfo pkg_name' :=
24+
#[global] Instance info' : PkgInfo externalglobals.externalglobals :=
2525
{|
2626
pkg_vars := vars';
2727
pkg_functions := functions';
2828
pkg_msets := msets';
29-
pkg_imported_pkgs := [unittest.pkg_name'];
29+
pkg_imported_pkgs := [unittest];
3030
|}.
3131

3232
Definition initialize' : val :=
3333
rec: "initialize'" <> :=
34-
globals.package_init pkg_name' (λ: <>,
34+
globals.package_init externalglobals.externalglobals (λ: <>,
3535
exception_do (do: unittest.initialize')
3636
).
3737

testdata/examples/import/import.gold.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
From New.golang Require Import defn.
33
Require Export New.code.sync.atomic.
44

5+
Definition example : go_string := "github.com/goose-lang/goose/testdata/examples/import".
6+
57
Module example.
68
Section code.
79
Context `{ffi_syntax}.
810

911

10-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/import".
11-
1212
Definition vars' : list (go_string * go_type) := [].
1313

1414
Definition functions' : list (go_string * val) := [].
1515

1616
Definition msets' : list (go_string * (list (go_string * val))) := [].
1717

18-
#[global] Instance info' : PkgInfo pkg_name' :=
18+
#[global] Instance info' : PkgInfo import.example :=
1919
{|
2020
pkg_vars := vars';
2121
pkg_functions := functions';
2222
pkg_msets := msets';
23-
pkg_imported_pkgs := [atomic.pkg_name'];
23+
pkg_imported_pkgs := [atomic];
2424
|}.
2525

2626
Definition initialize' : val :=
2727
rec: "initialize'" <> :=
28-
globals.package_init pkg_name' (λ: <>,
28+
globals.package_init import.example (λ: <>,
2929
exception_do (do: atomic.initialize')
3030
).
3131

testdata/examples/interfacerecursion/interfacerecursion.gold.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(* autogenerated from github.com/goose-lang/goose/testdata/examples/interfacerecursion *)
22
From New.golang Require Import defn.
33

4+
Definition interfacerecursion : go_string := "github.com/goose-lang/goose/testdata/examples/interfacerecursion".
5+
46
Module interfacerecursion.
57
Section code.
68
Context `{ffi_syntax}.
@@ -18,7 +20,7 @@ Definition c__Foo : val :=
1820
rec: "c__Foo" "c" <> :=
1921
exception_do (let: "c" := (ref_ty ptrT "c") in
2022
let: "y" := (ref_ty B (zero_val B)) in
21-
let: "$r0" := (interface.make #pkg_name' #"c'ptr" (![ptrT] "c")) in
23+
let: "$r0" := (interface.make #interfacerecursion #"c'ptr" (![ptrT] "c")) in
2224
do: ("y" <-[B] "$r0");;;
2325
do: ((interface.get "Bar" (![B] "y")) #())).
2426

@@ -27,19 +29,17 @@ Definition c__Bar : val :=
2729
rec: "c__Bar" "c" <> :=
2830
exception_do (let: "c" := (ref_ty ptrT "c") in
2931
let: "y" := (ref_ty A (zero_val A)) in
30-
let: "$r0" := (interface.make #pkg_name' #"c'ptr" (![ptrT] "c")) in
32+
let: "$r0" := (interface.make #interfacerecursion #"c'ptr" (![ptrT] "c")) in
3133
do: ("y" <-[A] "$r0");;;
3234
do: ((interface.get "Foo" (![A] "y")) #())).
3335

34-
Definition pkg_name' : go_string := "github.com/goose-lang/goose/testdata/examples/interfacerecursion".
35-
3636
Definition vars' : list (go_string * go_type) := [].
3737

3838
Definition functions' : list (go_string * val) := [].
3939

4040
Definition msets' : list (go_string * (list (go_string * val))) := [("c"%go, []); ("c'ptr"%go, [("Bar"%go, c__Bar); ("Foo"%go, c__Foo)])].
4141

42-
#[global] Instance info' : PkgInfo pkg_name' :=
42+
#[global] Instance info' : PkgInfo interfacerecursion.interfacerecursion :=
4343
{|
4444
pkg_vars := vars';
4545
pkg_functions := functions';
@@ -49,7 +49,7 @@ Definition msets' : list (go_string * (list (go_string * val))) := [("c"%go, [])
4949

5050
Definition initialize' : val :=
5151
rec: "initialize'" <> :=
52-
globals.package_init pkg_name' (λ: <>,
52+
globals.package_init interfacerecursion.interfacerecursion (λ: <>,
5353
exception_do (do: #())
5454
).
5555

0 commit comments

Comments
 (0)