about summary refs log tree commit diff
path: root/src/libsyntax/codemap.rs
AgeCommit message (Collapse)AuthorLines
2016-11-28rustc: use Span's allow_internal_unstable instead of hir::BlockCheckMode.Eduard Burtescu-2/+6
2016-11-21Fix fallout in `rustdoc` and tests.Jeffrey Seyfried-7/+5
2016-10-05Rename Parser::last_span as prev_span.Nicholas Nethercote-3/+3
This is a [breaking-change] for libsyntax.
2016-09-20Check for overlapping and simplify unit testJonathan Turner-8/+3
2016-09-19Add the ability to merge spans to codemapJonathan Turner-0/+82
2016-09-01incr.comp.: Add stable hashing of HIR spans to ICH.Michael Woerister-20/+4
2016-08-01Reimplemented tokenstreams as ropes and reduced the exposed TokenStream API.cgswords-0/+17
2016-07-14Remove more unused importsJonathan Turner-1/+0
2016-07-14Remove unused importsJonathan Turner-19/+0
2016-07-14Add back in import needed for codemap testsJonathan Turner-0/+1
2016-07-14Add fix for tabs. Move error unit tests->ui testsJonathan Turner-766/+4
2016-07-14Fix up some tidy-unfriendly spacingJonathan Turner-18/+18
2016-07-14DCE and fixing some internal testsJonathan Turner-98/+98
2016-07-14Remove BasicEmitterJonathan Turner-3/+3
2016-06-24Fix codemap tests to not double importJonathan Turner-1/+0
2016-06-24Reexport syntax_pos in codemap and fix some cfail testsJonathan Turner-1/+1
2016-06-23make old school mode a bit more configurableJonathan Turner-17/+28
2016-06-23Add missing refernce to RenderedLineJonathan Turner-1/+1
2016-06-23Move test helper functions to consolidated codemap testingJonathan Turner-0/+64
2016-06-23Actually consolidate the CodeMap testsJonathan Turner-0/+517
2016-06-23Consolidate codemap tests and fix more errors for travisJonathan Turner-0/+235
2016-06-23Address more travis errorsJonathan Turner-0/+1
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-655/+37
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-16/+51
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-27Auto merge of #33706 - jseyfried:refactor_cfg, r=nrcbors-25/+0
Perform `cfg` attribute processing during macro expansion and fix bugs This PR refactors `cfg` attribute processing and fixes bugs. More specifically: - It merges gated feature checking for stmt/expr attributes, `cfg_attr` processing, and `cfg` processing into a single fold. - This allows feature gated `cfg` variables to be used in `cfg_attr` on unconfigured items. All other feature gated attributes can already be used on unconfigured items. - It performs `cfg` attribute processing during macro expansion instead of after expansion so that macro-expanded items are configured the same as ordinary items. In particular, to match their non-expanded counterparts, - macro-expanded unconfigured macro invocations are no longer expanded, - macro-expanded unconfigured macro definitions are no longer usable, and - feature gated `cfg` variables on macro-expanded macro definitions/invocations are now errors. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { #[cfg(attr)] macro_rules! foo { () => {} } foo!(); // This will be an error macro_rules! bar { () => { fn f() {} } } #[cfg(attr)] bar!(); // This will no longer be expanded ... fn g() { f(); } // ... so that `f` will be unresolved. #[cfg(target_thread_local)] // This will be a gated feature error macro_rules! baz { () => {} } } } m!(); ``` r? @nrc
2016-05-27Update spans' `expn_id` during the marking foldJeffrey Seyfried-25/+0
2016-05-24syntax: Make codemap::get_filemap() return an OptionKamal Marhubi-3/+3
This is more idiomatic, putting the caller in charge of whether or not to panic.
2016-05-02Nit: remove push_primary_span, which was never calledNiko Matsakis-4/+0
2016-05-02Nit: add commentNiko Matsakis-3/+5
2016-05-02Nit: comments should be uppercase letterNiko Matsakis-4/+4
2016-05-02refactor to use new snippet code and modelNiko Matsakis-74/+13
Major changes: - Remove old snippet rendering code and use the new stuff. - Introduce `span_label` method to add a label - Remove EndSpan mode and replace with a fn to get the last character of a span. - Stop using `Option<MultiSpan>` and just use an empty `MultiSpan` - and probably a bunch of other stuff :)
2016-05-02revamp MultiSpan and introduce new snippet codeNiko Matsakis-135/+83
MultiSpan model is now: - set of primary spans - set of span+label pairs Primary spans render with `^^^`, secondary spans with `---`. Labels are placed next to the `^^^` or `---` marker as appropriate.
2016-04-21port compiletest to use JSON outputNiko Matsakis-0/+50
This uncovered a lot of bugs in compiletest and also some shortcomings of our existing JSON output. We had to add information to the JSON output, such as suggested text and macro backtraces. We also had to fix various bugs in the existing tests. Joint work with jntrnr.
2016-03-25do not overwrite spans as eagerlyNiko Matsakis-0/+25
this was required to preserve the span from the #[structural_match] attribute -- but honestly I am not 100% sure if it makes sense.
2016-03-22fix alignmentJorge Aparicio-65/+65
2016-03-22break long lineJorge Aparicio-1/+2
2016-03-22try! -> ?Jorge Aparicio-43/+32
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
2016-02-12syntax: Replace unstable `vec.as_slice().get()` with `vec.get()`Erick Tryzelaar-1/+1
2016-02-03Changed macro spans in CSVs to point to the macro name, bugfixed nested spansDaniel Campbell-1/+20
2016-02-02Auto merge of #31279 - DanielJCampbell:MacroReferencing, r=nrcbors-0/+21
r? @nrc
2016-02-01Implemented macro referencing for save analysisDaniel Campbell-0/+21
2016-02-01Spans now derive equalityDaniel Campbell-13/+12
2016-01-28Implement MultiSpan error reportingmitaa-3/+260
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion.
2016-01-22Extended save-analysis to support generated code, alterned some spans in ↵Daniel Campbell-2/+23
format_args! and derive to maintain compatability
2016-01-20syntax: Fix encoding and decoding spansErick Tryzelaar-5/+20
The protocol for `serialize::{En,De}code` doesn't allow for two integers to be serialized next to each other. This switches the protocol to serializing `Span`s as a struct. rbml structs don't have any overhead, so the metadata shouldn't increase in size, but it allows the json format to be properly generated, albeit slightly more heavy than when it was just serializing a span as a u64. Closes #31025. s
2015-12-28Use a more efficient encoding for opaque data in RBML.Michael Woerister-7/+4
2015-12-08Added pretty-printing for span expansion chains through span_to_expanded_string.Daniel Campbell-0/+204
2015-11-12Add -Zinput-statsNick Cameron-0/+8
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ```
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-22/+0
2015-10-03Add a method to test span containmentSeo Sanghyeon-1/+5