about summary refs log tree commit diff
path: root/src/libsyntax/ext/source_util.rs
AgeCommit message (Collapse)AuthorLines
2014-07-09syntax: doc comments all the thingsCorey Richardson-7/+7
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-2/+2
[breaking-change]
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-1/+2
2014-06-06Change to_str().to_string() to just to_str()Adolfo Ochagavía-1/+1
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-1/+3
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-3/+11
2014-05-17syntax: Tighten search paths for inner modulesAlex Crichton-0/+2
This is an implementation of RFC 16. A module can now only be loaded if the module declaring `mod name;` "owns" the current directory. A module is considered as owning its directory if it meets one of the following criteria: * It is the top-level crate file * It is a `mod.rs` file * It was loaded via `#[path]` * It was loaded via `include!` * The module was declared via an inline `mod foo { ... }` statement For example, this directory structure is now invalid // lib.rs mod foo; // foo.rs mod bar; // bar.rs; fn bar() {} With this change `foo.rs` must be renamed to `foo/mod.rs`, and `bar.rs` must be renamed to `foo/bar.rs`. This makes it clear that `bar` is a submodule of `foo`, and can only be accessed through `foo`. RFC: 0016-module-file-system-hierarchy Closes #14180 [breaking-change]
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-7/+8
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-9/+8
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-16syntax: unify all MacResult's into a single trait.Huon Wilson-22/+22
There's now one unified way to return things from a macro, instead of being able to choose the `AnyMacro` trait or the `MRItem`/`MRExpr` variants of the `MacResult` enum. This does simplify the logic handling the expansions, but the biggest value of this is it makes macros in (for example) type position easier to implement, as there's this single thing to modify. By my measurements (using `-Z time-passes` on libstd and librustc etc.), this appears to have little-to-no impact on expansion speed. There are presumably larger costs than the small number of extra allocations and virtual calls this adds (notably, all `macro_rules!`-defined macros have not changed in behaviour, since they had to use the `AnyMacro` trait anyway).
2014-04-06De-~[] Reader and WriterSteven Fackler-2/+2
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-0/+2
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-1/+1
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-2/+2
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-0/+1
2014-02-18Avoid returning original macro if expansion fails.Douglas Young-6/+6
Closes #11692. Instead of returning the original expression, a dummy expression (with identical span) is returned. This prevents infinite loops of failed expansions as well as odd double error messages in certain situations.
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-6/+2
2014-02-03syntax: Remove io_error usageAlex Crichton-5/+4
2014-02-02syntax: convert LitBinary from @[u8] to Rc<~[u8]>.Huon Wilson-4/+2
2014-02-02librustc: Fix merge fallout.Patrick Walton-1/+6
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-1/+1
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-2/+2
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-6/+7
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-18syntax::ext: replace span_fatal with span_err in many places.Huon Wilson-8/+18
This means that compilation continues for longer, and so we can see more errors per compile. This is mildly more user-friendly because it stops users having to run rustc n times to see n macro errors: just run it once to see all of them.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-9/+9
2014-01-08Fix CodeMap issue in expand_include_str()Michael Woerister-13/+6
2014-01-04etc: licenseck: don't hardcode a specific yearAdrien Tétar-2/+2
2014-01-03libsyntax: De-`@mut` `CodeMap::files`Patrick Walton-1/+2
2014-01-03libsyntax: De-`@mut` `FileMap::multibyte_chars`Patrick Walton-1/+1
2014-01-03libsyntax: De-`@mut` `FileMap::lines`Patrick Walton-1/+2
2014-01-02libsyntax: Make the parser mutablePatrick Walton-3/+7
2013-12-29Start passing around &mut ExtCtxtSteven Fackler-9/+9
2013-12-28Stop using @ExtCtxtSteven Fackler-9/+9
2013-12-10Fix missing code map entry for uses of `include_str!`.Jack Moffitt-1/+15
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-4/+4
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-4/+4
2013-11-28Register new snapshotsAlex Crichton-3/+3
2013-11-11Move std::rt::io to std::ioAlex Crichton-2/+2
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-4/+3
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-17/+8
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
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-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-16/+35
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-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-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-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.