Commit Graph

459 Commits

Author SHA1 Message Date
Ryan Culpepper
e10951024f syntax/parse: fix bug in specialized code for ellipsis patterns
The result of 'stx->list' is not always either a list or #f.

Merge to 5.3.
2012-07-28 17:37:06 -04:00
Ryan Culpepper
510d3937a7 change id-tables so iterators not invalidated by mutation of existing keys
id-table fixes

test for id-table
2012-07-20 10:59:50 -04:00
Sam Tobin-Hochstadt
857a312e61 mzscheme -> racket/base in syntax/struct 2012-07-19 10:55:31 -04:00
Matthew Flatt
daa98b4e33 syntax/location: repair after `variable-reference->module-source' fix 2012-07-10 18:35:03 -06:00
Matthew Flatt
603e920538 syntax/location: fix and change `quote-submodule-{name,path}'
Paths are left as paths, instead of trying to convert them to strings
or byte strings. Submodule path elements should be unquoted -- in the
same form as a `submod' form. All extra parts are submodule path elements,
never module paths or ".".
2012-07-10 11:42:42 -06:00
Asumu Takikawa
a1aedaff1e Fix doc typos 2012-07-06 18:59:10 -04:00
Jon Rafkind
6457e69b48 [honu] support for-syntax in require 2012-06-11 13:07:53 -06:00
Sam Tobin-Hochstadt
865a2cdcbd Support definitions of keyword functions in Typed Racket.
Caveats:
 - keyword function definitions do not define static
   bindings, thus limiting optimization opportunities
 - can't use `define:`, `lambda:`, etc with keywords
 - error messages sometimes expose the implementation
 - the optimizer skips most of the generated code for
   keyword functions definitions (user-level code is
   optimized)
2012-06-02 18:22:07 -04:00
Matthew Flatt
248301c9ed disable nested `#lang'
A `syntax/module-reader' reader disables `#lang' when looping to
read a module body. The HtDP languages require a little additional
treatment.
2012-05-29 11:01:52 -06:00
Matthias Felleisen
f1c1376d87 added 'range' to *sl per jpr's request and #lang-ified a couple of files 2012-05-29 12:00:27 -04:00
Matthew Flatt
6fded4bac1 syntax/free-vars: fix quadratic behavior
(Forgot to fix the "FIXME" before committing last time.)
2012-05-28 20:22:31 -06:00
Matthew Flatt
ee93e35260 syntax/free-vars: deterministic result order
Closes PR 12798
2012-05-28 20:15:43 -06:00
Matthew Flatt
964020f288 implement scribble/srcdoc' via submodules instead of expand'
Also add a `for-doc' require form, make `proc-doc' et al. provide
forms, make `provide/doc' an alias for `provide'.
2012-05-12 01:37:50 -06:00
Matthew Flatt
9412ea0707 add `syntax/quote' library 2012-05-12 00:55:12 -06:00
Ryan Culpepper
3bde72ffb0 syntax/parse: fix dependencies of experimental modules 2012-05-07 14:46:14 -06:00
Ryan Culpepper
eb3dce14cd fix some doc contracts for submodules 2012-05-07 14:46:13 -06:00
Stevie Strickland
b2bfbad240 Add special typechecking rule for expansion of (quote-module-name). 2012-05-03 19:38:47 -04:00
Matthew Flatt
9ba663aa77 preserve submoduleness in module path index for expanded submodules
The preserved path is exposed by a new `module-path-index-submodule'
function, and `module-path-index-join' now accepts an optional
submodule path.

Also, fixed a problem with `collapse-module-path-index' when
a module path indx is built on a resolved module path that
is a submodule path.

In addition to the main repair, `collapse-module-path[-index]' is
correctly documented to allow '(quote <sym>) rel-to paths.

Finally, `collapse-module-path-index' changed to use a symbolic
resolved module path that appears as the base of a module path
index, rather than falling back to the given rel-to path. It's
possble that the old beavior was intentional, but it wasn't tested,
and it seems more likely to have been a bug.

Closes PR 12724
2012-04-24 21:10:28 -06:00
Ryan Culpepper
211e382a70 syntax/parse: update phase discussion with begin-for-syntax
merge to 5.3
2012-04-10 15:50:32 -06:00
Kevin Tew
bba967144b quote-module-name and quote-module-path now take an optional submodule path
(quote-module-name "..")
(quote-module-path ".." 'A 'B)
2012-03-28 18:52:02 -06:00
Matthew Flatt
ae89e210fb allow (submod "..")' as a shorthand for (submod "." "..")'
Also, `(submod ".")' is allowed as a module path; it's not useful,
but it makes the grammar slightly more regular.
2012-03-22 18:43:11 -06:00
Ryan Culpepper
74ca931f5a more template improvements
- loosen pattern variable depth rules (now compatible with syntax)
- generalize ?? form to head-templates
- doc improvements
- propagate paren-shape property
2012-03-21 17:48:10 -06:00
Ryan Culpepper
df265ddc67 syntax/parse: eliminate old minimatch struct syntaxes 2012-03-21 17:33:08 -06:00
Ryan Culpepper
6c369f2563 updates to syntax/parse/experimental/template
- changed substitute to use closure-compilation
- added stress/perf test for templates
- updated minimatch with vector patterns
- split substitute into separate file, minimize dependencies
- do ellipsis optimization dynamically
- validate guides: check var indexes
2012-03-21 17:33:08 -06:00
Ryan Culpepper
a564110c08 syntax/parse: change expectstack rep to reduce/consolidate allocations 2012-03-13 19:50:09 -06:00
Ryan Culpepper
5db8553ea1 syntax/parse: expect:thing stores stx being matched 2012-03-13 19:50:09 -06:00
Ryan Culpepper
6cf3127cf9 syntax/parse: put failure information in syntax exn 2012-03-13 19:50:08 -06:00
Matthew Flatt
facc8db712 change module-path?' to subsume path?'
Although th eoriginal idea was to distinguish "text" paths
from derived filesystem paths, practically everythign that accepts
a module path also accepts a path. Building the generalization into
`module-path?' makes it easier to support `submod' wrappers on paths,
and it seems to fix things rather than break them.
2012-03-12 21:08:54 -06:00
Matthew Flatt
6743900fc7 get-module-code repair 2012-03-09 10:34:57 -07:00
Matthew Flatt
a6a1b02de5 more doc updates for submodules 2012-03-09 10:34:57 -07:00
Matthew Flatt
3d69dfab86 first cut at submodules 2012-03-09 10:34:56 -07:00
Ryan Culpepper
fb7c7e3793 syntax/parse: added roles, other updates/fixes
expr/c uses role for contract label when avail
export ~peek-not (previously missed)
fixes for integrable stxclasses
2012-03-08 07:39:42 -07:00
Ryan Culpepper
a0065b9efa syntax/parse: cut-prompt is inherited, not threaded 2012-03-08 01:17:47 -07:00
Ryan Culpepper
14089e0ac6 syntax/parse: clean up integrable stxclass code 2012-03-08 01:17:47 -07:00
Ryan Culpepper
3e6069a70f syntax/parse: optimize common ellipsis patterns 2012-02-28 05:27:58 -07:00
Ryan Culpepper
2a3d6d5c31 syntax/parse: add attribute-prefix check to template form
(template x.y) raises an error if x an attribute but x.y is not.
2012-02-28 05:27:57 -07:00
Matthew Flatt
60c1bc6638 fix problem with `get-module-code'
As reported and fixed by Timur Sufiev
2012-02-24 17:06:20 +00:00
Eli Barzilay
c007c345f9 A bunch of more typos like the ones in David's commit. 2012-02-21 14:21:43 -05:00
Ryan Culpepper
5a1badf397 syntax/parse: added template metafunctions
Also fixed some bugs and added simple optimizations.
2012-02-10 22:12:54 -07:00
Ryan Culpepper
06979954fa syntax/parse: added experimental template form
Also added more atomic patterns to syntax-parse (previously overlooked).
2012-02-10 05:26:13 -07:00
Ryan Culpepper
ed1ba3a442 syntax/parse docs: use trusted sandbox config
closes PR 12546
2012-02-07 13:43:26 -07:00
Ryan Culpepper
e2404184ee syntax/parse: fix opaque head patterns and splicing syntax classes
closes PR 12537
2012-02-07 13:43:26 -07:00
Ryan Culpepper
f99d79ef10 pruned unstable/contract
Removed unused code. Removed nat/c, pos/c as they correspond to
standard predicates.
2011-12-18 13:56:00 -07:00
Matthew Flatt
ee775c3cc3 intern strings, etc. only when making syntax objects, not in `read'
Rename `read-intern-literal' to `datum-intern-literal'.

Interning is needed only in `read-syntax' or `datum->syntax' to
set up the invariants that the bytecode compiler needs for cross-module
optimization. When `read'ing numbers from a data file, meanwhile,
interning slows things down a lot and doesn't seem worthwhile.
2011-12-14 16:03:44 -07:00
Matthew Flatt
25dd8727cb add datum-case', etc. as syntax/datum'
This library is used by Redex, which wants a `syntax'-like template
language, but for datum values instead of syntax objects. Using
`datum-case' and `datum' generates much less code. Redex uses
only a small part of the general functionality, so adding
`syntax/datum' could be overkill. It's implemented by generalizing
the `syntax-case' and `syntax' pattern matching and template
constructing code, though; it's not a lot of extra code, and it's
easiest to generalize completely. We may find other uses for
datum templates, too.
2011-12-12 08:13:20 -07:00
Matthew Flatt
17504a960e more interning related to Scribble xref 2011-12-10 11:43:58 -07:00
Matthew Flatt
b2fade9206 read-intern strings generated by Scribble; other interning
This change saves a small amount of space in cross-reference files
and some space in loaded cross-reference information.
It also saves work converting strings to mutable on deserialize,
although the performance difference seems negligible.
2011-12-10 11:43:58 -07:00
Matthew Flatt
a04272d245 fix typo and text duplication 2011-11-27 13:27:04 -07:00
Matthew Flatt
b157ff2399 fix `#lang at-exp' spec and related
Closes PR 12174
2011-11-27 11:22:41 -07:00
Matthew Flatt
edec6fafd1 remove unused library (formerly used by the Racket->C compiler) 2011-11-12 05:33:20 -07:00
Ryan Culpepper
81fa15e27b updated documentation for syntax/trusted-xforms
closes PR 12269
  merge to 5.2
2011-10-16 02:40:41 -06:00
Ryan Culpepper
192e039e66 fix docs (eval) for syntax/keyword 2011-10-07 19:40:48 -06:00
Ryan Culpepper
a1009bbf26 syntax/parse: add begin-for-syntax to kernel-literals 2011-10-07 19:40:48 -06:00
Ryan Culpepper
528c05b228 emphasize syntax/id-table over syntax/boundmap 2011-10-07 19:40:48 -06:00
Ryan Culpepper
d3cb67b756 syntax/parse: fixed docs
closes PR 12255
2011-10-07 19:40:48 -06:00
Matthew Flatt
ec380e34ed remove built-in reader and printing support for Honu
This is a backward-incompatible change, but I think it's
unlikely that any code depends on the removed bindings
or reader syntax.
2011-10-05 09:40:27 -06:00
Ryan Culpepper
38d984367e syntax/parse: fix check-literals code (references to disappearing names) 2011-10-02 14:17:07 -06:00
Ryan Culpepper
a22783f635 syntax/parse: added workaround for racket/runtime-path at phase>0 2011-09-30 04:13:09 -06:00
Ryan Culpepper
5befa7320f syntax/id-table: added uncontracted private version 2011-09-30 04:13:09 -06:00
Ryan Culpepper
323aff1efb syntax/parse: added syntax/parse/pre
No *residual* dependencies on racket/contract/base (the *disappearing*
macro transformers and compile-time support do use contracts, though).
2011-09-30 04:13:09 -06:00
Ryan Culpepper
1c6b8bd68e syntax/parse: lazily load most macro transformers and compile-time support 2011-09-30 04:13:09 -06:00
Ryan Culpepper
c7f86d276c removed useless requires 2011-09-27 19:28:44 -06:00
Ryan Culpepper
7cc1476170 syntax/parse: fix bug: integrated stxclass might not bind pvar to syntax 2011-09-21 16:58:52 -06:00
Ryan Culpepper
095b5a5131 syntax/parse: use new primitive cross-phase identifier comparison 2011-09-20 14:27:33 -06:00
Matthew Flatt
0197902309 add var-ref->mod-decl-insp' and switch cur-code-insp' uses
Macros and other tools that need syntax privilege used
`(current-code-inspector)' at the module top-level to try to
capture the right code inspector at load time. It's more
consistent to instead use the enclosing module's declaration-time
inspector, and `var-ref->mod-decl-insp' provides that. The
new function works only on references to anonymous variables,
which limits access to the inspector.

The real function name is longer, of course.
2011-09-20 13:50:36 -06:00
Eli Barzilay
623c7493ed Some selective #:when (not ...)' -> #:unless ...'. 2011-09-16 10:48:18 -04:00
Matthew Flatt
c352ef8fce allow different phases for `free-identifier=?' arguments 2011-09-12 17:08:50 -06:00
Matthew Flatt
41bdb139d4 fix a formerly overlooked `kernel-syntax-case'
Caught by the Check Syntax tests that use Pretty Big
2011-09-08 19:03:54 -06:00
Matthew Flatt
d3c56c9f13 generalized `begin-for-syntax' 2011-09-08 14:06:00 -06:00
Ryan Culpepper
3aa16f2c26 syntax/parse: speed up "is literal bound?" check
Can't do check completely statically, because phase of comparison
is expression (and even default is slightly unpredictable).
So instead compute whether check would succeed for likely phase
offsets, and use list of ok offsets as run-time fast path (memv
instead of identifier-binding).
2011-09-06 12:41:03 -06:00
Ryan Culpepper
68e76a9876 syntax/parse: speed up free-identifier=?/phases when phases are same 2011-09-06 12:41:03 -06:00
Matthew Flatt
20a1440dcf fix build-struct-generation' to work with racket/base'
and also still works with `mzscheme'
2011-09-03 07:49:22 -06:00
Ryan Culpepper
883e9e9e6b syntax/parse: syntax-parse sets current-syntax-context 2011-08-30 12:04:25 -06:00
Eli Barzilay
2ef9f5ae0e Fix a bug in resolve-module-path' to do an expand-user-path', which
`file' specs do too (in `require' etc).
2011-08-26 10:13:27 -04:00
Jay McCarthy
3cd6be5931 I believe this fixes PR12117. The teaching languages rely on syntax/struct. (I have run the teaching language tests, but do not other uses of syntax/struct.) It appears that syntax/struct has been incorrectly creating this information for some time. The problem is that it would end the static info with a #f if the selectors or setters were omitted, but reading the documentation implies that there should be a final #f in either case. I've therefore changed the boolean to an or over the flags 2011-08-19 11:30:42 -06:00
Eli Barzilay
d61eb53686 Lots of documentation formatting.
Started as fixing misindented definitions, then more indentations, then
a bunch of similar things (square brackets, huge spaces at end-of-lines,
etc).
2011-08-15 07:50:04 -04:00
Matthew Flatt
39a96dd699 add `prop:liberal-define-context' 2011-08-09 16:33:16 -06:00
Ryan Culpepper
95ce7ec6ed scribble style (capitalize section names) 2011-08-09 12:29:28 -06:00
Matthew Flatt
c6f1178be3 fix an error message 2011-07-27 05:47:46 +01:00
Matthew Flatt
d8d762517f fix `get-module-path' and associated exception
Closes PR 12029
2011-07-17 08:14:33 -06:00
Matthew Flatt
ab0e78122c revert unnecessary refactoring
--- intended to avoid creating a dependency that already exists

 Merge 5.1.2
2011-07-16 21:02:41 -06:00
Matthew Flatt
7af5d490ad fix cm to configure reader when reading .dep files
Merge to 5.1.2
2011-07-16 19:29:28 -06:00
Matthew Flatt
f40dc87c29 add letrec-syntaxes+values' to kernel-syntax-case'
Do not merge to 5.1.2; the implications for backward
 compatibility are not clear to me.
2011-07-15 20:16:58 -06:00
Vincent St-Amour
111ef109c3 Add vectors to syntax->list. 2011-07-14 17:06:52 -04:00
Carl Eastlund
00a6442712 Changed source-location->string and ->prefix to use
path->relative-string/library to produce collection and planet-relative source
names.
2011-07-09 14:48:14 -04:00
Carl Eastlund
2e6a608539 Corrected documentation of quote-module-name to indicate that it does not
produce collection and planet-relative paths on its own.  Deprecated
quote-module-path, and replaced existing uses of it with quote-module-name.
2011-07-09 14:46:58 -04:00
Ryan Culpepper
0aecbf97ff syntax/parse: add expr/c to main module
Merge to release branch
2011-07-08 15:34:59 -06:00
Eric Dobson
07910253b4 Fixes build-struct-expand-info to create correct struct info.
Adds a check to struct-info? to make sure selectors
and mutators are the same length. Closes PR12017.
2011-07-05 11:25:10 -04:00
Eli Barzilay
3157955d40 ".ss" -> ".rkt" scan done. 2011-07-02 10:37:53 -04:00
Eli Barzilay
4da4a2759b New setup/path-to-relative' that supersedes unstable/dirs' and most of
`setup/private/path-utils'.

The API is a little different: instead of getting the alist and the
path, there's a curried function that gets the alist and produces a
function to do the substitutions.
2011-07-02 01:10:38 -04:00
Ryan Culpepper
1b702a2ae3 docs reorganization
added tutorial, racket categories
  relabeled some other categories
  normalized manual names: de-bolded, changed some names
2011-07-01 17:16:53 -06:00
Matthew Flatt
b163edff9b clean up my clumsy first attempt to adapt the web-server languages
for syntax taints
2011-07-01 17:11:16 -06:00
Carl Eastlund
97642c1cb6 Fixed syntax/parse bug:
Syntax classes with keyword arguments were unintentionally requiring all
arguments at an application site to be in alphabetical order.
Added a test for this fix.
2011-07-01 15:32:34 -04:00
Robby Findler
69b5daa9e6 remove docs tests that no one was interested in 2011-07-01 11:38:09 +08:00
Matthew Flatt
1160d3df62 remove syntax certificates; add syntax taints 2011-06-29 19:15:48 -06:00
Eli Barzilay
40124a0619 A long overdue scan to eliminate files without terminating newlines.
(DrRacket should really do that.)
2011-06-28 02:01:41 -04:00
Eli Barzilay
a38f384a00 Finish converting scheme' -> racket'.
Everything compiles fine now even if the compatibility bindings are
gone.
2011-06-28 00:45:38 -04:00
Ryan Culpepper
2cea046fef syntax/parse: report stxclass arity error without ~var form
closes PR 11933
2011-06-27 10:21:12 -06:00
Eli Barzilay
ac26fe7554 A ton of @scheme*' -> @racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries
rather than to `scheme/*' ones.
2011-06-25 04:08:47 -04:00
Eli Barzilay
debd1f9f1e Recketizing much in `net/*', mass ".ss" -> ".rkt" conversion in .scrbl files.
(Some other minor things here and there.)
2011-06-20 04:27:14 -04:00