From: Michael D. Lowis Date: Fri, 7 Feb 2020 21:47:25 +0000 (-0500) Subject: reorg code and work on module loading X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d368350ff8f93b3ccf42d0401884355b7bc29f98;p=proto%2Fsclpl-rb.git reorg code and work on module loading --- diff --git a/compile.rb b/compile.rb index 0cd437b..2380530 100755 --- a/compile.rb +++ b/compile.rb @@ -576,6 +576,7 @@ class Package parse = Parser.new(path) @name = parse.module() @imports = parse.imports() +p @imports @definitions = parse.definitions() end @@ -591,5 +592,5 @@ class Package end end -pkg = Package.new("example.src") -pkg.dump() +pkg = Package.new("lib/main.m") +#pkg.dump() diff --git a/example.src b/lib/main.m similarity index 95% rename from example.src rename to lib/main.m index a74f835..161f91a 100644 --- a/example.src +++ b/lib/main.m @@ -23,7 +23,7 @@ $main(args : [String]) : Int X11.init(x) X11.mkwin(x, 1, 1, X11.PropertyChangeMask) XSel.init(x) - X11.loop(x, nil) + X11.loop(x) return 0 } diff --git a/lib/posix.m b/lib/posix.m new file mode 100644 index 0000000..9186ada --- /dev/null +++ b/lib/posix.m @@ -0,0 +1,6 @@ +module Posix +imports () + +$exec(cmd : [String]) +{ +} diff --git a/lib/x11.m b/lib/x11.m new file mode 100644 index 0000000..667e06b --- /dev/null +++ b/lib/x11.m @@ -0,0 +1,20 @@ +module X11 +imports () + +$PropertyChangeMask : int = 42; + +$Config is { + foo = bar +} + +$init(x : Config) +{ +} + +$mkwin(x : Config, w : int, h : int, mask : int) +{ +} + +$loop(x : Config) +{ +} \ No newline at end of file diff --git a/lib/xsel.m b/lib/xsel.m new file mode 100644 index 0000000..6510df0 --- /dev/null +++ b/lib/xsel.m @@ -0,0 +1,6 @@ +module XSel +imports (X11) + +$init(x : X11.Config) +{ +}