From 3848eeadb1e28ec26268e4a98812f2b85fa2894a Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 22 Apr 2007 18:14:52 +0200 Subject: [PATCH] 7.1.5 --- TEST | 32 ++++++++++++++++---------------- parse.lisp | 26 +++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/TEST b/TEST index 02486d0..fdf4fbe 100644 --- a/TEST +++ b/TEST @@ -816,25 +816,25 @@ 309: PASS: RNG-ERROR 310: PASS: RNG-ERROR 311: PASS: RNG-ERROR -312: FAIL: didn't detect invalid schema -313: FAIL: didn't detect invalid schema -314: FAIL: didn't detect invalid schema -315: FAIL: didn't detect invalid schema -316: FAIL: didn't detect invalid schema -317: FAIL: didn't detect invalid schema -318: FAIL: didn't detect invalid schema -319: FAIL: didn't detect invalid schema -320: FAIL: didn't detect invalid schema -321: FAIL: didn't detect invalid schema +312: PASS: RNG-ERROR +313: PASS: RNG-ERROR +314: PASS: RNG-ERROR +315: PASS: RNG-ERROR +316: PASS: RNG-ERROR +317: PASS: RNG-ERROR +318: PASS: RNG-ERROR +319: PASS: RNG-ERROR +320: PASS: RNG-ERROR +321: PASS: RNG-ERROR 322: FAIL: didn't detect invalid schema 323: FAIL: didn't detect invalid schema -324: FAIL: didn't detect invalid schema -325: FAIL: didn't detect invalid schema -326: FAIL: didn't detect invalid schema -327: FAIL: didn't detect invalid schema +324: PASS: RNG-ERROR +325: PASS: RNG-ERROR +326: PASS: RNG-ERROR +327: PASS: RNG-ERROR 328: PASS 328-1.v: PASS -329: FAIL: didn't detect invalid schema +329: PASS: RNG-ERROR 330: PASS 330-1.v: PASS 331: PASS @@ -900,4 +900,4 @@ 372-1.v: PASS 373: PASS 373-1.i: PASS: RNG-ERROR -Passed 836/902 tests. +Passed 851/902 tests. diff --git a/parse.lisp b/parse.lisp index deaad79..6f64d68 100644 --- a/parse.lisp +++ b/parse.lisp @@ -1275,6 +1275,8 @@ (rng-error nil "attribute in list not allowed")) (when *in-data-except-p* (rng-error nil "attribute in data/except not allowed")) + (when *in-start-p* + (rng-error nil "attribute in start not allowed")) (let ((*in-attribute-p* t)) (check-restrictions (pattern-child pattern)))) @@ -1289,12 +1291,18 @@ (defmethod check-restrictions ((pattern one-or-more)) (when *in-data-except-p* (rng-error nil "oneOrMore in data/except not allowed")) + (when *in-start-p* + (rng-error nil "one-or-more in start not allowed")) (let ((*in-one-or-more-p* t)) (check-restrictions (pattern-child pattern)))) (defmethod check-restrictions ((pattern group)) (when *in-data-except-p* (rng-error nil "group in data/except not allowed")) + (when *in-start-p* + (rng-error nil "group in start not allowed")) + (when *in-start-p* + (rng-error nil "interleave in start not allowed")) (let ((*in-one-or-more//group-or-interleave-p* *in-one-or-more-p*)) (check-restrictions (pattern-a pattern)) @@ -1316,22 +1324,34 @@ (when *in-data-except-p* (rng-error nil "list in data/except not allowed")) (let ((*in-list-p* t)) - (check-restrictions (pattern-child pattern)))) + (check-restrictions (pattern-child pattern))) + (when *in-start-p* + (rng-error nil "list in start not allowed"))) (defmethod check-restrictions ((pattern text)) (when *in-list-p* (rng-error nil "text in list not allowed")) (when *in-data-except-p* - (rng-error nil "text in data/except not allowed"))) + (rng-error nil "text in data/except not allowed")) + (when *in-start-p* + (rng-error nil "text in start not allowed"))) (defmethod check-restrictions ((pattern data)) + (when *in-start-p* + (rng-error nil "data in start not allowed")) (when (pattern-except pattern) (let ((*in-data-except-p* t)) (check-restrictions (pattern-except pattern))))) +(defmethod check-restrictions ((pattern value)) + (when *in-start-p* + (rng-error nil "value in start not allowed"))) + (defmethod check-restrictions ((pattern empty)) (when *in-data-except-p* - (rng-error nil "empty in data/except not allowed"))) + (rng-error nil "empty in data/except not allowed")) + (when *in-start-p* + (rng-error nil "empty in start not allowed"))) (defmethod check-restrictions ((pattern %parent)) (check-restrictions (pattern-child pattern))) -- 2.11.4.GIT