https://github.com/suzannesoy/stxparse-info
Tracking bound syntax pattern variables with syntax-parse
https://github.com/suzannesoy/stxparse-info
macros racket-library
Last synced: 5 months ago
JSON representation
Tracking bound syntax pattern variables with syntax-parse
- Host: GitHub
- URL: https://github.com/suzannesoy/stxparse-info
- Owner: SuzanneSoy
- License: other
- Created: 2017-01-22T17:12:01.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-04-04T14:25:09.000Z (about 5 years ago)
- Last Synced: 2024-05-22T01:07:56.836Z (about 2 years ago)
- Topics: macros, racket-library
- Language: Racket
- Homepage:
- Size: 294 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/jsmaniac/stxparse-info)
[](https://codecov.io/gh/jsmaniac/stxparse-info)
[](http://jsmaniac.github.io/travis-stats/#jsmaniac/stxparse-info)
[](http://docs.racket-lang.org/stxparse-info/)
stxparse-info
=============
The module `stxparse-info/parse` is a patched version of `syntax/parse` which
tracks which syntax pattern variables are bound. This allows some libraries to
change the way syntax pattern variables work.
For example, `phc-graph/subtemplate` automatically derives temporary
identifiers when a template contains `yᵢ …`, and `xᵢ` is a pattern
variable. To know from which `varᵢ` the `yᵢ …` identifiers must be derived,
`phc-graph/subtemplate` needs to know which syntax pattern variables are
within scope.
To use this package, simply require `stxparse-info/pares` instead of
`syntax/parse` Additionally, it is possible to use the for-syntax function
`(current-pvars)` from `stxparse-info/current-pvars` to access the list of
currently-bound pattern variables, and the macro `(with-pvars (pvar ...)
. body)` can be used to add new pattern variables to the list.