about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-08-01Reimplemented tokenstreams as ropes and reduced the exposed TokenStream API.cgswords-610/+374
2016-07-30Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakisbors-32/+41
Properly feature gate all unstable ABIs Fixes https://github.com/rust-lang/rust/issues/34900 [breaking-change] r? @pnkfelix --- Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind https://github.com/rust-lang/rust/issues/34900. I'll try to restructure these visitors a bit and send one more PR later.
2016-07-29Auto merge of #34842 - cgswords:attr_enc, r=nrcbors-42/+94
Better attribute and metaitem encapsulation throughout the compiler This PR refactors most (hopefully all?) of the `MetaItem` interactions outside of `libsyntax` (and a few inside) to interact with MetaItems through the provided traits instead of directly creating / destruct / matching against them. This is a necessary first step to eventually converting `MetaItem`s to internally use `TokenStream` representations (which will make `MetaItem` interactions much nicer for macro writers once the new macro system is in place). r? @nrc
2016-07-28Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mwbors-0/+10
Enable reuse of `.o` files if nothing has changed This PR completes a first "spike" for incremental compilation by enabling us to reuse `.o` files when nothing has changed. When in incr. mode, we will save `.o` files into the temporary directory, then copy them back out again if they are still valid. The code is still a bit rough but it does seem to work. =) r? @michaelwoerister Fixes #34036 Fixes #34037 Fixes #34038
2016-07-28Add a testing mechanism and a simple spike testNiko Matsakis-0/+10
2016-07-28Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrcManish Goregaokar-1/+1
Avoid processing `feature`s on unconfigured crates Fixes #34932, a regression caused by #34272. r? @nrc
2016-07-25Adressed PR comments.cgswords-11/+10
2016-07-25General MetaItem encapsulation rewrites.cgswords-42/+95
2016-07-23macros: Improve `tt` fragmentsJeffrey Seyfried-3/+17
2016-07-23Auto merge of #34925 - jseyfried:nested_macros, r=eddybbors-1/+5
Support nested `macro_rules!` Fixes #6994. r? @eddyb
2016-07-21Avoid processing `feature`s on unconfigured crates.Jeffrey Seyfried-1/+1
2016-07-19Introduced `NoDelim` and modified the compiler to support it.cgswords-3/+10
2016-07-19Support nested `macro_rules!`.Jeffrey Seyfried-1/+5
2016-07-18Properly feature gate all unstable ABIsVadim Petrochenkov-32/+41
2016-07-18Auto merge of #34886 - jseyfried:improve_stmt_matchers, r=eddybbors-49/+31
macros: fix bug in `stmt` matchers Today, `stmt` matchers stop too early when parsing expression statements that begin with non-braced macro invocations. For example, ```rust fn main() { macro_rules! m { ($s:stmt;) => { $s } } id!(vec![].push(0);); //^ Before this PR, the `stmt` matcher only consumes "vec![]", so this is an error. //| After this PR, the `stmt` matcher consumes "vec![].push(0)", so this compiles. } ``` This change is backwards compatible due to the follow set for `stmt`. r? @eddyb
2016-07-17Auto merge of #34860 - jseyfried:encapsulate_hygiene, r=nrcbors-208/+135
Clean up and encapsulate `syntax::ext::mtwt`, rename `mtwt` to `hygiene` r? @nrc
2016-07-17Remove some unit tests and that are redundant with `run-pass/hygiene.rs`Jeffrey Seyfried-35/+0
and that would be painful to rewrite.
2016-07-17Rename `mtwt` to `hygiene`Jeffrey Seyfried-4/+4
2016-07-17Clean up and encapsulate `syntax::ext::mtwt`Jeffrey Seyfried-132/+94
2016-07-17macros: Fix bug in statement matchersJeffrey Seyfried-49/+31
2016-07-17Auto merge of #34829 - cgswords:tstream, r=nrcbors-1/+9
Added tokenstream parser procedure A tiny PR that simply adds a procedure for parsing `TokenStream`s to the parser in `src/libsyntax`. This is to ease using `TokenStream`s with the current (old) procedural macro system.
2016-07-17Auto merge of #34789 - jonathandturner:simplify_liberror, r=alexcrichtonbors-809/+9
Simplify librustc_errors This is part 2 of the error crate refactor, starting with #34403. In this refactor, I focused on slimming down the error crate to fewer moving parts. As such, I've removed quite a few parts and replaced the with simpler, straight-line code. Specifically, this PR: * Removes BasicEmitter * Remove emit from emitter, leaving emit_struct * Renames emit_struct to emit * Removes CoreEmitter and focuses on a single Emitter * Implements the latest changes to error format RFC (#1644) * Removes (now-unused) code in emitter.rs and snippet.rs * Moves more tests to the UI tester, removing some duplicate tests in the process There is probably more that could be done with some additional refactoring, but this felt like it was getting to a good state. r? @alexcrichton cc: @Manishearth (as there may be breaking changes in stuff I removed/changed)
2016-07-16Auto merge of #34816 - jseyfried:fix_include_path, r=nrcbors-0/+6
Fix `include!()`s inside `asm!()` invocations Fixes #34812, a regression caused by #33749 that was not fixed in #34450. r? @nrc
2016-07-15Auto merge of #34676 - aravind-pg:inner-attr, r=brsonbors-14/+56
Better error message for inner attribute following doc comment Before it was always just "an inner attribute is not permitted in this context", whereas now we add a special case for when an inner attr follows an outer attr. If the outer attr is a doc comment, then the error is "an inner attr is not permitted following a doc comment", and otherwise it's "an inner attr is not permitted following an outer attribute". In all other cases it's still "an inner attribute is not permitted in this context". Note that the public API and behaviour of `parse_attribute` is unchanged. Also, all new names are very open to bikeshedding -- they're arguably clunky. Fixes #34516. cc @brson
2016-07-15syntax: Better error message for inner attr following doc commentAravind Gollakota-14/+56
2016-07-15Added tokenstream parser procedurecgswords-1/+9
2016-07-15Auto merge of #34570 - jseyfried:no_rename, r=nrcbors-720/+67
Simplify the macro hygiene algorithm This PR removes renaming from the hygiene algorithm and treats differently marked identifiers as unequal. This change makes the scope of identifiers in `macro_rules!` items empty. That is, identifiers in `macro_rules!` definitions do not inherit any semantics from the `macro_rules!`'s scope. Since `macro_rules!` macros are items, the scope of their identifiers "should" be the same as that of other items; in particular, the scope should contain only items. Since all items are unhygienic today, this would mean the scope should be empty. However, the scope of an identifier in a `macro_rules!` statement today is the scope that the identifier would have if it replaced the `macro_rules!` (excluding anything unhygienic, i.e. locals only). To continue to support this, this PR tracks the scope of each `macro_rules!` and uses it in `resolve` to ensure that an identifier expanded from a `macro_rules!` gets a chance to resolve to the locals in the `macro_rules!`'s scope. This PR is a pure refactoring. After this PR, - `syntax::ext::expand` is much simpler. - We can expand macros in any order without causing problems for hygiene (needed for macro modularization). - We can deprecate or remove today's `macro_rules!` scope easily. - Expansion performance improves by 25%, post-expansion memory usage decreases by ~5%. - Expanding a block is no longer quadratic in the number of `let` statements (fixes #10607). r? @nrc
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-14Implement latest rfc style using simpler renderingJonathan Turner-1/+1
2016-07-14Rename emit_struct->emitJonathan Turner-1/+1
2016-07-14Remove emit from emitter, leaving emit_structJonathan Turner-24/+1
2016-07-14Remove BasicEmitterJonathan Turner-5/+9
2016-07-14Make `ext::base::expr_to_string` work correctly with `include!` macro ↵Jeffrey Seyfried-0/+6
invocations
2016-07-14Remove irrelevant testsJeffrey Seyfried-169/+3
2016-07-14Implement `macro_rules!` placeholders and the macro scope mapJeffrey Seyfried-7/+46
2016-07-14Instead of renaming, treat differently marked identifiers as unequalJeffrey Seyfried-533/+11
2016-07-14Remove `IllegalCtxt`Jeffrey Seyfried-13/+9
2016-07-13Auto merge of #34772 - jseyfried:cleanup_interner, r=eddybbors-255/+69
Start cleaning up the string interner r? @eddyb
2016-07-13Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrcbors-115/+99
Fix bugs in macro-expanded statement parsing Fixes #34543. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { println!("") println!("") //^ Semicolons are now required on macro-expanded non-braced macro invocations //| in statement positions. let x = 0 //^ Semicolons are now required on macro-expanded `let` statements //| that are followed by more statements, so this would break. let y = 0 //< (this would still be allowed to reduce breakage in the wild) } fn main() { m!() } ``` r? @eddyb
2016-07-13Start a best-effort warning cycle.Jeffrey Seyfried-6/+37
2016-07-13cleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.Jeffrey Seyfried-13/+13
2016-07-13Allow macro-expanded macros in trailing expression positions to expand into ↵Jeffrey Seyfried-1/+2
statements: ```rust macro_rules! m { () => { let x = 1; x } } macro_rules! n { () => { m!() //< This can now expand into statements }} fn main() { n!(); } ``` and revert needless fallout fixes.
2016-07-13Fix bug in the pretty printer.Jeffrey Seyfried-3/+2
2016-07-12Parse macro-expanded statements like ordinary statements.Jeffrey Seyfried-3/+9
2016-07-12Clean up statement parsing without changing the semantics of `parse_stmt`.Jeffrey Seyfried-112/+59