summary refs log tree commit diff
path: root/src/librustdoc/html/highlight.rs
AgeCommit message (Collapse)AuthorLines
2017-01-17Fix fallout in `rustdoc`.Jeffrey Seyfried-9/+7
2016-12-23Fix rustdoc highlighting of `&` and `*`.Chris Morgan-3/+5
Whitespace tokens were included, so the span check used with `&` was incorrect, and it was never highlighted as kw-2. The `*` in `*foo` and `*const T` should also be highlighted kw-2, so I added them. Note that this *will* cause mishighlighting of code like `1*2`, but that should have been written `1 * 2`. Same deal with `1&2`.
2016-10-19Improve `$crate`.Jeffrey Seyfried-3/+2
2016-10-12rustdoc: color the question mark operatorest31-2/+6
The idea was proposed by eddyb in: https://github.com/rust-lang/rust/issues/31436#issuecomment-247426582
2016-09-17duplicate theEitan Adler-1/+1
2016-09-08Set run button transparent instead of invisibleGuillaume Gomez-1/+5
2016-07-19Introduced `NoDelim` and modified the compiler to support it.cgswords-0/+1
2016-07-06Rollup merge of #34626 - sylvestre:master, r=ManishearthSteve Klabnik-1/+1
Fix typos
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-3/+2
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-07-03Fix a few typos in the codeSylvestre Ledru-1/+1
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-2/+2
When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-05-15true color, fixed boolval style in docHendrik Sollich-1/+1
2016-05-04rustdoc: refactor rustdoc syntax highlighting for a more flexible APINick Cameron-105/+245
Clients can now use the rustdoc syntax highlighter to classify tokens, then use that info to put together there own HTML (or whatever), rather than just having static HTML output.
2016-04-27Make some fatal lexer errors recoverablemitaa-7/+19
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-1/+1
2016-04-04rustdoc: factor out function for getting inner html of highlighted sourceNick Cameron-19/+42
2016-03-22fix alignmentJorge Aparicio-3/+2
2016-03-22try! -> ?Jorge Aparicio-12/+12
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-1/+1
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-2/+2
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