summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-10-30Prepared `std::sys` for removal, and made `begin_unwind` simplerMarvin Löbel-59/+51
- `begin_unwind` is now generic over any `T: Any + Send`. - Every value you fail with gets boxed as an `~Any`. - Because of implementation details, `&'static str` and `~str` are still handled specially behind the scenes. - Changed the big macro source string in libsyntax to a raw string literal, and enabled doc comments there.
2013-10-28Field identifiers now include specific spans (Closes #8263).Joshua Yanovski-1/+1
2013-10-28auto merge of #10117 : huonw/rust/dead-visits, r=sanxiynbors-63/+70
Used nowhere, and these are likely incorrect anyway: self needs to be dereferenced once more otherwise the method calls will be reusing the current impl... bam! Infinite recursion.
2013-10-28Remove the extension traits for Readers/WritersAlex Crichton-1/+1
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits.
2013-10-28syntax: remove dead @mut Visitor impl (only used in tests).Huon Wilson-63/+70
Also, move some code only uses in the tests into the test module, and replace some needless @mut ~[] with plain ~[].
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-16/+20
2013-10-24Test fixes and merge conflictsAlex Crichton-0/+1
2013-10-24Remove io::read_errorAlex Crichton-5/+3
The general idea is to remove conditions completely from I/O, so in the meantime remove the read_error condition to mean the same thing as the io_error condition.
2013-10-24Remove even more of std::ioAlex Crichton-35/+53
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-1/+1
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-1/+1
2013-10-22Remove the now-duplicate logging macrosAlex Crichton-8/+0
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-32/+32
Who doesn't like a massive renaming?
2013-10-21std: Move sys::log_str to repr::repr_to_str. Further work on #2240.Brian Anderson-3/+4
2013-10-20Don't allocate a string when calling printlnAlex Crichton-7/+2
Instead use format_args! to pass around a struct to pass along into std::fmt
2013-10-18auto merge of #9919 : alexcrichton/rust/fmt-begone, r=huonwbors-362/+25
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)
2013-10-18Remove the fmt! syntax extensionAlex Crichton-362/+25
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)
2013-10-18auto merge of #9851 : alexcrichton/rust/include_bin, r=huonwbors-8/+11
Previously an ExprLit was created *per byte* causing a huge increase in memory bloat. This adds a new `lit_binary` to contain a literal of binary data, which is currently only used by the include_bin! syntax extension. This massively speeds up compilation times of the shootout-k-nucleotide-pipes test before: time: 469s memory: 6GB assertion failure in LLVM (section too large) after: time: 2.50s memory: 124MB Closes #2598
2013-10-18Optimize include_bin! for large inputsAlex Crichton-8/+11
Previously an ExprLit was created *per byte* causing a huge increase in memory bloat. This adds a new `lit_binary` to contain a literal of binary data, which is currently only used by the include_bin! syntax extension. This massively speeds up compilation times of the shootout-k-nucleotide-pipes test before: time: 469s memory: 6GB assertion failure in LLVM (section too large) after: time: 2.50s memory: 124MB Closes #2598
2013-10-18Handle inline asm outputs as write-only in liveness, borrowck and trans.Eduard Burtescu-6/+15
2013-10-16auto merge of #9833 : alexcrichton/rust/fixes, r=brsonbors-4/+18
Commits have all the fun details
2013-10-16path2: Update based on more review feedbackKevin Ballard-1/+1
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15Build a few extra features into format! parsingAlex Crichton-4/+17
* Allow named parameters to specify width/precision * Intepret the format string '0$' as "width is the 0th argument" instead of thinking the lone '0' was the sign-aware-zero-padding flag. To get both you'd need to put '00$' which makes more sense if you want both to happen. Closes #9669
2013-10-15Require module documentation with missing_docAlex Crichton-0/+1
Closes #9824
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-4/+4
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-7/+9
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-14Remove unused abi attributes.Steve Klabnik-1/+0
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-10-09auto merge of #9783 : huonw/rust/macro-items, r=bstriebors-2/+5
Fixes #4471.
2013-10-10syntax: allow macros to expand to items with attributes.Huon Wilson-2/+5
Fixes #4471.
2013-10-09option: rewrite the API to use compositionDaniel Micay-6/+6
2013-10-07auto merge of #9674 : ben0x539/rust/raw-str, r=alexcrichtonbors-18/+35
This branch parses raw string literals as in #9411.
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-17/+26
For the benefit of the pretty printer we want to keep track of how string literals in the ast were originally represented in the source code. This commit changes parser functions so they don't extract strings from the token stream without at least also returning what style of string literal it was. This is stored in the resulting ast node for string literals, obviously, for the package id in `extern mod = r"package id"` view items, for the inline asm in `asm!()` invocations. For `asm!()`'s other arguments or for `extern "Rust" fn()` items, I just the style of string, because it seemed disproportionally cumbersome to thread that information through the string processing that happens with those string literals, given the limited advantage raw string literals would provide in these positions. The other syntax extensions don't seem to store passed string literals in the ast, so they also discard the style of strings they parse.
2013-10-08add token::LIT_STR_RAW(ident, num of # symbols)Benjamin Herr-1/+9
Treat it as a synonym for LIT_STR for now.
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-2/+4
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-6/+6
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02syntax: swap from .span_fatal to .span_err in #[deriving(FromPrimitive)]Erick Tryzelaar-9/+21
2013-10-02syntax: Add #[deriving(FromPrimitive)] syntax extensionErick Tryzelaar-0/+152
Right now this only works for c-style enums.
2013-10-02auto merge of #9673 : huonw/rust/macros, r=catamorphismbors-78/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-3/+3
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-02syntax: indicate an error when a macro ignores trailing tokens.Huon Wilson-5/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02syntax: remove some dead code.Huon Wilson-73/+0
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-3/+3
Closes #9467
2013-10-01auto merge of #9519 : thestinger/rust/float, r=catamorphismbors-1/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01remove the `float` typeDaniel Micay-1/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01auto merge of #9633 : alexcrichton/rust/issue-9631, r=huonwbors-12/+16
Closes #9631
2013-10-01Fix usage of the old debug! macrosAlex Crichton-1/+1
2013-10-01Change the format! statics to be all-capsAlex Crichton-12/+16
This lets them get past the non_uppercase_statics lint mode (if it's turned on) Closes #9631
2013-10-01Fix typo with format migration: s/oldformat/oldfmt/.Huon Wilson-4/+4
2013-09-30syntax: Remove usage of fmt!Alex Crichton-141/+143
2013-09-30Prevent leakage of fmt! into the compilerAlex Crichton-49/+62
We're not outright removing fmt! just yet, but this prevents it from leaking into the compiler further (it's still turned on by default for all other code).