-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#lang info | ||
|
||
(define license 'BSD-3-Clause) | ||
(define collection "koyo") | ||
(define deps | ||
'("base" | ||
"review")) | ||
(define review-exts | ||
'((koyo/review should-review-syntax? review-syntax))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#lang racket/base | ||
|
||
(require review/ext | ||
syntax/parse/pre) | ||
|
||
#|review: ignore|# | ||
|
||
(provide | ||
should-review-syntax? | ||
review-syntax) | ||
|
||
(define (should-review-syntax? stx) | ||
(syntax-case stx (define-option) | ||
[(define-option . _rest) #t] | ||
[_ #f])) | ||
|
||
(define-syntax-class option-definition | ||
#:datum-literals (define-option) | ||
(pattern (define-option id:id | ||
{~optional {~seq #:default _default-expr:expression}} | ||
{~do (push-scope)} | ||
_body:expression ... | ||
{~do (pop-scope)}) | ||
#:do [(track-binding #'id "~a" #:check-usages? #f)])) | ||
|
||
(define (review-syntax stx) | ||
(syntax-parse stx | ||
[c:option-definition #'c] | ||
[_ (track-error stx "expected a option definition")])) |