diff --git a/docs/examples/frankenstein/bigwords.vore b/docs/examples/frankenstein/bigwords.vore index 61fa4be..a0e7f34 100644 --- a/docs/examples/frankenstein/bigwords.vore +++ b/docs/examples/frankenstein/bigwords.vore @@ -1,2 +1 @@ -find all - at least 8 letter \ No newline at end of file +find all word start at least 8 letter word end \ No newline at end of file diff --git a/docs/examples/frankenstein/specificSizedWords.vore b/docs/examples/frankenstein/specificSizedWords.vore new file mode 100644 index 0000000..91de76f --- /dev/null +++ b/docs/examples/frankenstein/specificSizedWords.vore @@ -0,0 +1,2 @@ +find all word start exactly 8 letter word end +--find all word start letter letter letter letter letter letter letter letter word end \ No newline at end of file diff --git a/libvore/generate.go b/libvore/generate.go index e52b927..3e1a912 100644 --- a/libvore/generate.go +++ b/libvore/generate.go @@ -171,6 +171,14 @@ func (l *AstLoop) generate(offset int, state *GenState) ([]SearchInstruction, er return []SearchInstruction{}, gen_error } + if l.min == l.max { + result := []SearchInstruction{} + for i := 0; i < l.max; i++ { + result = append(result, body...) + } + return result, nil + } + id := rand.Int63() start := StartLoop{