X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fparser.scm;h=5da6bc9f8c6c8c0ee8dd0f38a68891abfa2eca67;hp=305f43d2ca49e6f7d080f0766a181f1e8de34a04;hb=ccbe2f18eb338a77b9a1986a3a36c7c9af07389c;hpb=136ce3b725c83af0b7e8be632e943de6b07b65c5 diff --git a/mudsync/parser.scm b/mudsync/parser.scm index 305f43d..5da6bc9 100644 --- a/mudsync/parser.scm +++ b/mudsync/parser.scm @@ -81,26 +81,26 @@ (sre->irregex `(: (? (: ,preposition (+ space))) ; possibly a preposition (ignored) (? (: ,article (+ space))) ; possibly an article (ignored) - (=> direct-obj (* any))))) ; direct object (kept) + (=> direct-obj (+ any))))) ; direct object (kept) (define (cmatch-direct-obj phrase) (match-to-kwargs direct-irx phrase)) (define (cmatch-empty phrase) - (if (equal? (string-trim phrase) ")") + (if (equal? (string-trim phrase) "") '() #f)) (define (cmatch-direct-obj-greedy phrase) ;; Turns out this uses the same semantics as splitting verb/rest - (match (split-verb-and-rest string) + (match (split-verb-and-rest phrase) ((direct-obj . rest) (list #:direct-obj direct-obj #:rest rest)) (#f #f))) (define (cmatch-greedy phrase) - `((line . ,phrase))) + `(#:phrase ,phrase)) ;; (define say-example "say I really need to get going.") ;; (define attack-sword-example "hit goblin with sword")