about summary refs log tree commit diff
path: root/src/libsyntax/ext/source_util.rs
AgeCommit message (Collapse)AuthorLines
2014-11-20Rename `col!` to `column!`.Huon Wilson-3/+3
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467. [breaking-change]
2014-10-30rustc: Implement -l and include! tweaksAlex Crichton-6/+29
This is an implementation of the rustc bits of [RFC 403][rfc]. This adds a new flag to the compiler, `-l`, as well as tweaking the `include!` macro (and related source-centric macros). The compiler's new `-l` flag is used to link libraries in from the command line. This flag stacks with `#[link]` directives already found in the program. The purpose of this flag, also stated in the RFC, is to ease linking against native libraries which have wildly different requirements across platforms and even within distributions of one platform. This flag accepts a string of the form `NAME[:KIND]` where `KIND` is optional or one of dylib, static, or framework. This is roughly equivalent to if the equivalent `#[link]` directive were just written in the program. The `include!` macro has been modified to recursively expand macros to allow usage of `concat!` as an argument, for example. The use case spelled out in RFC 403 was for `env!` to be used as well to include compile-time generated files. The macro also received a bit of tweaking to allow it to expand to either an expression or a series of items, depending on what context it's used in. [rfc]: https://github.com/rust-lang/rfcs/pull/403
2014-09-18syntax: use an index in CodeMap instead of Gc for ExpnInfo.Eduard Burtescu-37/+9
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-8/+8
2014-07-15Fix errorsAdolfo Ochagavía-1/+0
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-5/+5
Use `String::from_utf8` instead [breaking-change]
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.