summary refs log tree commit diff
path: root/src/librustdoc/html/highlight.rs
AgeCommit message (Collapse)AuthorLines
2015-05-14syntax: replace sess.span_diagnostic.cm with sess.codemap().Eduard Burtescu-5/+3
2015-05-14syntax: refactor (Span)Handler and ParseSess constructors to be methods.Eduard Burtescu-1/+1
2015-03-13Fallout of std::old_io deprecationAlex Crichton-2/+3
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-1/+1
2015-02-06librustdoc has been updatedGuillaumeGomez-1/+1
Fixes run build error Fix test failure Fix tests' errors
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-4/+4
2015-02-04remove all kind annotations from closuresJorge Aparicio-1/+1
2015-01-26Fallout of io => old_ioAlex Crichton-2/+2
2015-01-07use slicing sugarJorge Aparicio-1/+1
2015-01-07Replace full slice notation with index callsNick Cameron-1/+1
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-0/+3
2014-12-31rustdoc: unbox closures used in let bindingsJorge Aparicio-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-1/+1
2014-11-20Parse and store suffixes on literals.Huon Wilson-7/+11
This adds an optional suffix at the end of a literal token: `"foo"bar`. An actual use of a suffix in a expression (or other literal that the compiler reads) is rejected in the parser. This doesn't switch the handling of numbers to this system, and doesn't outlaw illegal suffixes for them yet.
2014-11-19Switch to an independent enum for `Lit*` subtokens.Huon Wilson-3/+4
2014-11-18implement Writer for Vec<u8>Daniel Micay-2/+2
The trait has an obvious, sensible implementation directly on vectors so the MemWriter wrapper is unnecessary. This will halt the trend towards providing all of the vector methods on MemWriter along with eliminating the noise caused by conversions between the two types. It also provides the useful default Writer methods on Vec<u8>. After the type is removed and code has been migrated, it would make sense to add a new implementation of MemWriter with seeking support. The simple use cases can be covered with vectors alone, and ones with the need for seeks can use a new MemWriter implementation.
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-1/+2
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-3/+3
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-28Convert some token functions into methodsBrendan Zabarauskas-2/+2
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-28/+29
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-6/+4
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-07-15Fix errorsAdolfo Ochagavía-1/+0
2014-07-15Deprecate `str::from_utf8_lossy`Adolfo Ochagavía-1/+1
Use `String::from_utf8_lossy` instead [breaking-change]
2014-07-09lexer: lex WS/COMMENT/SHEBANG rather than skippingCorey Richardson-25/+16
Now, the lexer will categorize every byte in its input according to the grammar. The parser skips over these while parsing, thus avoiding their presence in the input to syntax extensions.
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-2/+1
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-1/+1
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-06-17Add br##"xx"## raw byte string literals.Simon Sapin-1/+1
2014-06-17Add a b"xx" byte string literal of type &'static [u8].Simon Sapin-1/+2
2014-06-17Add a b'x' byte literal of type u8.Simon Sapin-1/+1
2014-06-15Register new snapshotsAlex Crichton-1/+1
2014-06-06rustdoc: Submit examples to play.rust-lang.orgAlex Crichton-3/+10
This grows a new option inside of rustdoc to add the ability to submit examples to an external website. If the `--markdown-playground-url` command line option or crate doc attribute `html_playground_url` is present, then examples will have a button on hover to submit the code to the playground specified. This commit enables submission of example code to play.rust-lang.org. The code submitted is that which is tested by rustdoc, not necessarily the exact code shown in the example. Closes #14654
2014-06-04syntax: methodify the lexerCorey Richardson-1/+1
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-23syntax: Clean out obsolete syntax parsingAlex Crichton-1/+1
All of these features have been obsolete since February 2014, where most have been obsolete since 2013. There shouldn't be any more need to keep around the parser hacks after this length of time.
2014-05-13Touch up and rebase previous commitsAlex Crichton-0/+1
* Added `// no-pretty-expanded` to pretty-print a test, but not run it through the `expanded` variant. * Removed #[deriving] and other expanded attributes after they are expanded * Removed hacks around &str and &&str and friends (from both the parser and the pretty printer). * Un-ignored a bunch of tests
2014-05-12librustdoc: Remove all `~str` usage from librustdoc.Patrick Walton-2/+2
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-6/+8
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-2/+2
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-06De-~[] Mem{Reader,Writer}Steven Fackler-1/+1
2014-03-28Used inherited mutability in lexer::Reader.Eduard Burtescu-2/+2
2014-03-17Fix rustdoc and tests.Eduard Burtescu-6/+3
2014-03-17De-@ ParseSess uses.Eduard Burtescu-3/+3
2014-03-02rustdoc: syntax highlight macro definitions, colour $... substitutions.Huon Wilson-7/+18
Macro definitions are just their raw source code, and so should be highlighted where possible. Also, $ident non-terminal substitutions are special, and so are worth of a little special treatment.
2014-02-28rustdoc: Capture all output from rustc by defaultAlex Crichton-1/+1
This helps prevent interleaving of error messages when running rustdoc tests. This has an interesting bit of shuffling with I/O handles, but other than that this is just using the APIs laid out in the previous commit. Closes #12623
2014-02-23rustdoc: Add syntax highlightingAlex Crichton-0/+174
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393