Commit Graph

539 Commits

Author SHA1 Message Date
Niko Matsakis
5d540de769 fixup mutability of vec::each, make iter_bytes pure
also, change DVec() to work with imm vectors rather than mut ones
2012-09-12 13:29:31 -07:00
Tim Chevalier
86e02554fd Make moves in arguments explicit in libsyntax and rustc 2012-09-12 11:33:40 -07:00
Brian Anderson
320331fe35 Use a different strategy for transitioning to camel case extfmt 2012-09-12 11:22:48 -07:00
Niko Matsakis
8a8f200d10 Introduce auto adjustment table to subsume autoderef/autoref/borrowings.
Fixes #3261
Fixes #3443
2012-09-11 21:25:01 -07:00
Brian Anderson
2c6c963f61 Convert core::extfmt to camel case 2012-09-11 19:41:07 -07:00
Brian Anderson
be1fdf983f Promote 'impl' from restricted keyword to strict 2012-09-11 19:28:44 -07:00
Brian Anderson
3d2a74a160 Reserve 'be' as a keyword 2012-09-11 19:26:48 -07:00
Brian Anderson
ea01ee2e9e Convert 'use' to 'extern mod'. Remove old 'use' syntax 2012-09-11 19:25:43 -07:00
Brian Anderson
fb851242b7 Promote 'pub' and 'priv' from restricted to strict keywords 2012-09-11 18:17:26 -07:00
Brian Anderson
27cc0a36b6 Promote 'struct' from a restricted keyword to a strict keyword 2012-09-11 17:15:33 -07:00
Brian Anderson
1203da3b9d Remove priv sections from classes. Obsolete the syntax 2012-09-11 15:29:37 -07:00
Brian Anderson
298eb8c726 Convert 'import' to 'use'. Remove 'import' keyword. 2012-09-10 19:04:26 -07:00
Brian Anderson
1a8a0a77b1 Camel case std::serialization 2012-09-10 19:02:57 -07:00
Tim Chevalier
f8b3eaae82 Make all moves explicit in libsyntax 2012-09-10 18:28:47 -07:00
Brian Anderson
6957af770b Report obsolete trait lists on structs 2012-09-10 18:12:35 -07:00
Brian Anderson
73eb894305 Report obsolete class method syntax 2012-09-10 17:48:33 -07:00
Brian Anderson
df79026169 Promote 'return' from a restricted keyword to a strict keyword 2012-09-10 17:27:10 -07:00
Brian Anderson
cb7a5395dd Convert std::map to camel case 2012-09-10 17:08:36 -07:00
Brian Anderson
93d3b8aa6b Convert class methods to impl methods. Stop parsing class methods 2012-09-10 16:13:08 -07:00
Tim Chevalier
1a33c25d6f Make moves explicit in pipes and pipe compiler 2012-09-10 15:15:10 -07:00
Patrick Walton
22b8757705 rustc: Make shape-based compare glue never called for comparison operators.
Only called for string patterns.
2012-09-10 12:48:42 -07:00
Brian Anderson
ef9aa80438 Promote most restricted keywords to strict keywords 2012-09-10 12:07:19 -07:00
Brian Anderson
901543ff89 Reformat comments 2012-09-09 17:42:00 -07:00
Brian Anderson
e7a01b7383 Introduce 'strict' keywords, that may not be used as idents anywhere 2012-09-09 17:35:56 -07:00
Brian Anderson
528373b79b Turn most contextual keywords into restricted keywords 2012-09-09 16:53:47 -07:00
Brian Anderson
25dc59dc59 libsyntax: Parse and report errors for a few obsolete syntaxes 2012-09-08 20:04:21 -07:00
Brian Anderson
3bd1f32cd9 Convert all kind bounds to camel case. Remove send, owned keywords. 2012-09-07 18:10:11 -07:00
Brian Anderson
2810ea9a68 Convert 'again' to 'loop'. Remove 'again' keyword 2012-09-07 17:39:03 -07:00
Graydon Hoare
073df63c72 Fix long line. 2012-09-07 17:27:05 -07:00
Graydon Hoare
8b39e73697 Fix whitespace. 2012-09-07 17:26:10 -07:00
Graydon Hoare
5d823d46ad Migrate std::map to use core:#️⃣:Hash trait. Disable many hokey hashes. 2012-09-07 17:24:16 -07:00
Tim Chevalier
f5093dff7b Remove support for multiple traits in a single impl
There was half-working support for them, but they were never fully
implemented or even approved. Remove them altogether.

Closes #3410
2012-09-07 17:22:04 -07:00
Tim Chevalier
53ce42dc4f Implement &-patterns
Closes #2855
2012-09-07 17:09:07 -07:00
Graydon Hoare
e9f5a099df Add an ignore! macro, remove support for nested block comments, re: #2755. 2012-09-07 16:58:36 -07:00
Brian Anderson
249668f223 Remove module keyword 2012-09-07 16:53:21 -07:00
Brian Anderson
f0eae8f1c1 Convert field terminators to commas. Stop parsing semis. 2012-09-07 16:12:15 -07:00
Brian Anderson
2572e80355 Remove 'let' syntax for struct fields 2012-09-07 14:02:33 -07:00
Patrick Walton
c21b3ff818 rustc: Make "ne" use traits 2012-09-07 12:44:53 -07:00
Patrick Walton
feb014eb3c rustc: Add an "ne" method to the Eq trait, and implement it everywhere 2012-09-07 12:24:48 -07:00
Brian Anderson
b4e547d71a Remove struct ctors 2012-09-06 10:52:26 -07:00
Niko Matsakis
5e36a99794 Refactor trans to replace lvalue and friends with Datum.
Also:
- report illegal move/ref combos whether or not ref comes first
- commented out fix for #3387, too restrictive and causes an ICE
2012-09-06 06:11:12 -07:00
Brian Anderson
f7681f9236 Accept Copy, Send, Const, Owned, as kind bounds 2012-09-05 15:31:38 -07:00
Patrick Walton
e7fe903d88 libsyntax: Make "pub use" mean the same thing as the former "import" in all circumstances 2012-09-05 13:26:46 -07:00
Patrick Walton
47dac47e96 rustc: "import" -> "use" in .rc files 2012-09-05 11:46:25 -07:00
Patrick Walton
fba673b26b rustc: Implement private methods.
Doesn't work cross-crate yet.
2012-09-04 18:30:27 -07:00
Tim Chevalier
451da07718 Allow anonymous extern mods
Now you can write:

extern {
  f() -> int;
}

and f will be accessible in the enclosing scope.
2012-09-04 16:41:19 -07:00
Brian Anderson
200959d7ce Remove 'with' 2012-09-04 15:47:04 -07:00
Brian Anderson
ab9cf45a7c syntax: Remove 'of' and 'check' from keyword table 2012-09-04 15:43:46 -07:00
Brian Anderson
d3e75ea375 Parse 'loop' and 'again' the same 2012-09-04 13:37:11 -07:00
Patrick Walton
8ff18acc82 libsyntax: "import" -> "use" 2012-09-04 11:43:23 -07:00
Brian Anderson
7fb1a4e2d1 Camel case core::intrinsic 2012-09-02 15:19:52 -07:00
Brian Anderson
80c4f74c29 Remove the 'to' keyword 2012-09-01 18:38:18 -07:00
Tim Chevalier
4128cc4cb4 Make utility funs in core::int, core::uint, etc. not by-reference
Closes #3302
2012-08-31 16:21:47 -07:00
Patrick Walton
340a219290 libsyntax: Get "extern mod foo;" working in .rc files 2012-08-31 11:46:04 -07:00
Patrick Walton
6e7d5e1cbd rustc: Implement "use mod" 2012-08-31 11:20:50 -07:00
Graydon Hoare
28b1473f84 Fix anon-extern-mod pretty print test. 2012-08-31 10:30:32 -07:00
Patrick Walton
4846affedb rustc: "extern mod { ... }" should be written "extern { ... }" instead 2012-08-30 17:10:07 -07:00
Brian Anderson
65b05a6ce8 Bump version to 0.4 2012-08-30 14:05:59 -07:00
Patrick Walton
a1c11cab2d rustc: Make <=, >=, and > use traits as well 2012-08-29 19:23:15 -07:00
Patrick Walton
96534365c2 rustc: Make < and = into traits 2012-08-29 18:25:22 -07:00
Brian Anderson
c0c8d3aa8f core: Demode int/uint mods 2012-08-29 16:23:36 -07:00
Tim Chevalier
cb8ecd7984 Allow extern mods to be anonymous
extern mod {
  f();
}

is now allowed, and puts f in the enclosing scope. (Requires a
link_name attribute to be really useful...)
2012-08-29 12:22:05 -07:00
Ben Striegel
a605fd0cad CamelCasify lots of std 2012-08-28 18:52:44 -07:00
Brian Anderson
cfbc7cbdc7 Convert core::pipes to camel case 2012-08-28 14:33:18 -07:00
Brian Anderson
161a82e433 Camel case various core constructors 2012-08-27 17:22:18 -07:00
Brian Anderson
0c6e470a25 Convert core::result to camel case 2012-08-27 14:37:04 -07:00
Erick Tryzelaar
65bd46c8a5 rustc: more pattern cleanup 2012-08-27 14:10:54 -07:00
Brian Anderson
8337fa1a54 Camel case the option type 2012-08-26 15:56:16 -07:00
Patrick Walton
d77acf7d07 libsyntax: Accept ',' to separate struct fields. Closes #3263. 2012-08-25 16:06:35 -07:00
Patrick Walton
8ef4551904 rustc: Implement foreign constants.
This is needed for a lot of Apple libraries, as Apple tends to put a lot of
globals in dynamic libraries.
2012-08-25 15:09:33 -07:00
Tim Chevalier
5e22fb9c7f Remove match check 2012-08-24 22:28:12 -07:00
Paul Stansifer
18180fd5da "earley_parser" -> "macro_parser" Let's be less confusing. 2012-08-24 18:20:17 -07:00
Paul Stansifer
e54acbf848 Document the macro parser a little more. 2012-08-24 18:20:17 -07:00
Graydon Hoare
c284b8b1dc Start using core::path2::Path in a lot of places. 2012-08-24 15:51:16 -07:00
Niko Matsakis
a8f1bee457 fix some unused pattern binding warnings 2012-08-24 15:37:21 -07:00
Niko Matsakis
e47d2f6060 extend liveness to treat bindings more like other variables
This results in a lot of warnings in rustc.  I left them in because
many are bugs and we should fix our code, but Graydon asked that
I not touch every file in the codebase.
2012-08-24 12:55:08 -07:00
Paul Stansifer
aa024acae3 Use a faked-up function as a key, because functions aren't identical cross-crate in Windows. 2012-08-24 12:20:06 -07:00
Michael Sullivan
0f996f70a6 Remove purity from fn_decl and move it out to containing AST elements. 2012-08-23 19:40:01 -07:00
Niko Matsakis
a08f3a7d4d More complete fix to #3162 (borrowck bug related to access to rec fields) 2012-08-23 18:54:08 -07:00
Tim Chevalier
80d129aa45 Parenthesize unary move exprs in prettyprinter
Closes #3220
2012-08-23 16:59:05 -07:00
Paul Stansifer
129c4b694b Give a special error message when [de]serializing fails because the interner isn't in TLS yet. 2012-08-23 11:47:35 -07:00
Paul Stansifer
89bbaff84f m1!{...} is now forbidden. Use m1!(...) instead. 2012-08-23 11:14:15 -07:00
Paul Stansifer
11b640d990 Pretty-print macros with () instead of {}. 2012-08-23 11:14:15 -07:00
Paul Stansifer
77e83d83a9 Change calls of proto! to use parens. 2012-08-23 11:14:15 -07:00
Paul Stansifer
c74a442e86 Eliminate some extraneous curly brackets inside invocations of macro_rules!. 2012-08-23 11:14:14 -07:00
Paul Stansifer
29f32b4a72 m1!{...} -> m1!(...) 2012-08-23 11:14:14 -07:00
Niko Matsakis
511e7626ae Infer variance of types with respect to the region parameter.
A similar approach could be used for type parameters.

Fixes #2282.
2012-08-23 06:30:43 -07:00
Ben Blum
5b25fc918a Parse and typecheck moving out of enums (#2329) 2012-08-22 20:40:25 -04:00
Tim Chevalier
1b804ce343 Merge find_linkage_attrs with find_linkage_metas
This gets rid of a gratuitous `match check`.
2012-08-22 16:43:23 -07:00
Tim Chevalier
0a5f88a240 Change the log level to be an enum rather than an int
This allows for eliminating a match check.
2012-08-22 16:14:39 -07:00
Paul Stansifer
1153b5dcc8 intern identifiers 2012-08-22 14:59:25 -07:00
Paul Stansifer
7317bf8792 pre-intern some fixed names so they can be used as constants 2012-08-22 14:59:24 -07:00
Paul Stansifer
9a7890d73a Centralize ident interner generation. 2012-08-22 14:59:24 -07:00
Tim Chevalier
7284969292 Eliminate many match checks in rustc 2012-08-22 12:25:08 -07:00
Niko Matsakis
652b312122 more sound treatment of fn& regions; change all & to be distinct 2012-08-21 10:28:34 -07:00
Michael Sullivan
457e78cd53 Make by-val explicit self actually work. Closes #2585. 2012-08-17 17:14:32 -07:00
Michael Sullivan
2b457c2654 Pretty print explicit self types. Work on #2585. 2012-08-17 17:14:32 -07:00
Michael Sullivan
a65366d548 Parse explicit self in more places. Work on #2585. 2012-08-17 17:14:32 -07:00
Niko Matsakis
ea549e7a71 make borrowck more conservative around rvalues.
this will require more temporaries, but is probably less magical.
also, it means that borrowck matches trans better, so fewer crashes.
bonus.

Finally, stop warning about implicit copies when we are actually borrowing.

Also, one test (vec-res-add) stopped failing due to #2587, and hence I
added an xfail-test.

Fixes #3217, #2977, #3067
2012-08-17 15:14:13 -07:00
Lindsey Kuper
eb834fdb81 Stop parsing iface. 2012-08-17 14:32:34 -07:00
Eric Holk
7bae3449ce Move select macro into another file, so it can be including in multiple tests.
Fixing long lines.
2012-08-17 12:39:51 -07:00
Eric Holk
9260b02daa Track spans better in the protocol compiler so we can get better error messages. 2012-08-17 12:39:51 -07:00
Brian Anderson
3ab4b014cf Remove the class keyword 2012-08-17 10:13:45 -07:00
Patrick Walton
b592d57311 libsyntax: Make include_bin! generate fixed-length vectors.
This is so that we don't generate 170,000-line LLVM functions in Servo.
2012-08-16 17:20:08 -07:00
Patrick Walton
2489baf82e libsyntax: Fix parsing of "loop unsafe".
It was getting misparsed as a label.
2012-08-16 15:19:47 -07:00
Patrick Walton
0d7bef4d48 libsyntax: Fix wrong pretty printing of private fields 2012-08-15 17:48:47 -07:00
Brian Anderson
af43613795 Long lines 2012-08-15 17:32:19 -07:00
Patrick Walton
a78030fbaa libsyntax: Parse tuple and unit structs 2012-08-15 17:11:13 -07:00
Brian Anderson
913f7bdae7 Modify pipec to not emit calls to some and none 2012-08-15 16:53:41 -07:00
Patrick Walton
6319c8fbc4 rustc: Fix long lines and trailing whitespace 2012-08-15 16:25:42 -07:00
Patrick Walton
3038968f28 rustc: Perform some AST surgery to separate out class fields from methods 2012-08-15 16:20:35 -07:00
Patrick Walton
353c632c2d libsyntax: Parse nested enums 2012-08-15 16:20:34 -07:00
Patrick Walton
bdb206f285 rustc: Parse labeled loop, break, and again 2012-08-15 16:20:34 -07:00
Patrick Walton
fe9d07dda6 rustc: "as Trait" can now be written "as @Trait".
There is also code for ~Trait and &Trait, but these are currently (incorrectly)
synonyms for "as @Trait" and "as &Trait".
2012-08-15 16:20:31 -07:00
Brian Anderson
fd0f616ceb pipes: Rename the pipec-generated buffer to __Buffer
Conforms to camel case convention and hides it away so it doesn't conflict
with user code
2012-08-15 15:09:39 -07:00
Brian Anderson
74c69e1053 Convert more core types to camel case 2012-08-15 14:14:20 -07:00
Eric Holk
1e96099918 Add trace_macros! 2012-08-15 11:45:32 -07:00
Tim Chevalier
6d68658b9a Make autoserialize not generate alt checks 2012-08-14 22:13:25 -07:00
Brian Anderson
11258310e2 Convert more core types to camel case 2012-08-14 18:26:03 -07:00
Michael Sullivan
e640a66eb4 Make most forms of explicit self work. By-value not implemented. Work on #2585. 2012-08-14 17:40:04 -07:00
Patrick Walton
138dc3048a libsyntax: Parse "extern mod foo;" 2012-08-14 14:24:00 -07:00
Brian Anderson
350668579a Merge pull request #3194 from dbp/pretty
Pretty printing brackets on match arms
2012-08-14 13:32:29 -07:00
Graydon Hoare
1d3b5478fa Silence unused-variable warning. 2012-08-14 12:15:00 -07:00
Patrick Walton
30e243a5aa libsyntax: Give a nice error message when view items are used anywhere other than the top of a module.
This is a step on the way to parsing "extern mod foo;"
2012-08-14 11:23:25 -07:00
Patrick Walton
81e6bb1b4b libsyntax: First steps toward parsing "extern mod std;" 2012-08-14 11:08:15 -07:00
Daniel Patterson
62a9e16cb2 syntax: fixing pretty printing of brackets in match arms 2012-08-14 09:40:56 -04:00
Graydon Hoare
8271b3f0c8 More attempts at fixing .. breakage. 2012-08-14 05:17:38 +00:00
Patrick Walton
80b6850e34 libsyntax: Implement [int*3] syntax for fixed length vector types 2012-08-13 20:00:03 -07:00
Brian Anderson
5394e34aa4 core: Camel case some lesser-used modules 2012-08-13 18:59:48 -07:00
Brian Anderson
6b43c0c1ad Stop parsing old operator overloading syntax 2012-08-13 18:59:17 -07:00
Patrick Walton
799bc0a193 libsyntax: Allow "use" to be used in place of "import" 2012-08-13 17:55:54 -07:00
Patrick Walton
55ee06b8ce libsyntax: Accept "1..3" as the preferred form of "1 to 3" in patterns 2012-08-13 17:37:08 -07:00
Patrick Walton
9b5266d745 libsyntax: Refactor item parsing so that items and view items are parsed in the same function.
This is a step on the way to "extern mod foo;" and replacing "import" with "use".
2012-08-13 17:12:35 -07:00
Eric Holk
4ec1dd9914 Got the select macro working. 2012-08-13 16:20:23 -07:00
Patrick Walton
87f4c15311 rustc: Make functional record and struct update use ".." instead of "with".
"with" is still accepted for backwards compatibility.
2012-08-13 16:07:12 -07:00
Michael Sullivan
5fd891f10b Fix method mode parsing bug. Closes #3191. 2012-08-13 12:30:07 -05:00
Daniel Patterson
f9946f37aa syntax: better formatting of closures in pretty printer and more verbose debugging messages 2012-08-11 13:04:50 -07:00
Eric Holk
b354fe2a91 report local ambiguity errors earlier 2012-08-10 12:23:16 -07:00
Patrick Walton
5c9c9a6a9f libsyntax: Parse common enum fields 2012-08-08 19:51:48 -07:00
Brian Anderson
99a571585c syntax: Pretty print impls with new syntax 2012-08-08 18:19:26 -07:00
Brian Anderson
436a90e3d7 syntax: Stop supporting old impl syntax 2012-08-08 18:19:26 -07:00
Brian Anderson
6a0720b439 Convert impls to new syntax 2012-08-08 18:19:24 -07:00
Patrick Walton
4f98e80db1 rustc: Do some plumbing work in preparation for common fields in enums 2012-08-08 17:15:37 -07:00
Patrick Walton
f110e8f21c rustc: Do some plumbing work on nested enums 2012-08-08 14:19:21 -07:00
Niko Matsakis
52c517383e improve borrowck error messages to explain regions better 2012-08-07 20:59:06 -07:00
Patrick Walton
5ce3281a62 rustc: Parse variant structs; add a trivial test case 2012-08-07 18:55:19 -07:00
Patrick Walton
438765da59 rustc: Box struct_defs 2012-08-07 17:46:51 -07:00
Michael Sullivan
7f7f47620e Implement static typeclass methods. Closes #3132. 2012-08-07 17:18:14 -07:00
Patrick Walton
0f711e72f7 libsyntax: Break struct definitions out of classes internally in a few more places 2012-08-07 16:09:08 -07:00
Patrick Walton
a3f9e18b7a libsyntax: Allow users of the visitor to visit struct defs 2012-08-07 15:55:33 -07:00