diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-04-29 19:39:54 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-04-29 19:39:54 -0700 |
commit | 183a3b78908a864d6828a57d059dc4f176ef8a04 (patch) | |
tree | ca9cf7dedfb5988574779c2b53a717b72b7fa8a2 | |
parent | 95d54abcf2f5e83efb7c25879c1c6b9f8d137462 (diff) | |
download | txr-183a3b78908a864d6828a57d059dc4f176ef8a04.tar.gz txr-183a3b78908a864d6828a57d059dc4f176ef8a04.tar.bz2 txr-183a3b78908a864d6828a57d059dc4f176ef8a04.zip |
infix: bug: (a = b) not parsing.
* stdlib.tl (detect-infix): Do not detect a prefix
operator followed by argument, followed by anything whatsoever
as being infix. The pair must be followed by nothing, or
by a non-argument.
* txr.1: Documented.
-rw-r--r-- | stdlib/infix.tl | 3 | ||||
-rw-r--r-- | txr.1 | 24 |
2 files changed, 18 insertions, 9 deletions
diff --git a/stdlib/infix.tl b/stdlib/infix.tl index 5d92f9ce..cd6b265f 100644 --- a/stdlib/infix.tl +++ b/stdlib/infix.tl @@ -243,13 +243,14 @@ (xa (and (not xu) (not (funp env x))))) (or (and xa (or yo yb)) - (and xu ya (neq xu.sym xu.lispsym)) + (and xu ya (neq xu.sym xu.lispsym) (null rest)) (and xu (eq y '**) (eq xu.sym xu.lispsym)) (if-match (@z . @nil) rest (let* ((zu [ifx-uops z]) (zo [ifx-ops z]) (za (and (not zu) (not zo) (not (funp env z))))) (or + (and xu ya (neq xu.sym xu.lispsym) (not za)) (and xu yu (or zu za (eq z '**))) (and xu ya zo)))))))) @@ -54217,13 +54217,19 @@ denotes a prefix (unary) operator; the letter denotes an infix operator and the letter .code A denotes an argument which is not the name of a global function, lexical -function in the current macro environment, or operator. -Additionally, the symbols +function in the current macro environment, or an operator; +and the letter .code f -and -.codn !f , -indicate a prefix operator which, respectively, is and is not, -the name of a global or lexical function. +indicates a prefix operator which is also the name of a +a global or lexical function. +In addition, the two-character sequence +.code !A +denotes any element which is not an argument as defined for +.codn A ; +and the sequence +.code !f +denotes a prefix operator which is not also the name of a global +or lexical function. The patterns which indicate a form for processing via .code parse-infix are: @@ -54245,8 +54251,10 @@ then the parent expression is indicates as infix, otherwise not. Three consecutive leading prefix operators. .coIP "(u u A ...)" Two consecutive leading prefix operators followed by an argument. -.coIP "(u A o ...)" -A prefix operator followed by an argument, followed by an infix +.coIP "(u A)" +A prefix operator followed by an argument, and nothing else. +.coIP "(u A !A ...)" +A prefix operator followed by an argument, followed by a non-argument. operator. .coIP "(!f A ...)" A prefix operator which is not also the name of a global or lexical function, |