Moved regexp-match/c and id/c to phc-toolkit
This commit is contained in:
parent
0b2b8b925d
commit
6db01589c6
17
main.rkt
17
main.rkt
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
(require phc-toolkit/typed-untyped)
|
(require phc-toolkit/typed-untyped)
|
||||||
(define-typed/untyped-modules #:no-test
|
(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
|
multi-id
|
||||||
"caret-identifier.rkt"
|
"caret-identifier.rkt"
|
||||||
"infinity-identifier.rkt"
|
"infinity-identifier.rkt"
|
||||||
|
@ -25,8 +26,9 @@
|
||||||
(rename-in syntax/parse
|
(rename-in syntax/parse
|
||||||
[...+ …+])
|
[...+ …+])
|
||||||
syntax/parse/experimental/template
|
syntax/parse/experimental/template
|
||||||
syntax/stx
|
(subtract-in syntax/stx phc-toolkit/untyped)
|
||||||
type-expander/expander)
|
type-expander/expander
|
||||||
|
phc-toolkit/untyped)
|
||||||
(for-meta 2 racket/base)
|
(for-meta 2 racket/base)
|
||||||
(for-meta 2 syntax/parse))
|
(for-meta 2 syntax/parse))
|
||||||
|
|
||||||
|
@ -49,14 +51,7 @@
|
||||||
(define */rx #px"^(.*?)⃰$")
|
(define */rx #px"^(.*?)⃰$")
|
||||||
(define +/rx #px"^(.*?)([⁰¹²³⁴⁵⁶⁷⁸⁹]*)⁺$")
|
(define +/rx #px"^(.*?)([⁰¹²³⁴⁵⁶⁷⁸⁹]*)⁺$")
|
||||||
(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-number/c (regexp-match/c number/rx))
|
||||||
(define string-superscript-*/c (regexp-match/c */rx))
|
(define string-superscript-*/c (regexp-match/c */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