Commit Graph

86 Commits

Author SHA1 Message Date
Matthew Flatt
5afd1b4118 syntax-color/racket-lexer: update for single-precision and extflonums
Includes a doc fix to note `+inf.t', etc.
2013-03-29 07:23:49 -06:00
Matthew Flatt
1dcc7ca4dc syntax-color/racket-lexer: fix long-standing number-parsing bug
The lexer mishandled cases like "#x1E+2", because "E" is
not an exponent marker for hexadecimal --- and it has been that
way forever, but the repair isn't all that difficult.
2013-03-29 07:23:49 -06:00
Robby Findler
2792cd7b5f remove redundant check and minor cleanup 2013-03-20 22:51:39 -05:00
Robby Findler
496331498f add some random testing into the lexer option contract 2013-03-19 16:04:57 -05:00
Robby Findler
551150e805 tweaks to option contract usage 2013-03-15 15:38:13 -05:00
Eli Barzilay
af6be85ff5 Fix lots of indentation mistakes.
(Found by my ayatollah script...)
2013-03-14 10:55:47 -04:00
Robby Findler
761054890d extend the lexer <-> framework's color:text api
to let lexers say "call me again before you change the buffer"

also, use this in the 2d lexer
2013-03-10 20:17:20 -05:00
Robby Findler
3c295d14d0 fix lexer contract 2013-02-26 12:41:25 -06:00
Robby Findler
18a5dcb3d3 add port-count-lines? to the lexer contract 2013-02-24 16:37:06 -06:00
Robby Findler
40363da511 forgot to add this file in my previous commit 2013-02-23 19:50:34 -06:00
Robby Findler
5e2cc344c8 change the option setup: everyone has an option contract now and
the module lexer either exercises or not, depending on its level of trust
2013-02-23 16:26:46 -06:00
Robby Findler
b0343aa9f0 add a contract on the interaction between the module-lexer and the
lexers it defers to

also, remove the checks in color.rkt in the framework (they are not
all covered by the added contract, but they mostly are and when they
aren't, most of those times are using the heavily tested racket-lexer)
2013-02-23 14:35:25 -06:00
Eli Barzilay
cec73f5652 Newlines at EOFs scan. 2013-02-23 02:09:56 -05:00
Robby Findler
1a8ed3d74b unbreak scheme-lexer 2013-02-16 19:55:18 -06:00
Robby Findler
1420ce4ed2 clarify colorer docs
Also, some cleanups of the code and
make the syntax-color/ library docs
point to color:text<%> instead of
color:text% (as the interesting information
is attached to the interface, not the class)
2013-02-10 10:30:28 -06:00
Robby Findler
12ebfa2cf4 make #:keywords have different color prefs in DrRacket
closes PR 13492
2013-02-05 12:32:48 -06:00
Robby Findler
014abe64c0 Rackety 2013-02-05 12:32:48 -06:00
Matthew Flatt
8e5a42bb3c remove docs for removed library 2012-12-05 08:32:53 -06:00
Danny Yoo
7beb132b66 Removes red-black from syntax-color/private; refactored into PLaneT2 as 'data-red-black' package. 2012-12-04 16:46:31 -07:00
Danny Yoo
2f94e17e6a Add an abstracted red-black tree that can take a custom node combinator. 2012-11-30 16:56:11 -07:00
Danny Yoo
90714fbd5e Implements a rb-tree based version of the token tree, and fixes bugs in red-black.rkt.
A few invariants involving subtree-width and black-height balance
could break if singleton nodes were reused; bugs were due to stale
data in the nodes.

The token tree implements the implicit interface in the original
splay-based token tree module in syntax-color/token-tree.  However, it
does not appear to perform significantly differently in the case of
indentation yet.  It needs some additional profiling and analysis to
see if we can take advantage of the richer structure in the rb tree.
2012-11-26 11:14:22 -07:00
Danny Yoo
e4c9ad484e Add full contracts to red-black.rkt, with extensive documention in red-black.scrbl.
A submodule called "uncontracted" provides the contract-free bindings,
as I suspect we'll need them for the token tree for maximum performance.OB
2012-11-22 01:25:42 -08:00
Danny Yoo
3f54afb9fd Add rb-tree implementation in preparation for improving token-tree performance. 2012-11-19 21:06:46 -07:00
Robby Findler
aa8b280f1c adjust the splay tree implementation so that it creates fewer cons
cells when searching in the tree

Two tricks: represent lists of nodes as improper lists so singleton
lists don't allocate a cons and pass around two accumulators that
correspond to the hd & tl of a path, instead of cons'ing that up
into a list and them immediately taking it apart again

measurement: when starting up drracket with
collects/drracket/private/unit.rkt and then waiting for the colorer to
finish, and then inserting an open quote right before the first open
quote in the file (and waiting again for the colorer to finish)
creates 249000 cons cells before this change and 116000 after this
change

After a little more work, I'm pretty much convinced that this was
the wrong approach and that the splaying implementation should just
change to not allocate the paths into lists at all, thus removing
the other 116k cons cells. (I plan to get to this another day;
it should not be difficult now that I roughly understand how these
things work.)

I also looked into top-down splaying and found these notes to
be illuminating:

  http://digital.cs.usu.edu/~allan/DS/Notes/Ch22.pdf

They essentially convinced me that we cannot use top-down splaying
here, since the "reassembling" stage requires moving some arbitrary,
unexplored subtree from a right-child to a left-child, and thus the
left-subtree-length cannot be updated properly.
2012-04-05 07:14:52 -05:00
Robby Findler
5dad811a5d rackety 2012-04-03 17:08:00 -05:00
Robby Findler
404b4da138 avoid allocation for 'paren' structs 2012-04-03 17:08:00 -05:00
Eli Barzilay
f7c67b49a4 Big newline at EOF scan. 2012-02-29 00:28:11 -05:00
Robby Findler
11994bd4f8 fix a bug in the module lexer; it was returning the wrong length for the tokens
it creates when the #lang line isn't well-formed (eg "#lang racke").

closes PR 12399
2011-11-28 21:16:31 -06:00
Matthew Flatt
fca5ceecc9 switch `codeblock' to strings instead of bytes
Also, fix scribble lexer line counting.

Closes PR 12225
2011-11-27 11:06:21 -07:00
Robby Findler
65fd0234ad add a unicode test to scheme-lexer.rkt
and change the tests so they all run with port line
counting enabled (or else the unicode test fails)

adjust module-lexer.rkt tests so they can run in either
port-counting mode or not (but currently run them all in
port-counting mode because scheme-lexer doesn't work without it)

also make a first stab at what needs to change in the module
lexer to make it work in non port line-counting mode
2011-11-03 22:41:27 -05:00
Robby Findler
d00aed6f1b fix the module reader for the case when there are non-ASCII unicode characters
in comments before the #lang line

also add an #:init-position argument to peeking-input-port
2011-11-03 17:13:17 -05:00
Robby Findler
1eaf53d4cb adjust the module lexer so that it treats the entire range that
'read-language' uses as a single token in the case that read-language
fails. This helps it to deal with things like s-exp and at-exp
properly

closes PR 12260
2011-10-08 08:08:36 -05: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
Robby Findler
69b5daa9e6 remove docs tests that no one was interested in 2011-07-01 11:38:09 +08: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
Matthew Flatt
bbd98528ba improve docs for `module-lexer' 2011-06-10 06:21:35 -07:00
Robby Findler
507b1cd8fd moved the docs-complete library into rackunit
to avoid having a separate, new manual for the
  one library
2011-05-05 16:10:42 -05:00
Robby Findler
e7d0029aea added lots of new tests that our documentation is complete 2011-04-25 13:24:43 -05:00
Robby Findler
68b5d2abf8 adjust module lexer to handle the case of specials in the editor properly 2011-03-01 15:20:55 -06:00
Robby Findler
83b00c0cf1 adjust the module-lexer so it explicitly notes malformed #lang lines before going into "no-lang-line" mode
closes PR 11766
2011-02-22 20:42:19 -06:00
Robby Findler
50e9aec0ab catch more exceptions in the module lexer when it calls read-language 2011-02-10 09:56:43 -06:00
Robby Findler
d659d2f0af changed the module lexer's strategy to be able to handle
the part of the buffer before the #lang line properly
  closes PR 11381
2011-02-09 15:27:05 -06:00
Robby Findler
dce1d0ad47 revert the module-lexer.rkt changes that I accidentally pushed 2011-02-08 10:55:35 -06:00
Robby Findler
49c3011f49 started to fix the colorer problems (now that I undestand how!)
plus some extra checking in the colorer
2011-02-08 10:02:42 -06:00
David Van Horn
c9519fd113 Fixed various spelling errors. 2011-02-03 17:42:33 -05:00
Matthew Flatt
bf4fc2574c fix syntax colorer for #true and #false 2010-10-12 08:22:12 -06:00
Matthew Flatt
e4aab34656 Fix `at-exp' syntax colorer to handle non-text input
- added 'special-filter-input-port' to `racker/port'
 Merge to v5.0
2010-05-21 19:40:32 -06:00
Eli Barzilay
939af28a4c Some random ".ss" -> ".rkt"s 2010-05-17 05:58:19 -04:00
Matthew Flatt
28b4043077 rename all files .ss -> .rkt 2010-04-27 16:50:15 -06:00
Robby Findler
59d90b279d improved support for #lang planet (in drscheme) 2010-04-21 12:14:17 -04:00