Commit Graph

154 Commits

Author SHA1 Message Date
Alex Crichton
a41b0c2529 extern mod => extern crate
This was previously implemented, and it just needed a snapshot to go through
2014-02-14 22:55:21 -08:00
Eduard Burtescu
a02b10a062 Refactored ast_map and friends, mainly to have Paths without storing them. 2014-02-14 08:43:29 +02:00
Flavio Percoco
968633b60a Replace crate usage with krate
This patch replaces all `crate` usage with `krate` before introducing the
new keyword. This ensures that after introducing the keyword, there
won't be any compilation errors.

krate might not be the most expressive substitution for crate but it's a
very close abbreviation for it. `module` was already used in several
places already.
2014-02-13 20:52:07 +01:00
Patrick Walton
b890237e79 libsyntax: Fix tests. 2014-02-02 01:44:48 +11:00
Patrick Walton
c5cbfe89f8 librustc: De-@str NameAndSpan 2014-02-02 01:44:48 +11:00
Patrick Walton
8e52b85d5a libsyntax: De-@str literal strings in the AST 2014-02-02 01:44:48 +11:00
Patrick Walton
70c5a0fbf7 libsyntax: Introduce an InternedString type to reduce @str in the
compiler and use it for attributes
2014-02-02 01:44:47 +11:00
bors
b5a110c7fe auto merge of #11607 : alexcrichton/rust/issue-9957, r=cmr
For `use` statements, this means disallowing qualifiers when in functions and
disallowing `priv` outside of functions.

For `extern mod` statements, this means disallowing everything everywhere. It
may have been envisioned for `pub extern mod foo` to be a thing, but it
currently doesn't do anything (resolve doesn't pick it up), so better to err on
the side of forwards-compatibility and forbid it entirely for now.

Closes #9957
2014-01-18 13:01:47 -08:00
Alex Crichton
4a78364d49 Forbid unnecessary visibility on view items
For `use` statements, this means disallowing qualifiers when in functions and
disallowing `priv` outside of functions.

For `extern mod` statements, this means disallowing everything everywhere. It
may have been envisioned for `pub extern mod foo` to be a thing, but it
currently doesn't do anything (resolve doesn't pick it up), so better to err on
the side of forwards-compatibility and forbid it entirely for now.

Closes #9957
2014-01-18 10:46:32 -08:00
Steven Fackler
328b47d837 Load macros from external modules 2014-01-16 15:01:48 -08:00
Alex Crichton
7a37294acc Add a configure to disable libstd version injection
We'll use this when building snapshots so we can upgrade freely, but all
compilers will inject a version by default.
2014-01-15 08:22:16 -08:00
Brian Anderson
46905c04f5 Bump version to 0.10-pre 2014-01-12 17:45:22 -08:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
bors
0df9b850ac auto merge of #10696 : fhahn/rust/issue9543-remove-extern-mod-foo, r=pcwalton
This patch for  #9543 throws an `obsolete syntax` error for `extern mod foo (name="bar")` . 
I was wondering if [this](https://github.com/fhahn/rust/compare/mozilla:master...fhahn:issue9543-remove-extern-mod-foo?expand=1#diff-da9d34ca1d0f6beee2838cf02e07345cR4444) is the correct place to do this?

I think the wording of the error message could probably be improved as well.

If this approach is OK, I'm going to run the whole test suite tomorrow and update the old syntax to the new one.
2014-01-02 11:32:09 -08:00
Florian Hahn
4cb13ed982 Inject std libs with versions 2014-01-02 16:05:09 +01:00
Florian Hahn
f42a36cded Remove extern mod foo (name="bar") syntax, closes #9543 2014-01-01 23:36:57 +01:00
klutzy
9cdad685a3 syntax::codemap: Add static DUMMY_SP
It replaces `dummy_sp()`.
2014-01-01 19:51:35 +09:00
bors
f37b746699 auto merge of #11182 : luisbg/rust/crateid, r=cmr
Issue #11048
2013-12-30 04:32:09 -08:00
Steven Fackler
dc830345e8 Remove @muts from ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
3965dddf49 Make ast_fold take &mut self 2013-12-29 23:41:05 -08:00
Luis de Bethencourt
4bc09713df Rename pkgid variables 2013-12-29 15:25:26 -05:00
Steven Fackler
0607c138ca Stop using @ExtCtxt 2013-12-28 21:16:03 -07:00
Patrick Walton
d7b152701e librustc: De-@mut building_library in the session 2013-12-26 15:54:36 -08:00
Patrick Walton
7cb234bee9 librustc: De-@mut the test context 2013-12-26 15:54:33 -08:00
Patrick Walton
d0dfc35fc9 librustc: De-@mut TestCtxt::testfns 2013-12-26 15:54:33 -08:00
Patrick Walton
9ff65b503f librustc: De-@mut TestCtxt::path 2013-12-26 15:54:32 -08:00
Alex Crichton
d9ea475feb Register new snapshots
Understand 'pkgid' in stage0. As a bonus, the snapshot now contains now metadata
(now that those changes have landed), and the snapshot download is half as large
as it used to be!
2013-12-15 22:17:59 -08:00
Seo Sanghyeon
3b14f25868 Extend allocation lint for boxing expressions 2013-12-10 01:17:32 +09:00
Huon Wilson
3ef933647a syntax: print expansion info from #[attribute] macros in the correct
format.

Previously, any attempt to use this information from inside something
like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
2013-12-07 13:41:11 +11:00
Steven Fackler
c144752a2d Support multiple item macros
Closes #4375
2013-11-26 13:56:02 -08:00
Patrick Walton
8ceb374ab7 librustc: Remove non-procedure uses of do from librustc, librustdoc,
and librustpkg.
2013-11-26 08:25:00 -08:00
Niko Matsakis
1f4faaee40 Generalize AST and ty::Generics to accept multiple lifetimes. 2013-11-08 19:42:46 -05:00
Alex Crichton
daf5f5a4d1 Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00
Benjamin Herr
9d7b130041 add new enum ast::StrStyle as field to ast::lit_str
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-08 03:43:28 +02:00
Alex Crichton
1b80558be3 rustc: Remove usage of fmt! 2013-09-30 23:21:19 -07:00
Alex Crichton
7b18976f08 Remove all usage of @ast::Crate 2013-09-29 16:21:25 -07:00
Brian Anderson
99c1fb8c66 Update version numbers to 0.9-pre 2013-09-26 18:18:42 -07:00
Patrick Walton
33993535ef librustc: Remove garbage collected functions from front/{config,test} and metadata/{tydecode,tyencode} 2013-09-23 18:23:17 -07:00
Patrick Walton
3e5de06135 librustc: Change fold to use traits instead of @fn. 2013-09-23 18:23:17 -07:00
Brian Anderson
695cb9fc2b Update version numbers to 0.8 2013-09-21 16:25:08 -07:00
Alex Crichton
817576ee70 Register new snapshots 2013-09-18 11:07:22 -07:00
Niko Matsakis
a5ad4c3794 Delay assignment of node ids until after expansion. 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-10 05:45:12 -04:00
Marvin Löbel
7419085337 Modernized a few more types in syntax::ast 2013-09-03 14:45:06 +02:00
Marvin Löbel
857f867320 Renamed syntax::ast::ident -> Ident 2013-09-02 02:51:21 +02:00
Marvin Löbel
539f37925c Modernized a few type names in rustc and syntax 2013-09-01 14:43:26 +02:00
Patrick Walton
8693943676 librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking
trait methods, and fixes all places in the standard library that were
relying on it. It is somewhat awkward in places; I think we'll probably
want something like the `Foo::<for T>::new()` syntax.
2013-08-27 18:47:57 -07:00
Patrick Walton
3b6314c39b librustc: Add support for type parameters in the middle of paths.
For example, `foo::<T>::bar::<U>`.

This doesn't enforce that the type parameters are in the right
positions, however.
2013-08-27 18:46:51 -07:00
Steven Fackler
8b80922a4c quote_*! macros take an ExtCtx
They previously required one called "ext_cx" to be in scope.

Fixes part of #7727
2013-08-18 13:14:15 -04:00
Erick Tryzelaar
68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Tim Chevalier
96fd606ddd std/rustc/rustpkg/syntax: Support the extern mod = ... form
This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09 14:11:50 -07:00