aboutsummaryrefslogtreecommitdiffstats
path: root/simetrix.scm
diff options
context:
space:
mode:
Diffstat (limited to 'simetrix.scm')
-rwxr-xr-x[-rw-r--r--]simetrix.scm17
1 files changed, 9 insertions, 8 deletions
diff --git a/simetrix.scm b/simetrix.scm
index e066daf..5d4a93a 100644..100755
--- a/simetrix.scm
+++ b/simetrix.scm
@@ -19,7 +19,7 @@
;; Implements "Representation of numerical values and SI units in
;; character strings for information interchanges"
-;; http://swiss.csail.mit.edu/~jaffer/MIXF
+;; http://people.csail.mit.edu/jaffer/MIXF
(require 'precedence-parse)
(require 'string-port)
@@ -196,7 +196,7 @@
(define (SI:expand-equivalence str)
(call-with-input-string
str (lambda (sport)
- (define result (prec:parse SI:grammar 'EOS sport))
+ (define result (prec:parse SI:grammar 'EOS 0 sport))
(cond ((eof-object? result) (list (cons 1 0)))
((symbol? result) (SI:expand-unit result))
(else result)))))
@@ -226,16 +226,17 @@
;;; Definitions accumulate in top-level variable *SYN-DEFS*.
;;(trace-all (in-vicinity (program-vicinity) "simetrix.scm"))
+(define (list2string dyn lst) (list->string lst))
;;; Character classes
-(prec:define-grammar (tok:char-group 70 #\^ list->string))
-(prec:define-grammar (tok:char-group 49 #\. list->string))
-(prec:define-grammar (tok:char-group 50 #\/ list->string))
-(prec:define-grammar (tok:char-group 51 #\- list->string))
+(prec:define-grammar (tok:char-group 70 #\^ list2string))
+(prec:define-grammar (tok:char-group 49 #\. list2string))
+(prec:define-grammar (tok:char-group 50 #\/ list2string))
+(prec:define-grammar (tok:char-group 51 #\- list2string))
(prec:define-grammar (tok:char-group 40 tok:decimal-digits
- (lambda (l) (string->number (list->string l)))))
+ (lambda (dyn l) (string->number (list->string l)))))
(prec:define-grammar (tok:char-group 44
(string-append tok:upper-case tok:lower-case "@_")
- list->string))
+ list2string))
(prec:define-grammar (prec:prefix '- SI:minus 130))
(prec:define-grammar (prec:infix "." SI:dot 120 120))