hide-top-rule-name
Matthew Butterick 7 years ago
parent b99869ca40
commit 7bf128c0cd

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

Loading…
Cancel
Save