8
8
"strings"
9
9
10
10
"codeberg.org/anaseto/goal"
11
+ "codeberg.org/anaseto/goal/archive/zip"
12
+ "codeberg.org/anaseto/goal/encoding/base64"
13
+ "codeberg.org/anaseto/goal/math"
11
14
gos "codeberg.org/anaseto/goal/os"
12
15
"github.com/semperos/ari/vendored/help"
13
16
)
@@ -31,6 +34,7 @@ const (
31
34
func goalLoadExtendedPreamble (ctx * goal.Context ) error {
32
35
additionalPackages := map [string ]string {
33
36
"dict" : goalSourceDict ,
37
+ "flag" : goalSourceFlag ,
34
38
"fmt" : goalSourceFmt ,
35
39
"fs" : goalSourceFs ,
36
40
"html" : goalSourceHTML ,
@@ -41,6 +45,7 @@ func goalLoadExtendedPreamble(ctx *goal.Context) error {
41
45
"path" : goalSourcePath ,
42
46
"table" : goalSourceTable ,
43
47
}
48
+
44
49
for pkg , source := range additionalPackages {
45
50
_ , err := ctx .EvalPackage (source , "<builtin>" , pkg )
46
51
if err != nil {
@@ -57,6 +62,9 @@ func goalLoadExtendedPreamble(ctx *goal.Context) error {
57
62
//go:embed vendor-goal/dict.goal
58
63
var goalSourceDict string
59
64
65
+ //go:embed vendor-goal/flag.goal
66
+ var goalSourceFlag string
67
+
60
68
//go:embed vendor-goal/fmt.goal
61
69
var goalSourceFmt string
62
70
@@ -184,8 +192,10 @@ func goalNewDictEmpty() *goal.D {
184
192
// Integration with other parts of Ari
185
193
186
194
func goalRegisterUniversalVariadics (ariContext * Context , goalContext * goal.Context , help Help ) {
187
- // From Goal itself, os lib imported without prefix. Includes 'say' verb, which works even in WASM.
188
- gos .Import (goalContext , "" )
195
+ gos .Import (goalContext , "" ) // because Goal imports this without prefix
196
+ math .Import (goalContext , "math" ) // because this file isn't prefixed
197
+ zip .Import (goalContext , "" ) // already zip-prefixed
198
+ base64 .Import (goalContext , "" ) // already base64-prefixed
189
199
goalContext .RegisterExtension ("ari" , AriVersion )
190
200
goalContext .AssignGlobal ("ari.c" , goal .NewI (0 ))
191
201
// Monads
0 commit comments