summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-09-23libsyntax: Remove some more `@fn` usesPatrick Walton-7/+0
2013-09-23librustc: Change the ID visitor to use traits instead of garbage-collected ↵Patrick Walton-31/+46
functions.
2013-09-23librustc: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-32/+44
2013-09-23librustc: Port the pretty printer annotation infrastructure to use traits ↵Patrick Walton-18/+29
instead of garbage collected functions.
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-972/+979
2013-09-22auto merge of #9389 : poiru/rust/issue-9333, r=alexcrichtonbors-4/+14
Closes #9333.
2013-09-22Reserve the `alignof`, `offsetof`, and `sizeof` keywordsBirunthan Mohanathas-4/+14
Closes #9333.
2013-09-21Update version numbers to 0.8Brian Anderson-1/+1
2013-09-20Implement a web backend for rustdoc_ngAlex Crichton-4/+2
This large commit implements and `html` output option for rustdoc_ng. The executable has been altered to be invoked as "rustdoc_ng html <crate>" and it will dump everything into the local "doc" directory. JSON can still be generated by changing 'html' to 'json'. This also fixes a number of bugs in rustdoc_ng relating to comment stripping, along with some other various issues that I found along the way. The `make doc` command has been altered to generate the new documentation into the `doc/ng/$(CRATE)` directories.
2013-09-20Invert --cfg debug to --cfg ndebugAlex Crichton-2/+2
Many people will be very confused that their debug! statements aren't working when they first use rust only to learn that they should have been building with `--cfg debug` the entire time. This inverts the meaning of the flag to instead of enabling debug statements, now it disables debug statements. This way the default behavior is a bit more reasonable, and requires less end-user configuration. Furthermore, this turns on debug by default when building the rustc compiler.
2013-09-19auto merge of #9308 : ben0x539/rust/lexer-error-spans, r=alexcrichtonbors-26/+91
Previously, the lexer calling `rdr.fatal(...)` would report the span of the last complete token, instead of a span within the erroneous token (besides one span fixed in 1ac90bb). This branch adds wrappers around `rdr.fatal(...)` that sets the span explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now report the offending code more precisely. A number of tests try to verify that, though the `compile-fail` testing setup can only check that the spans are on the right lines, and the "unterminated string/block comment" errors can't have the line marked at all, so that's incomplete. This closes #9149. Also, the lexer errors now report the offending code in the error message, not just via the span, just like other errors do.
2013-09-19lexer: further slight improvements to lexer errorsBenjamin Herr-16/+30
2013-09-19auto merge of #9279 : erickt/rust/master, r=alexcrichtonbors-10/+6
`Some(5).or_{default,zero}` can be easily replaced with `Some(Some(5).unwrap_or_default())`.
2013-09-19lexer: report problematic chars verbatim or as escape sequenceBenjamin Herr-12/+23
... instead of giving their numeric codepoint, following the lead of fdaae34. So the error message for, say, '\_' mentions _ instead of 95, and '\●' now mentions \u25cf.
2013-09-19lexer: show correct span on lexical errorsBenjamin Herr-19/+59
Previously, the lexer calling `rdr.fatal(...)` would report the span of the last complete token, instead of a span within the erroneous token (besides one span fixed in 1ac90bb). This commit adds a wrapper around `rdr.fatal(...)` that sets the span explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now report the offending code more precisely. A number of tests try to verify that, though the `compile-fail` testing setup can only check that the spans are on the right lines, and the "unterminated string/block comment" errors can't have the line marked at all, so that's incomplete. Closes #9149.
2013-09-19auto merge of #9299 : alexcrichton/rust/fmt-trailing-comma, r=huonwbors-0/+1
This is more consistent with other parts of the language and it also makes it easier to use in situations where format string is massive.
2013-09-19auto merge of #9291 : jzelinskie/rust/remove-cond, r=alexcrichtonbors-36/+0
This is my first contribution, so please point out anything that I may have missed. I consulted IRC and settled on `match () { ... }` for most of the replacements.
2013-09-18Allow trailing commas in format!Alex Crichton-0/+1
This is more consistent with other parts of the language and it also makes it easier to use in situations where format string is massive.
2013-09-18Register new snapshotsAlex Crichton-39/+6
2013-09-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-36/+0
2013-09-18auto merge of #9264 : ben0x539/rust/pp-work, r=alexcrichtonbors-8/+8
Since 3b6314c the pretty printer seems to only print trait bounds for `ast::ty_path(...)`s that have a generics arguments list. That seems wrong, so let's always print them. Closes #9253, un-xfails test for #7673.
2013-09-17extra: minor cleanup of Zero and Default syntax extensionErick Tryzelaar-10/+6
2013-09-17Added support for a `\0` escape sequence.Daniel Rosenwasser-0/+2
This commit adds support for `\0` escapes in character and string literals. Since `\0` is equivalent to `\x00`, this is a direct translation to the latter escape sequence. Future builds will be able to compile using `\0` directly. Also updated the grammar specification and added a test for NUL characters.
2013-09-17pp: also print bounds in paths with no generic paramsBenjamin Herr-7/+7
Since 3b6314c3 the pretty printer seems to only print trait bounds for `ast::ty_path(...)`s that have a generics arguments list. That seems wrong, so let's always print them. Closes #9253, un-xfails test for #7673.
2013-09-17pp: typo in commentBenjamin Herr-1/+1
2013-09-17auto merge of #9245 : kballard/rust/bytes-span, r=catamorphismbors-10/+10
This constrains the span to the appropriate argument, so you know which one caused the problem. Instead of foo.rs:2:4: 2:21 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~~~~~~~~~~~~~~~ it will say foo.rs:2:14 2:17 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~
2013-09-17auto merge of #9244 : thestinger/rust/drop, r=catamorphismbors-1/+1
This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.
2013-09-16switch Drop to `&mut self`Daniel Micay-1/+1
2013-09-16Limit spans in bytes!() error messages to the argument in questionKevin Ballard-10/+10
This constrains the span to the appropriate argument, so you know which one caused the problem. Instead of foo.rs:2:4: 2:21 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~~~~~~~~~~~~~~~ it will say foo.rs:2:14 2:17 error: Too large integer literal in bytes! foo.rs:2 bytes!(1, 256, 2) ^~~
2013-09-16Update syntax testCorey Richardson-1/+123
2013-09-16Fix hardcoded string in libsyntaxCorey Richardson-24/+2
2013-09-16auto merge of #9187 : lkuper/rust/no-simplevisitor, r=catamorphismbors-144/+3
We don't seem to be using `SimpleVisitor` anywhere in rustc. Is there any reason to keep it around? r? anyone
2013-09-15auto merge of #9168 : michaelwoerister/rust/traits, r=jdmbors-0/+10
This pull request finally adds support for recursive type definitions and provides a stub implementation for object pointers.
2013-09-15Remove {uint,int,u64,i64,...}::from_str,from_str_radixblake2-ppc-3/+3
Remove these in favor of the two traits themselves and the wrapper function std::from_str::from_str. Add the function std::num::from_str_radix in the corresponding role for the FromStrRadix trait.
2013-09-15debuginfo: Basic support for trait objects.Michael Woerister-0/+10
2013-09-15Fix expand_stmt as well as expand_expr to use the correct spanAlex Crichton-15/+25
The same fix as before is still relevant, I just forgot to update the expand_stmt macro expansion site. The tests for format!() suffice as tests for this change.
2013-09-15Reduce the amount of complexity in format!Alex Crichton-122/+62
This renames the syntax-extension file to format from ifmt, and it also reduces the amount of complexity inside by defining all other macros in terms of format_args!
2013-09-14These impls, at least, can be avoided by deriving Ord.Lindsey Kuper-16/+2
2013-09-14Kill off method impls made redundant by default methods.Lindsey Kuper-39/+0
2013-09-14auto merge of #9183 : alexcrichton/rust/issue-5794, r=catamorphismbors-1/+19
Closes #5794
2013-09-14auto merge of #9181 : lkuper/rust/libsyntax-default-methods-refactor, ↵bors-275/+3
r=alexcrichton I'm getting the three `make check` failures mentioned in issue #9127, which I also get building master.
2013-09-14auto merge of #9180 : blake2-ppc/rust/reduce-either, r=catamorphismbors-21/+15
Work a bit towards #9157 "Remove Either". These instances don't need to use Either and are better expressed in other ways (removing allocations and simplifying types).
2013-09-14auto merge of #9115 : erickt/rust/master, r=ericktbors-11/+103
This is a series of patches to modernize option and result. The highlights are: * rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)` * add `.unwrap_or_default()` that uses the `Default` trait * add `Default` implementations for vecs, HashMap, Option * add `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>` * add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither` * renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`. * Added a bunch of impls of `Default` * Added a `#[deriving(Default)]` syntax extension * Removed impls of `Zero` for `Option<T>` and vecs.
2013-09-14Get rid of unused SimpleVisitor stuff.Lindsey Kuper-144/+3
2013-09-13Pass a more proper span to the syntax expandersAlex Crichton-1/+19
Closes #5794
2013-09-14syntax: Remove use of Either in parse.rsblake2-ppc-21/+15
The arg or capture type alias was actually never used for the capture case, so the code is simplified with `Either<arg, ()>` replaced by `arg`
2013-09-13Refactor libsyntax Visitor impls to use default methods.Lindsey Kuper-275/+3
2013-09-13Work around a compiler crash folding labeled break. #9129Brian Anderson-2/+10
Servo is hitting this problem, so this is a workaround for a lack of a real solution.
2013-09-12syntax: add #[deriving(Default)] syntax extensionErick Tryzelaar-0/+81
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-7/+14