summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-24/+24
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-3/+5
Small stuff... might as well get it into the tree. One new test case, some issue # cleanup, remove some unused imports.
2013-09-24comment changes onlyJohn Clements-3/+5
2013-09-24Correctly encode item visibility in metadataAlex Crichton-1/+1
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-23librustc: Fix merge fallout.Patrick Walton-1/+1
2013-09-23test: Fix rustdoc and tests.Patrick Walton-3/+4
2013-09-23libsyntax: Introduce routines and remove all `@fn`s from libsyntax save the ↵Patrick Walton-1/+1
old visitor
2013-09-23libsyntax: Remove some more `@fn`s from the macro expanderPatrick Walton-109/+300
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-151/+344
2013-09-20Implement a web backend for rustdoc_ngAlex Crichton-1/+1
This large commit implements and `html` output option for rustdoc_ng. The executable has been altered to be invoked as "rustdoc_ng html <crate>" and it will dump everything into the local "doc" directory. JSON can still be generated by changing 'html' to 'json'. This also fixes a number of bugs in rustdoc_ng relating to comment stripping, along with some other various issues that I found along the way. The `make doc` command has been altered to generate the new documentation into the `doc/ng/$(CRATE)` directories.
2013-09-20Invert --cfg debug to --cfg ndebugAlex Crichton-2/+2
Many people will be very confused that their debug! statements aren't working when they first use rust only to learn that they should have been building with `--cfg debug` the entire time. This inverts the meaning of the flag to instead of enabling debug statements, now it disables debug statements. This way the default behavior is a bit more reasonable, and requires less end-user configuration. Furthermore, this turns on debug by default when building the rustc compiler.
2013-09-19auto merge of #9279 : erickt/rust/master, r=alexcrichtonbors-10/+6
`Some(5).or_{default,zero}` can be easily replaced with `Some(Some(5).unwrap_or_default())`.
2013-09-19auto merge of #9299 : alexcrichton/rust/fmt-trailing-comma, r=huonwbors-0/+1
This is more consistent with other parts of the language and it also makes it easier to use in situations where format string is massive.
2013-09-19auto merge of #9291 : jzelinskie/rust/remove-cond, r=alexcrichtonbors-36/+0
This is my first contribution, so please point out anything that I may have missed. I consulted IRC and settled on `match () { ... }` for most of the replacements.
2013-09-18Allow trailing commas in format!Alex Crichton-0/+1
This is more consistent with other parts of the language and it also makes it easier to use in situations where format string is massive.
2013-09-18Register new snapshotsAlex Crichton-34/+2
2013-09-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-36/+0
2013-09-17extra: minor cleanup of Zero and Default syntax extensionErick Tryzelaar-10/+6
2013-09-16Limit spans in bytes!() error messages to the argument in questionKevin Ballard-10/+10
This constrains the span to the appropriate argument, so you know which one caused the problem. Instead of foo.rs:2:4: 2:21 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~~~~~~~~~~~~~~~ it will say foo.rs:2:14 2:17 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~
2013-09-15Fix expand_stmt as well as expand_expr to use the correct spanAlex Crichton-15/+25
The same fix as before is still relevant, I just forgot to update the expand_stmt macro expansion site. The tests for format!() suffice as tests for this change.
2013-09-15Reduce the amount of complexity in format!Alex Crichton-121/+61
This renames the syntax-extension file to format from ifmt, and it also reduces the amount of complexity inside by defining all other macros in terms of format_args!
2013-09-14auto merge of #9183 : alexcrichton/rust/issue-5794, r=catamorphismbors-1/+19
Closes #5794
2013-09-14auto merge of #9181 : lkuper/rust/libsyntax-default-methods-refactor, ↵bors-198/+2
r=alexcrichton I'm getting the three `make check` failures mentioned in issue #9127, which I also get building master.
2013-09-13Pass a more proper span to the syntax expandersAlex Crichton-1/+19
Closes #5794
2013-09-13Refactor libsyntax Visitor impls to use default methods.Lindsey Kuper-198/+2
2013-09-12syntax: add #[deriving(Default)] syntax extensionErick Tryzelaar-0/+81
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-5/+12
2013-09-12Implement a format_args!() macroAlex Crichton-61/+108
The purpose of this macro is to further reduce the number of allocations which occur when dealing with formatting strings. This macro will perform all of the static analysis necessary to validate that a format string is safe, and then it will wrap up the "format string" into an opaque struct which can then be passed around. Two safe functions are added (write/format) which take this opaque argument structure, unwrap it, and then call the unsafe version of write/format (in an unsafe block). Other than these two functions, it is not intended for anyone to ever look inside this opaque struct. The macro looks a bit odd, but mostly because of rvalue lifetimes this is the only way for it to be safe that I know of. Example use-cases of this are: * third-party libraries can use the default formatting syntax without any forced allocations * the fail!() macro can avoid allocating the format string * the logging macros can avoid allocation any strings
2013-09-11Flag unsafe blocks from format! as compiler-generatedAlex Crichton-1/+1
2013-09-10change type of ExprLoop and ExprBreak elts from ident->name.John Clements-1/+3
Lots of downstream changes in librustc, should be infinitesimally faster.
2013-09-10auto merge of #9088 : nikomatsakis/rust/issue-6304-AST-tree-not-DAG, ↵bors-67/+40
r=catamorphism Ensures that each AST node has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-10Delay assignment of node ids until after expansion. Ensures that each AST nodeNiko Matsakis-67/+40
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-09auto merge of #9062 : blake2-ppc/rust/vec-iterator, r=alexcrichtonbors-1/+1
Visit the free functions of std::vec and reimplement or remove some. Most prominently, remove `each_permutation` and replace with two iterators, ElementSwaps and Permutations. Replace unzip, unzip_slice with an updated `unzip` that works with an iterator argument. Replace each_permutation with a Permutation iterator. The new permutation iterator is more efficient since it uses an algorithm that produces permutations in an order where each is only one element swap apart, including swapping back to the original state with one swap at the end. Unify the seldomly used functions `build`, `build_sized`, `build_sized_opt` into just one function `build`. Remove `equal_sizes`
2013-09-10std::at_vec and vec: Unify build_sized, build_sized_opt into buildblake2-ppc-1/+1
These functions have very few users since they are mostly replaced by iterator-based constructions. Convert a few remaining users in-tree, and reduce the number of functions by basically renaming build_sized_opt to build, and removing the other two. This for both the vec and the at_vec versions.
2013-09-09auto merge of #9005 : alexcrichton/rust/rusty-log, r=brsonbors-52/+34
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
2013-09-08syntax: aesthetic improvements to the `for` desugaring.Huon Wilson-130/+38
2013-09-08syntax: implement labelled breaks for `for`.Huon Wilson-2/+2
`for` desugars to `loop` so it is trivial to just desugar to `loop` while retaining any label.
2013-09-06added index to test cases, more debugging outputJohn Clements-4/+11
2013-09-06quote_* macros no longer need to be capturingJohn Clements-91/+19
This is actually almost a problem, because those were my poster-child macros for "here's how to implement a capturing macro." Following this change, there will be no macros that use capturing; this will probably make life unpleasant for the first person that wants to implement a capturing macro. I should probably create a dummy_capturing macro, just to show how it works.
2013-09-06add test case, cleanupJohn Clements-15/+14
2013-09-06fixed a bug that caused double-expand-traversal of macros that expand into ↵John Clements-19/+10
modules.
2013-09-06WIP: adding mark-cancelling for macro_rulesJohn Clements-7/+47
2013-09-06comment on hygienic context extension train fnsJohn Clements-0/+11
2013-09-06awesome new bug! added test caseJohn Clements-13/+68
2013-09-06remove unneeded imports, clean up unused var warningsJohn Clements-9/+9
2013-09-06whitespace, reindentation, and comments onlyJohn Clements-19/+22
2013-09-06uncomment mtwt_resolve callsJohn Clements-2/+2
2013-09-06fix one remaining token comparison, refactor token comparison to avoid == checkJohn Clements-11/+10
2013-09-06remove dead codeJohn Clements-15/+0
2013-09-06capturing macros now implementedJohn Clements-85/+221