Fix parser
This commit is contained in:
@ -90,12 +90,12 @@ proposition."))
|
||||
"Return t if STR is only alphabetical characters."
|
||||
(not (find-if-not 'alpha-char-p str)))
|
||||
|
||||
(defparameter *longest-non-alpha-operator*
|
||||
(defparameter *longest-alpha-operator*
|
||||
(apply 'max (mapcar
|
||||
(lambda (entry)
|
||||
(apply 'max
|
||||
(apply 'max 0
|
||||
(mapcar 'length
|
||||
(remove-if 'alpha-string-p (cdr entry)))))
|
||||
(remove-if-not 'alpha-string-p (cdr entry)))))
|
||||
*operator-symbol-table*))
|
||||
"The longest operator in `*operator-symbol-table*' such that `alpha-string-p'
|
||||
returns t.")
|
||||
@ -224,7 +224,7 @@ a variable."
|
||||
"Return the operator symbol for TOKEN, if it is an operator. As a second
|
||||
value, return the matched portion of TOKEN. If no match is found, return
|
||||
(values nil nil)."
|
||||
(loop for len downfrom (min *longest-non-alpha-operator* (length token)) to 1
|
||||
(loop for len downfrom (min *longest-alpha-operator* (length token)) to 1
|
||||
for cur-test = (subseq token 0 len)
|
||||
for oper-sym = (operator-symbol cur-test)
|
||||
when oper-sym do
|
||||
|
Reference in New Issue
Block a user