Friendlier grouping/clumping error message
parent
1cdd080445
commit
40ca3fc7f3
|
@ -10,7 +10,7 @@ classes compiler.units generic.standard generic.single vocabs
|
||||||
init kernel.private io.encodings accessors math.order
|
init kernel.private io.encodings accessors math.order
|
||||||
destructors source-files parser classes.tuple.parser
|
destructors source-files parser classes.tuple.parser
|
||||||
effects.parser lexer generic.parser strings.parser vocabs.loader
|
effects.parser lexer generic.parser strings.parser vocabs.loader
|
||||||
vocabs.parser source-files.errors ;
|
vocabs.parser source-files.errors grouping ;
|
||||||
IN: debugger
|
IN: debugger
|
||||||
|
|
||||||
GENERIC: error-help ( error -- topic )
|
GENERIC: error-help ( error -- topic )
|
||||||
|
@ -220,6 +220,8 @@ M: slice-error summary
|
||||||
|
|
||||||
M: bounds-error summary drop "Sequence index out of bounds" ;
|
M: bounds-error summary drop "Sequence index out of bounds" ;
|
||||||
|
|
||||||
|
M: groups-error summary drop "Non positive group size" ;
|
||||||
|
|
||||||
M: condition error. error>> error. ;
|
M: condition error. error>> error. ;
|
||||||
|
|
||||||
M: condition summary error>> summary ;
|
M: condition summary error>> summary ;
|
||||||
|
|
|
@ -4,6 +4,7 @@ USING: kernel math math.order strings arrays vectors sequences
|
||||||
sequences.private accessors fry combinators ;
|
sequences.private accessors fry combinators ;
|
||||||
IN: grouping
|
IN: grouping
|
||||||
|
|
||||||
|
ERROR: groups-error seq group-size ;
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
MIXIN: chunking
|
MIXIN: chunking
|
||||||
|
@ -53,8 +54,8 @@ M: abstract-clumps group@
|
||||||
|
|
||||||
TUPLE: chunking-seq { seq read-only } { n read-only } ;
|
TUPLE: chunking-seq { seq read-only } { n read-only } ;
|
||||||
|
|
||||||
: check-groups ( n -- n )
|
: check-groups ( seq n -- seq n )
|
||||||
dup 0 <= [ "Invalid group count" throw ] when ; inline
|
dup 0 <= [ groups-error ] when ; inline
|
||||||
|
|
||||||
: new-groups ( seq n class -- groups )
|
: new-groups ( seq n class -- groups )
|
||||||
[ check-groups ] dip boa ; inline
|
[ check-groups ] dip boa ; inline
|
||||||
|
|
Loading…
Reference in New Issue