Tracking bound syntax pattern variables with syntax-parse
Go to file
2017-01-28 05:16:48 +01:00
case Modified syntax-case & friends to use with-pvars. Closes 181 current-pvars: use in syntax-case, with-syntax, define/with-syntax, is there any with-parse? 2017-01-28 05:16:48 +01:00
parse Attempt to fix residual bug 2017-01-28 05:16:42 +01:00
scribblings Modified syntax-case & friends to use with-pvars. Closes 181 current-pvars: use in syntax-case, with-syntax, define/with-syntax, is there any with-parse? 2017-01-28 05:16:48 +01:00
test Support for define/syntax-parse, including when there are multiple defines. Search for the most up-to-date list of current-pvars is done by performing a dichotomy over a set of sequentially numbered current-pvars-paramNNN. Closes FB case 180. 2017-01-28 05:16:41 +01:00
.gitignore Added package files 2017-01-28 05:16:16 +01:00
.travis.yml Don't run versions < 6.3, as recent implementations of syntax-parse seem to have some small incompatibilities (e.g. racket/struct is missing from old Racket versions) 2017-01-28 05:16:40 +01:00
case.rkt Modified syntax-case & friends to use with-pvars. Closes 181 current-pvars: use in syntax-case, with-syntax, define/with-syntax, is there any with-parse? 2017-01-28 05:16:48 +01:00
current-pvars.rkt Documented define-pvars; Add the identifiers in reverse order as noted in the documentation. 2017-01-28 05:16:43 +01:00
info.rkt Fallback for v6.3 which lacks scribble/example 2017-01-28 05:16:44 +01:00
LICENSE Imported files from 28f1df4cff 2017-01-28 05:16:11 +01:00
LICENSE.txt Added package files 2017-01-28 05:16:16 +01:00
main.rkt Implemented current-pvars 2017-01-28 05:16:36 +01:00
parse.rkt Changed syntax/parse module paths to stxparse-info/parse 2017-01-28 05:16:33 +01:00
README.md Bugfix: with-pvars must be called after binding the pvar, not before. 2017-01-28 05:16:38 +01:00

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.