aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/strap')
-rw-r--r--src/boot/strap/scanner.clisp19
-rw-r--r--src/boot/strap/utility.clisp11
2 files changed, 21 insertions, 9 deletions
diff --git a/src/boot/strap/scanner.clisp b/src/boot/strap/scanner.clisp
index 2a01edc0..208c588a 100644
--- a/src/boot/strap/scanner.clisp
+++ b/src/boot/strap/scanner.clisp
@@ -131,13 +131,12 @@
(COND
((CHAR= (SCHAR |command| 0) (|char| '|;|))
(|shoeAccumulateLines| |$r| |string|))
- (T (SETQ |a| (STRPOS ";" |command| 0 NIL))
- (COND
- (|a| (|shoeAccumulateLines| |$r|
- (CONCAT |string|
- (|subString| |command| 0 (- |a| 1)))))
- (T (|shoeAccumulateLines| |$r|
- (CONCAT |string| |command|)))))))
+ ((SETQ |a| (|charPosition| (|char| '|;|) |command| 0))
+ (|shoeAccumulateLines| |$r|
+ (CONCAT |string|
+ (|subString| |command| 0 (- |a| 1)))))
+ (T (|shoeAccumulateLines| |$r|
+ (CONCAT |string| |command|)))))
(T (|shoeAccumulateLines| |$r| |string|))))
(T (CONS |s| |string|))))))
@@ -347,8 +346,10 @@
((NOT (< |$n| |$sz|))
(|SoftShoeError| (CONS |$linepos| |$n|) "quote added") "")
(T (SETQ |n| |$n|)
- (SETQ |strsym| (OR (STRPOS "\"" |$ln| |$n| NIL) |$sz|))
- (SETQ |escsym| (OR (STRPOS "_" |$ln| |$n| NIL) |$sz|))
+ (SETQ |strsym|
+ (OR (|charPosition| (|char| '|"|) |$ln| |$n|) |$sz|))
+ (SETQ |escsym|
+ (OR (|charPosition| (|char| '_) |$ln| |$n|) |$sz|))
(SETQ |mn| (MIN |strsym| |escsym|))
(COND
((EQUAL |mn| |$sz|) (SETQ |$n| |$sz|)
diff --git a/src/boot/strap/utility.clisp b/src/boot/strap/utility.clisp
index 02f52e9f..7bfc9387 100644
--- a/src/boot/strap/utility.clisp
+++ b/src/boot/strap/utility.clisp
@@ -302,3 +302,14 @@
((OR (CHARACTERP |x|) (INTEGERP |x|)) (|removeScalar| |l| |x|))
(T (|removeValue| |l| |x|))))
+(DEFUN |charPosition| (|c| |s| |k|)
+ (PROG (|n|)
+ (RETURN
+ (PROGN
+ (SETQ |n| (LENGTH |s|))
+ (LOOP
+ (COND
+ ((NOT (< |k| |n|)) (RETURN NIL))
+ ((CHAR= (SCHAR |s| |k|) |c|) (RETURN |k|))
+ (T (SETQ |k| (+ |k| 1)))))))))
+