diff --git a/collects/honu/core/main.rkt b/collects/honu/core/main.rkt index abd72ad0bf..abc569e69f 100644 --- a/collects/honu/core/main.rkt +++ b/collects/honu/core/main.rkt @@ -17,10 +17,11 @@ [honu-+ +] [honu-- -] [honu-* *] [honu-/ /] [honu-^ ^] + [honu-flow \|] [honu-dot |.|] [honu-cons ::] - [honu-and and] - [honu-or or] + [honu-and and] [honu-and &&] + [honu-or or] [honu-or \|\|] [honu-structure structure] [literal:honu-= =] [literal:semicolon |;|] diff --git a/collects/honu/core/private/honu2.rkt b/collects/honu/core/private/honu2.rkt index c0a0188ddf..7f74e6e9ba 100644 --- a/collects/honu/core/private/honu2.rkt +++ b/collects/honu/core/private/honu2.rkt @@ -97,13 +97,15 @@ (cond [(honu-struct? left*) (let ([use (honu-struct-get left*)]) (use left* 'right))] - [else (error 'dot "don't know how to deal with ~a" 'left)])) - #; - #'(let ([left* left]) - (cond - [(list? left*) - (list-ref left* right)] - [else (error 'dot "don't know how to deal with ~a and ~a" 'left 'right)]))))) + ;; possibly handle other types of data + [else (error 'dot "don't know how to deal with ~a" 'left)]))))) + +(provide honu-flow) +(define-honu-operator/syntax honu-flow 0.001 'left + (lambda (left right) + (with-syntax ([left left] + [right right]) + #'(right left)))) (define-binary-operator honu-+ 1 'left +) (define-binary-operator honu-- 1 'left -) diff --git a/collects/honu/core/private/parse2.rkt b/collects/honu/core/private/parse2.rkt index 524ef606aa..d6558e787b 100644 --- a/collects/honu/core/private/parse2.rkt +++ b/collects/honu/core/private/parse2.rkt @@ -250,11 +250,11 @@ (if current (let () (debug "function call ~a\n" left) - (values (left (with-syntax ([current current] + (define call (left (with-syntax ([current current] [(parsed-args ...) (parse-comma-expression #'(args ...)) ]) - #'(current parsed-args ...))) - #'(rest ...))) + #'(current parsed-args ...)))) + (do-parse #'(rest ...) precedence left call)) (let () (debug "inner expression ~a\n" #'(args ...)) (define-values (inner-expression unparsed) (parse #'(args ...))) diff --git a/collects/honu/core/read.rkt b/collects/honu/core/read.rkt index 2603cb49bd..3f40ee47f9 100644 --- a/collects/honu/core/read.rkt +++ b/collects/honu/core/read.rkt @@ -33,7 +33,7 @@ (define-lex-abbrev string-character (:or (:: #\\ any-char) (:~ #\"))) (define-lex-abbrev string (:: #\" (:* string-character) #\")) -(define-lex-abbrev operator (:or "+" "=" "*" "/" "-" "^")) +(define-lex-abbrev operator (:or "+" "=" "*" "/" "-" "^" "||" "|" "&&")) (define-lex-abbrev block-comment (:: "/*" (complement (:: any-string "*/" any-string)) "*/"))