
Changed backtracking algorithm, runtime representations - syntax classes, ~describe no longer implicitly commit - ~describe no longer delimits effect of cut Added keyword & optional args for stxclasses Added ~do and #:do, ~post, ~commit and #:commit, ~delimit-cut and #:no-delimit-cut Added syntax/parse/debug, syntax/parse/experimental/* - expr/c for contracting macro sub-expressions moved from syntax/parse to syntax/parse/experimental/contract - syntax class reflection (~reflect, ~splicing-reflect) - eh-alternative-sets (~eh-var) - provide-syntax-class/contract (only for params, not attrs so far) Changed ~fail to not include POST progress (#:fail still does) old (~fail _) is now (~post (~fail _)) Made msg argument of ~fail optional Removed generic "repetition constraint violated" msg Removed atom-in-list stxclass Removed unnecessary datum->syntax on cdr of pair pattern massive improvements to long-list microbenchmarks Optimization: integrable syntax classes (id, expr, keyword) need better measurements Optimization: ad hoc elimination of head/tail choice point for (EH ... . ()) patterns Added unstable/wrapc (proc version of expr/c)
38 lines
862 B
Racket
38 lines
862 B
Racket
#lang racket/base
|
|
(require (for-syntax racket/base))
|
|
|
|
;; == Keywords
|
|
|
|
(define-syntax-rule (define-keyword name)
|
|
(begin
|
|
(provide name)
|
|
(define-syntax name
|
|
(lambda (stx)
|
|
(raise-syntax-error #f "keyword used out of context" stx)))))
|
|
|
|
(define-keyword pattern)
|
|
(define-keyword ~var)
|
|
(define-keyword ~datum)
|
|
(define-keyword ~literal)
|
|
(define-keyword ~and)
|
|
(define-keyword ~or)
|
|
(define-keyword ~not)
|
|
(define-keyword ~seq)
|
|
(define-keyword ~between)
|
|
(define-keyword ~once)
|
|
(define-keyword ~optional)
|
|
(define-keyword ~rest)
|
|
(define-keyword ~describe)
|
|
(define-keyword ~!)
|
|
(define-keyword ~bind)
|
|
(define-keyword ~fail)
|
|
(define-keyword ~parse)
|
|
(define-keyword ~do)
|
|
(define-keyword ...+)
|
|
(define-keyword ~delimit-cut)
|
|
(define-keyword ~commit)
|
|
(define-keyword ~reflect)
|
|
(define-keyword ~splicing-reflect)
|
|
(define-keyword ~post)
|
|
(define-keyword ~eh-var)
|