commit 6dc5842
chld
·
2026-08-15 20:02:18 +0000 UTC
parent 9cb7f43
start variable detection
M
Makefile
+3,
-0
1@@ -1,3 +1,5 @@
2+VAR = var
3+
4 x: a b
5 a: c
6 b:
7@@ -10,3 +12,4 @@ c:
8 goon: green
9 green: hi
10 hi:
11+ echo $(VAR)
M
test.scm
+14,
-2
1@@ -9,13 +9,25 @@
2
3 (define t-list '())
4 (define m-list '())
5+(define v-list '())
6 (define f-list (file-read "Makefile"))
7
8 (do ((l (- (length f-list) 1) (- l 1)))
9 ((< l 0))
10+
11+
12 (if (string-contains (list-ref f-list l) ":")
13- (set! m-list (cons (line-parse (list-ref f-list l)) m-list)))
14- )
15+ (set! m-list (cons (line-parse (list-ref f-list l)) m-list))
16+ (if (string-contains (list-ref f-list l) "=")
17+ (if (string=? (list-ref (string-split (list-ref f-list l) #\space)1) "=")
18+ (set! v-list
19+ (cons (cons
20+ (list-ref (string-split (list-ref f-list l)#\space) 0)
21+ (list-ref (string-split (list-ref f-list l)#\space) 2)
22+ v-list)))
23+ )
24+ ))
25+ )
26
27 ;; (display m-list)
28 ;; (newline)(newline)