Moved regexp-match/c and id/c to phc-toolkit
This commit is contained in:
parent
0b2b8b925d
commit
6db01589c6
15
main.rkt
15
main.rkt
|
@ -2,7 +2,8 @@
|
|||
|
||||
(require phc-toolkit/typed-untyped)
|
||||
(define-typed/untyped-modules #:no-test
|
||||
(require (only-in type-expander define-type-expander)
|
||||
(require racket/require
|
||||
(only-in type-expander define-type-expander)
|
||||
multi-id
|
||||
"caret-identifier.rkt"
|
||||
"infinity-identifier.rkt"
|
||||
|
@ -25,8 +26,9 @@
|
|||
(rename-in syntax/parse
|
||||
[...+ …+])
|
||||
syntax/parse/experimental/template
|
||||
syntax/stx
|
||||
type-expander/expander)
|
||||
(subtract-in syntax/stx phc-toolkit/untyped)
|
||||
type-expander/expander
|
||||
phc-toolkit/untyped)
|
||||
(for-meta 2 racket/base)
|
||||
(for-meta 2 syntax/parse))
|
||||
|
||||
|
@ -50,13 +52,6 @@
|
|||
(define +/rx #px"^(.*?)([⁰¹²³⁴⁵⁶⁷⁸⁹]*)⁺$")
|
||||
(define -/rx #px"^(.*?)([⁰¹²³⁴⁵⁶⁷⁸⁹]*)⁻([⁰¹²³⁴⁵⁶⁷⁸⁹]*)$")
|
||||
|
||||
(define (regexp-match/c rx)
|
||||
(and/c string? (λ (s) (regexp-match? rx s))))
|
||||
|
||||
(define (id/c id)
|
||||
(and/c identifier? (λ (i) (free-identifier=? i id))))
|
||||
|
||||
|
||||
(define string-superscript-number/c (regexp-match/c number/rx))
|
||||
(define string-superscript-*/c (regexp-match/c */rx))
|
||||
(define string-superscript-+/c (regexp-match/c +/rx))
|
||||
|
|
Loading…
Reference in New Issue
Block a user