better regexp

pull/2/head
Matthew Butterick 8 years ago
parent 87f5b186a2
commit feec0f85d5

@ -91,8 +91,7 @@
;; angles indicate splicing. set splice value to #t ;; angles indicate splicing. set splice value to #t
[(RULE_HEAD_HIDDEN pattern) [(RULE_HEAD_HIDDEN pattern)
(begin (begin
(begin (define trimmed (regexp-match #px"<(.+)>\\s*:$" $1))
(define trimmed (cadr (regexp-match #px"<(\\w+)>\\s*:$" $1)))
(rule (position->pos $1-start-pos) (rule (position->pos $1-start-pos)
(position->pos $2-end-pos) (position->pos $2-end-pos)
(lhs-id (position->pos $1-start-pos) (lhs-id (position->pos $1-start-pos)
@ -102,7 +101,7 @@
(position-col $1-start-pos)) (position-col $1-start-pos))
trimmed trimmed
#t) #t)
$2)))]] $2))]]
[pattern [pattern
[(implicit-pattern-sequence PIPE pattern) [(implicit-pattern-sequence PIPE pattern)

Loading…
Cancel
Save