Show More
@@ -17,10 +17,6 b' graphs: diagrams.png' | |||||
17 | $(DIST): $(BIN) extras/* |
|
17 | $(DIST): $(BIN) extras/* | |
18 | tar cfvJ $@ $< extras |
|
18 | tar cfvJ $@ $< extras | |
19 |
|
19 | |||
20 | upload: $(DIST) |
|
|||
21 | curl --upload-file $(DIST) https://transfer.sh/$(DIST) |
|
|||
22 | @echo |
|
|||
23 |
|
||||
24 | clean: |
|
20 | clean: | |
25 | rm -f $(BIN) $(DIST) |
|
21 | rm -f $(BIN) $(DIST) | |
26 |
|
22 | |||
@@ -29,4 +25,4 b' clean-cache:' | |||||
29 |
|
25 | |||
30 | fresh: clean clean-cache all |
|
26 | fresh: clean clean-cache all | |
31 |
|
27 | |||
32 |
.PHONY: all graphs |
|
28 | .PHONY: all graphs clean clean-cache fresh |
@@ -1,5 +1,5 b'' | |||||
1 |
|
1 | |||
2 | (in-package txt2web) |
|
2 | (in-package txt2web.api) | |
3 |
|
3 | |||
4 | ;;; API deals with DOM manipulation and some bookkeeping for the |
|
4 | ;;; API deals with DOM manipulation and some bookkeeping for the | |
5 | ;;; intrinsics, namely variables |
|
5 | ;;; intrinsics, namely variables | |
@@ -212,12 +212,10 b'' | |||||
212 | ;;; "Syntax" |
|
212 | ;;; "Syntax" | |
213 |
|
213 | |||
214 | (defun qspfor (name index from to step body) |
|
214 | (defun qspfor (name index from to step body) | |
215 | (ps:for ((i from)) |
|
215 | (loop :for i :from from :to to :by step | |
216 | ((< i to)) |
|
216 | :do (set-var name index :num i) | |
217 | ((incf i step)) |
|
217 | :do (unless (await (funcall body)) | |
218 | (set-var name index :num i) |
|
218 | (return-from qspfor)))) | |
219 | (unless (await (funcall body)) |
|
|||
220 | (return-from qspfor)))) |
|
|||
221 |
|
219 | |||
222 | ;;; Variables |
|
220 | ;;; Variables | |
223 |
|
221 |
@@ -1,5 +1,5 b'' | |||||
1 |
|
1 | |||
2 | (in-package txt2web) |
|
2 | (in-package txt2web.lib) | |
3 |
|
3 | |||
4 | ;;;; Functions and procedures defined by the QSP language. |
|
4 | ;;;; Functions and procedures defined by the QSP language. | |
5 | ;;;; They can call api and deal with locations and other data directly. |
|
5 | ;;;; They can call api and deal with locations and other data directly. | |
@@ -45,27 +45,27 b'' | |||||
45 | (api:var-real-name to) |
|
45 | (api:var-real-name to) | |
46 | (multiple-value-bind (from-name from-slot) |
|
46 | (multiple-value-bind (from-name from-slot) | |
47 | (api:var-real-name from) |
|
47 | (api:var-real-name from) | |
48 | (for ((i start)) |
|
48 | (loop :for i :from start :to (min (api:array-size from-name) | |
49 | ((< i (min (api:array-size from-name) |
|
49 | (+ start count)) | |
50 | (+ start count)))) |
|
50 | :do (api:set-var to-name (+ start i) to-slot | |
51 | ((incf i)) |
|
51 | (api:get-var from-name (+ start i) from-slot)))))) | |
52 | (api:set-var to-name (+ start i) to-slot |
|
|||
53 | (api:get-var from-name (+ start i) from-slot)))))) |
|
|||
54 |
|
52 | |||
55 | (defun arrpos (name value &optional (start 0)) |
|
53 | (defun arrpos (name value &optional (start 0)) | |
56 | (multiple-value-bind (real-name slot) |
|
54 | (multiple-value-bind (real-name slot) | |
57 | (api:var-real-name name) |
|
55 | (api:var-real-name name) | |
58 |
( |
|
56 | (loop :for i :from start :to (api:array-size name) | |
59 |
|
|
57 | :do (when (eq (api:get-var real-name i slot) value) | |
60 | (return-from arrpos i)))) |
|
58 | (return-from arrpos i)))) | |
61 | -1) |
|
59 | -1) | |
62 |
|
60 | |||
63 | (defun arrcomp (name pattern &optional (start 0)) |
|
61 | (defun arrcomp (name pattern &optional (start 0)) | |
64 | (multiple-value-bind (real-name slot) |
|
62 | (multiple-value-bind (real-name slot) | |
65 | (api:var-real-name name) |
|
63 | (api:var-real-name name) | |
66 |
( |
|
64 | (loop :for i :from start :to (api:array-size name) | |
67 |
|
|
65 | :do (when (funcall (getprop (api:get-var real-name i slot) | |
68 | (return-from arrcomp i)))) |
|
66 | 'match) | |
|
67 | pattern) | |||
|
68 | (return-from arrcomp i)))) | |||
69 | -1) |
|
69 | -1) | |
70 |
|
70 | |||
71 | ;;; 6str |
|
71 | ;;; 6str |
General Comments 0
You need to be logged in to leave comments.
Login now