]> git.mdlowis.com Git - proto/sclpl-rb.git/commitdiff
reorg code and work on module loading
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 7 Feb 2020 21:47:25 +0000 (16:47 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 7 Feb 2020 21:47:25 +0000 (16:47 -0500)
compile.rb
lib/main.m [moved from example.src with 95% similarity]
lib/posix.m [new file with mode: 0644]
lib/x11.m [new file with mode: 0644]
lib/xsel.m [new file with mode: 0644]

index 0cd437bad71790ab676cb84ac8b3a210264a4400..238053012783b912a2dd74be14f8f2f0c62d22c8 100755 (executable)
@@ -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()
similarity index 95%
rename from example.src
rename to lib/main.m
index a74f83544b636d047e5aa658a1961c4033d1f2ce..161f91a74cc63f4275111bcf0b197964d75e5cf8 100644 (file)
@@ -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 (file)
index 0000000..9186ada
--- /dev/null
@@ -0,0 +1,6 @@
+module Posix
+imports ()
+
+$exec(cmd : [String])
+{
+}
diff --git a/lib/x11.m b/lib/x11.m
new file mode 100644 (file)
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 (file)
index 0000000..6510df0
--- /dev/null
@@ -0,0 +1,6 @@
+module XSel
+imports (X11)
+
+$init(x : X11.Config)
+{
+}