]> git.mdlowis.com Git - archive/dlang-scm.git/commitdiff
Removed dependencies on extensions and changed default action to compile
authorMike D. Lowis <mike@mdlowis.com>
Tue, 24 Jul 2012 20:32:52 +0000 (16:32 -0400)
committerMike D. Lowis <mike@mdlowis.com>
Tue, 24 Jul 2012 20:32:52 +0000 (16:32 -0400)
Makefile
source/buf.scm
source/main.scm

index cb0d27955227a5cbd1ce4e5c7d91d235cae20afc..f0b1954ed42e2b019f2b58b161da3352f459db97 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ TEST_INCS = -I inc
 # Compiler and Linker Options
 #----------------------------
 CSC = csc
-CSCFLAGS = -c -w
+CSCFLAGS = -c -explicit-use
 
 # Build Rules
 #------------
index 9e3b734f89430c7e45012faa886ab924d3a4dd4d..3a0e3f2e30943dfc33b52f7eab6fa5974706ea3b 100644 (file)
@@ -1,7 +1,4 @@
-(declare (unit buf)
-         (uses library))
-
-(require-extension vector-lib)
+(declare (unit buf) (uses library))
 
 (define-record buf
   src ldfn pos marks data)
        (list?     (buf-marks obj))
        (vector?   (buf-data obj))))
 
+(define (vector-append v1 v2 . vN)
+  (define new-vec (list->vector (append (vector->list v1) (vector->list v2))))
+  (if (null? vN) new-vec (vector-append new-vec (car vN) (cdr vN))))
+
 (define (buf-marked? b)
   (> (length (buf-marks b)) 0))
 
index 780254ce4eda7848748ad3aa973b4cc68b2a1273..21982b305077572dbc0e9a0fa4519ea3465c08ee 100644 (file)
@@ -1,7 +1,4 @@
-(declare (uses lexer parser scheme))
-
-; Require the String library extension
-(require-extension srfi-13)
+(declare (uses lexer parser scheme srfi-13))
 
 (define (get-output-file-name ifname)
   (string-append (substring ifname 0 (string-index-right ifname #\.)) ".scm"))
@@ -9,7 +6,15 @@
 (define (parse-file fname)
   (scheme-program (dlang/program (dlang/lexer (open-input-file fname)))))
 
-(define (interpret-file fname)
+(define (dlang-compile-file fname)
+  (define ofname (get-output-file-name fname))
+  (define program (parse-file fname))
+  (with-output-to-file ofname
+    (lambda () (map print program)))
+  (system (string-append "csc " ofname))
+  (delete-file ofname))
+
+(define (dlang-interpret-file fname)
   (define ofname (get-output-file-name fname))
   (define program (parse-file fname))
   (with-output-to-file ofname
@@ -19,6 +24,6 @@
 
 ; If we have a file, then parse it
 (if (= 1 (length (command-line-arguments)))
-  (interpret-file (car (command-line-arguments)))
+  (dlang-compile-file (car (command-line-arguments)))
   (print "No input file provided."))