Skip to content

Commit

Permalink
update to latest trealla
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed Mar 21, 2023
1 parent 3995cb9 commit f7d22d5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/trealla
Submodule trealla updated 61 files
+9 −2 .github/workflows/build.yaml
+1 −0 .gitignore
+12 −7 Makefile
+20 −39 README.md
+16 −0 library/builtins.pl
+104 −0 library/concurrent.pl
+1,107 −0 library/curl.pl
+18 −2 library/dcgs.pl
+5 −5 library/lists.pl
+13 −2 library/pseudojson.pl
+2 −0 library/raylib.pl
+186 −8 library/spin.pl
+4 −4 library/wasm.pl
+15 −7 library/wasm_generic.pl
+53 −28 library/wasm_js.pl
+0 −0 samples/puzzle.pl
+50 −0 samples/testconcurrent.pl
+47 −0 samples/testcurl.pl
+57 −49 samples/testraylib2.pl
+9 −27 src/bags.c
+5 −3 src/builtins.h
+348 −10 src/contrib.c
+41 −8 src/control.c
+121 −77 src/ffi.c
+19 −10 src/format.c
+59 −3 src/functions.c
+61 −24 src/heap.c
+1 −20 src/heap.h
+36 −22 src/internal.h
+8 −2 src/library.c
+35 −8 src/module.c
+2 −0 src/module.h
+19 −60 src/parser.c
+1 −1 src/parser.h
+167 −62 src/predicates.c
+2 −23 src/print.c
+107 −113 src/prolog.c
+1 −3 src/prolog.h
+77 −38 src/query.c
+21 −35 src/query.h
+303 −34 src/streams.c
+0 −5 src/toplevel.c
+10 −2 src/trealla.h
+269 −268 src/unify.c
+5 −5 src/wasi.c
+14 −6 src/wasi.h
+239 −0 src/wasm/outbound-pg.c
+174 −0 src/wasm/outbound-pg.h
+22 −327 src/wasm/wizer.h
+0 −584 src/win32ports/dirent.h
+0 −88 src/win32ports/sys/time.h
+0 −520 src/win32ports/sys/wait.h
+0 −314 src/win32ports/unistd.h
+1 −1 tests/issues-OLD/test518.expected
+3 −3 tests/issues-OLD/test518.pl
+2 −2 tests/issues-OLD/test601.expected
+4 −4 tests/issues-OLD/test605.expected
+2 −2 tests/tests/test082.expected
+0 −0 tests/tests/test088.expected
+5 −0 tests/tests/test088.pl
+2 −2 tpl.c
6 changes: 3 additions & 3 deletions trealla/answer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Answer struct {

type response struct {
Answer
Result queryStatus
Status queryStatus
Error json.RawMessage // ball
}

Expand Down Expand Up @@ -68,7 +68,7 @@ func (pl *prolog) parse(goal, stdout, stderr string) (Answer, error) {
return resp.Answer, fmt.Errorf("trealla: decoding error: %w", err)
}

switch resp.Result {
switch resp.Status {
case statusSuccess:
return resp.Answer, nil
case statusFailure:
Expand All @@ -80,7 +80,7 @@ func (pl *prolog) parse(goal, stdout, stderr string) (Answer, error) {
}
return resp.Answer, ErrThrow{Query: goal, Ball: ball, Stdout: output, Stderr: stderr}
default:
return resp.Answer, fmt.Errorf("trealla: unexpected query status: %v", resp.Result)
return resp.Answer, fmt.Errorf("trealla: unexpected query status: %v", resp.Status)
}
}

Expand Down
Binary file modified trealla/libtpl.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion trealla/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (pl *prolog) start(ctx context.Context, goal string, options ...QueryOption
ch <- fmt.Errorf("trealla: panic: %v", ex)
}
}()
v, err := pl.pl_query(pl.ptr, goalstr.ptr, subqptr)
v, err := pl.pl_query(pl.ptr, goalstr.ptr, subqptr, 0)
if err == nil {
ret = v.(int32)
}
Expand Down

0 comments on commit f7d22d5

Please sign in to comment.