From: Chris Hanson Date: Thu, 2 Aug 2007 16:54:42 +0000 (+0000) Subject: Fix some thinkos in graph parsing. X-Git-Tag: 20090517-FFI~478 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8266160202cef28bd53fd2c65a8c191f4599feb6;p=mit-scheme.git Fix some thinkos in graph parsing. --- diff --git a/v7/src/xml/turtle.scm b/v7/src/xml/turtle.scm index 6a7f19738..6859f7ebd 100644 --- a/v7/src/xml/turtle.scm +++ b/v7/src/xml/turtle.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: turtle.scm,v 1.25 2007/08/02 04:44:19 cph Exp $ +$Id: turtle.scm,v 1.26 2007/08/02 16:54:42 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -51,20 +51,23 @@ USA. (discard-parser-buffer-head! buffer) (let loop ((items '())) (if (peek-parser-buffer-char buffer) - (let ((item (parse-turtle-item buffer))) + (let ((v (parse-turtle-item buffer))) + (if (not v) + (parser-buffer-error buffer "Expected subject")) (parse:ws* buffer) - (loop (cons item items))) + (loop (cons (vector-ref v 0) items))) (reverse! items)))) (define (parse-turtle-item buffer) (let ((v (or (parse:directive buffer) - (parse:triples buffer) - (parser-buffer-error buffer "Expected subject")))) - (parse:ws* buffer) - (if (not (match-parser-buffer-char buffer #\.)) - (parser-buffer-error buffer "Expected dot")) - (vector-ref v 0))) + (parse:triples buffer)))) + (and v + (begin + (parse:ws* buffer) + (if (not (match-parser-buffer-char buffer #\.)) + (parser-buffer-error buffer "Expected dot")) + v)))) (define parse:directive (*parser