Commit Graph

73 Commits

Author SHA1 Message Date
Georges Dupéron
f2585febff Merge Racket ≤ 6.11 and Racket ≥ 6.12, using version-case (part 3: add dispatch files which include the 6.11 or 6.12 files) 2018-03-26 08:56:15 +02:00
Georges Dupéron
2d866bec01 Merge Racket ≤ 6.11 and Racket ≥ 6.12, using version-case (part 2: add old 6.11 files) 2018-03-26 01:10:20 +02:00
Georges Dupéron
3083001da9 Merge Racket ≤ 6.11 and Racket ≥ 6.12, using version-case (part 1: rename 6.12 files) 2018-03-25 23:58:43 +02:00
Georges Dupéron
025c25338f Merge Racket ≤ 6.12 and Racket ≥ 7 versions using version-case 2018-03-25 23:49:32 +02:00
Georges Dupéron
472033aa24 Fixed incompatibility with Racket 7 which lacks syntax-local-get-shadower 2018-03-25 20:48:14 +02:00
Georges Dupéron
cecabd982f Revert "Fixed incompatibility with Racket 7 which lacks syntax-local-get-shadower"
This reverts commit 250a787151.
2018-03-25 20:44:50 +02:00
Georges Dupéron
250a787151 Fixed incompatibility with Racket 7 which lacks syntax-local-get-shadower 2018-03-25 01:58:17 +01:00
Georges Dupéron
43c61290e9 Only build v6.12 in Travis~ 2018-01-18 18:46:21 +01:00
Georges Dupéron
95dc8b124d Added docs for new identifiers after cherry-pick. 2018-01-18 17:56:44 +01:00
Ryan Culpepper
40bfaced34 syntax/parse: add unwindable state: syntax-parse-state-{ref,set!,...} 2018-01-18 17:25:30 +01:00
Ryan Culpepper
785ffdacce syntax/parse: remove some absolute paths related to lazy-require-syntax
Since the previous version of this code was first written, Racket's
requirements seem to have relaxed---but not completely!

If *all* related module paths are made relative, then the deps
test case breaks (but only the test is pre-compiled ?!!).

If requires from disappearing module(s) to residual module(s)
use absolute module paths, it seems to work.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
c913d14d7c syntax/parse: use lazy-require-syntax 2018-01-18 16:59:26 +01:00
Alexis King
e4d1bbc473 syntax/parse: Arrange for built-in macro’s names to be preserved
The dance that syntax/parse performs to lazily load its implementation
rewrites uses of syntax/parse macros in such a way that their original
names were discarded, which shows up in error messages. By simply
invoking the underlying transformer directly in the proxy macro instead
of expanding to a rewritten use, users’ names can be preserved.

fixes #1909
2018-01-18 16:59:26 +01:00
Ryan Culpepper
bf47b22091 syntax/parse: make undo cooperate with ~commit and ~! (cut) 2018-01-18 16:59:26 +01:00
Ryan Culpepper
c61353a0f8 syntax/parse: add ~undo, #:undo for unwinding effects
Note: this version doesn't work with ~commit or ~!, because
it stores both choice points and undo actions in the failure
continuation. Commit and cut should discard choice points but
preserve undo actions.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
9180a7dd19 syntax/parse template: add datum-template 2018-01-18 16:59:26 +01:00
Ryan Culpepper
bbde8031a9 syntax/parse template: move quasitemplate support to pre-pass
Note: quasisyntax has a bug: #`(... (1 2 #,@(list 3) 4)).
Within an escape, no way to express splicing desugaring.
So add a private variant of ?@ that is interpreted even escaped.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
30eb04cf43 syntax/parse template: separate guide for re-syntax
Make datum->syntax explicit in guide rather than combined with
constructors like t-cons/x and t-dots (conditional).
This will make datum support easier, later.
For now, it makes it easier to do relocate correctly.

Also, make t-metafun, h-splice inlinable.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
1f58e97282 syntax/parse template: add simple ellipsis special case 2018-01-18 16:59:26 +01:00
Ryan Culpepper
5eac499ec4 syntax/parse template: compile = datum->syntax
Change guide reps to coincide with expressions for template compilation.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
1e0eb983a9 syntax/parse template: reorganize code, update comments 2018-01-18 16:59:26 +01:00
Ryan Culpepper
f8e01d52c6 syntax/parse template: encourage inlining of template combinators
With inlining, the optimizer can turn templates into mostly
first-order code.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
034cde0a97 syntax/parse template: track syntax vs non-syntax pairs in template
Allows generation of more specialized code (hopefully smaller
and faster).

Also clean up some other guide reps.
2018-01-18 16:59:26 +01:00
Ryan Culpepper
a827322128 syntax/parse template: change run-time strategy
Instead of doing run-time interpretation of a "guide" tree,
generate code for procedure (using stx -> stx combinators).
2018-01-18 16:59:10 +01:00
Ryan Culpepper
1795b7af5f syntax/parse template: remove syntax-property handling
Since template was written, Racket has added a notion of preserved
syntax properties.
2018-01-18 15:01:28 +01:00
Ryan Culpepper
f97039fb1f syntax/parse: improve stxclass arity mismatch error messages 2018-01-18 15:01:16 +01:00
Ryan Culpepper
f238a16fbc syntax/parse: add ~or* and ~alt, like ~or{S,H} and ~or{EH}, respectively 2018-01-18 14:59:28 +01:00
Ryan Culpepper
fc25ef0323 support string, bytes (bindings from racket) as stxclass refs
add compile-time table as alternative to stxclass binding
2018-01-18 14:58:31 +01:00
Ryan Culpepper
2c1a36f55f syntax/parse: clean up "at"/"within"-term handling
Added comments and examples about "at" and "within" terms
Fixed ps->stx+index bugs related to struct and vector patterns
2018-01-18 14:56:26 +01:00
Ryan Culpepper
2de80c8091 syntax/parse: fix ps->stx+index; fixes #1602
Collapse CDR frames separated by ORD, POST, etc. For example,
(1 ORD 2 stx) should be same as (3 stx).
2018-01-18 14:56:09 +01:00
Georges Dupéron
6ac55c8e72 Applied changes requested by @rmculpepper for PR #1587 2018-01-18 14:55:58 +01:00
Georges Dupéron
2aece162a9 Fixes several issues with syntax/parse, and adds some tests.
* byte-regexp? values should not be considered 3D syntax.
* hash? values are now allowed in serialized syntax properties with (template … #:properties (…))
* marshalling properties which were prefab structs called map on the result of struct->vector, changed it to struct->list as the struct "name" is always serializable.
2018-01-18 14:54:40 +01:00
Georges Dupéron
1b4cb7722e Tweak title to include mentions of syntax-parse and syntax-case. 2017-12-21 23:25:27 +01:00
Matthew Butterick
164df4a597
Shorten title
The title is currently the longest in Racketland, and doesn’t display well on the TOC of the docs.
2017-12-18 10:42:30 -08:00
Georges Dupéron
c5df776e82 Partial inclusion of upstream changes, to avoid a compilation error. 2017-09-01 13:55:02 +02:00
Georges Dupéron
b564f76228 Added reference to the new syntax/parse bindings ~or* and ~alt 2017-06-30 12:32:26 +02:00
Georges Dupéron
dcc3f1d758 Fixed error message 2017-06-08 23:46:39 +02:00
Georges Dupéron
bb7b5e9a7d Documented all overridden identifiers. 2017-02-07 23:09:56 +01:00
Georges Dupéron
1d529a3065 Added docs for define-template-metafunction 2017-02-04 07:34:55 +01:00
Georges Dupéron
23c221f862 Improved documentation 2017-02-04 04:31:22 +01:00
Georges Dupéron
8b2fa5e5c2 Fixed typo #%intef-begin → #%intdef-begin 2017-02-03 15:34:12 +01:00
Georges Dupéron
21ee81c841 Require auto-syntax-e in residual. Provide template-metafunction? 2017-02-03 10:17:55 +01:00
Georges Dupéron
40b7e813e7 Disable code coverage, as it does not work on this repo 2017-02-01 08:11:18 +01:00
Georges Dupéron
25ed9ec068 Integrate auto-syntax-e, as this needs a deep modification in the syntax-mapping struct 2017-02-01 08:01:18 +01:00
Georges Dupéron
0029c1acbf Fixed define-pvars (was not defining the unique-at-runtime variables) 2017-01-28 05:17:32 +01:00
Georges Dupéron
81a05e6ff3 Improved coverage 2017-01-28 05:17:00 +01:00
Georges Dupéron
82547e2960 Run tests properly (without -x), and avoid OOM on Travis. 2017-01-28 05:17:00 +01:00
Georges Dupéron
c259afbe61 Removed parse/private/keywords.rkt, to improve compatibility with the official syntax/parse (that file defines ~optional etc.) 2017-01-28 05:16:59 +01:00
Georges Dupéron
bff27464a9 Bugfix and tests for define/with-syntax 2017-01-28 05:16:58 +01:00
Georges Dupéron
ad27231d00 Support #:properties on all four of (quasi)template(/loc), instead of just template. 2017-01-28 05:16:57 +01:00