From 78881e13687fd425b69f9318e7ff32c970b964f9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 24 Sep 2008 21:23:26 -0500 Subject: [PATCH] Better error message with invalid tuple literals --- basis/debugger/debugger.factor | 2 ++ core/classes/tuple/parser/parser.factor | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index b7fd34c5be..20e0703ce0 100755 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -323,3 +323,5 @@ M: bad-effect summary drop "Bad stack effect declaration" ; M: bad-escape summary drop "Bad escape code" ; + +M: bad-literal-tuple summary drop "Bad literal tuple" ; diff --git a/core/classes/tuple/parser/parser.factor b/core/classes/tuple/parser/parser.factor index c190ce85e7..dd78b4ba3e 100644 --- a/core/classes/tuple/parser/parser.factor +++ b/core/classes/tuple/parser/parser.factor @@ -63,11 +63,14 @@ ERROR: invalid-slot-name name ; : parse-slot-value ( -- ) scan scan-object 2array , scan "}" assert= ; +ERROR: bad-literal-tuple ; + : (parse-slot-values) ( -- ) parse-slot-value scan { { "{" [ (parse-slot-values) ] } { "}" [ ] } + [ bad-literal-tuple ] } case ; : parse-slot-values ( -- ) @@ -86,4 +89,5 @@ ERROR: invalid-slot-name name ; { "f" [ \ } parse-until boa>tuple ] } { "{" [ parse-slot-values assoc>tuple ] } { "}" [ new ] } + [ bad-literal-tuple ] } case ;