|
|
@ -170,18 +170,18 @@
|
|
|
|
[(and range? max) (string->number max)]
|
|
|
|
[(and range? max) (string->number max)]
|
|
|
|
[(and (not range?) (not max)) (if (zero? min)
|
|
|
|
[(and (not range?) (not max)) (if (zero? min)
|
|
|
|
#f ; {} -> {0,}
|
|
|
|
#f ; {} -> {0,}
|
|
|
|
min))] ; {3} -> {3,3}
|
|
|
|
min)] ; {3} -> {3,3}
|
|
|
|
[else #f])])
|
|
|
|
[else #f])])
|
|
|
|
(cons min max))]))]
|
|
|
|
(cons min max))]))]
|
|
|
|
[else (raise-argument-error 'grammar-parse "unknown repetition operator" $2)]))
|
|
|
|
[else (raise-argument-error 'grammar-parse "unknown repetition operator" $2)]))
|
|
|
|
(pattern-repeat (position->pos $1-start-pos)
|
|
|
|
(pattern-repeat (position->pos $1-start-pos)
|
|
|
|
(position->pos $2-end-pos)
|
|
|
|
(position->pos $2-end-pos)
|
|
|
|
min-repeat max-repeat $1
|
|
|
|
min-repeat max-repeat $1
|
|
|
|
#f))]
|
|
|
|
#f))]
|
|
|
|
[(atomic-pattern)
|
|
|
|
[(atomic-pattern)
|
|
|
|
$1]]
|
|
|
|
$1]]
|
|
|
|
|
|
|
|
|
|
|
|
[atomic-pattern
|
|
|
|
[atomic-pattern
|
|
|
|
[(LIT)
|
|
|
|
[(LIT)
|
|
|
|
(pattern-lit (position->pos $1-start-pos)
|
|
|
|
(pattern-lit (position->pos $1-start-pos)
|
|
|
|
(position->pos $1-end-pos)
|
|
|
|
(position->pos $1-end-pos)
|
|
|
@ -222,7 +222,7 @@
|
|
|
|
'splice))]])
|
|
|
|
'splice))]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(error (lambda (tok-ok? tok-name tok-value start-pos end-pos)
|
|
|
|
(error (lambda (tok-ok? tok-name tok-value start-pos end-pos)
|
|
|
|
((current-parser-error-handler) tok-ok? tok-name tok-value (position->pos start-pos) (position->pos end-pos))))))
|
|
|
|
((current-parser-error-handler) tok-ok? tok-name tok-value (position->pos start-pos) (position->pos end-pos))))))
|
|
|
|
|
|
|
|
|
|
|
|
;; relocate-pattern: pattern -> pattern
|
|
|
|
;; relocate-pattern: pattern -> pattern
|
|
|
|