Skip to content

Commit

Permalink
protobuf: add :gerbil/core import in generated module (mighty-gerbils…
Browse files Browse the repository at this point in the history
…#970)

Seems there are some issues with the module loader in expanded protobuf
modules
  • Loading branch information
vyzo authored Oct 4, 2023
1 parent f0d8312 commit ccf72e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/std/protobuf/proto.ss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

(defrules begin-module%% ()
((_ . body)
(%%begin-module (export #t) . body)))
(%%begin-module (import (only-in :gerbil/core load-module)
(for-syntax (only-in :gerbil/core load-module)))
(export #t) . body)))

(defsyntax (begin-protobuf stx)
(def (parse-body body)
Expand Down
4 changes: 2 additions & 2 deletions src/std/protobuf/protobuf-test.ss
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@

(test-case "test parser"
(check (gx#import-module (path-expand "potpourri-test.proto"
(path-directory (this-source-file))))
(path-directory (this-source-file))))
? gx#module-context?))

(test-case "test import"
(check (gx#import-module (path-expand "potpourri-test2.proto"
(path-directory (this-source-file))))
(path-directory (this-source-file))))
? gx#module-context?))

))

0 comments on commit ccf72e2

Please sign in to comment.