about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-10-08add token::LIT_STR_RAW(ident, num of # symbols)Benjamin Herr-1/+9
Treat it as a synonym for LIT_STR for now.
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-2/+4
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-6/+6
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02syntax: swap from .span_fatal to .span_err in #[deriving(FromPrimitive)]Erick Tryzelaar-9/+21
2013-10-02syntax: Add #[deriving(FromPrimitive)] syntax extensionErick Tryzelaar-0/+152
Right now this only works for c-style enums.
2013-10-02auto merge of #9673 : huonw/rust/macros, r=catamorphismbors-78/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-3/+3
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-02syntax: indicate an error when a macro ignores trailing tokens.Huon Wilson-5/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02syntax: remove some dead code.Huon Wilson-73/+0
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-3/+3
Closes #9467
2013-10-01auto merge of #9519 : thestinger/rust/float, r=catamorphismbors-1/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01remove the `float` typeDaniel Micay-1/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01auto merge of #9633 : alexcrichton/rust/issue-9631, r=huonwbors-12/+16
Closes #9631
2013-10-01Fix usage of the old debug! macrosAlex Crichton-1/+1
2013-10-01Change the format! statics to be all-capsAlex Crichton-12/+16
This lets them get past the non_uppercase_statics lint mode (if it's turned on) Closes #9631
2013-10-01Fix typo with format migration: s/oldformat/oldfmt/.Huon Wilson-4/+4
2013-09-30syntax: Remove usage of fmt!Alex Crichton-141/+143
2013-09-30Prevent leakage of fmt! into the compilerAlex Crichton-49/+62
We're not outright removing fmt! just yet, but this prevents it from leaking into the compiler further (it's still turned on by default for all other code).
2013-09-29Remove all usage of @ast::CrateAlex Crichton-12/+12
2013-09-27auto merge of #9535 : alexcrichton/rust/no-format-default, r=thestingerbors-11/+8
As mentioned in #9456, the format! syntax extension would previously consider an empty format as a 'Unknown' format which could then also get coerced into a different style of format on another argument. This is unusual behavior because `{}` is a very common format and if you have `{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly` formatter. This commit removes this coercion, but still retains the requirement that each argument has exactly one format specified for it (an empty format now counts as well). Perhaps at a later date we can add support for multiple formats of one argument, but this puts us in at least a backwards-compatible situation if we decide to do that.
2013-09-27Remove the notion of an "unknown format"Alex Crichton-11/+8
As mentioned in #9456, the format! syntax extension would previously consider an empty format as a 'Unknown' format which could then also get coerced into a different style of format on another argument. This is unusual behavior because `{}` is a very common format and if you have `{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly` formatter. This commit removes this coercion, but still retains the requirement that each argument has exactly one format specified for it (an empty format now counts as well). Perhaps at a later date we can add support for multiple formats of one argument, but this puts us in at least a backwards-compatible situation if we decide to do that.
2013-09-27auto merge of #9550 : alexcrichton/rust/remove-printf, r=thestingerbors-22/+2
The 0.8 release was cut, down with printf!
2013-09-26auto merge of #9504 : brson/rust/continue, r=alexcrichtonbors-6/+6
2013-09-26auto merge of #9261 : alexcrichton/rust/logging, r=huonwbors-3/+9
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-2/+2
2013-09-26Remove the printf{,ln}! macrosAlex Crichton-20/+0
These are deprecated in favor of print{,ln}!
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-6/+6
2013-09-25Refactor the logging system for fewer allocationsAlex Crichton-3/+9
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-24/+24
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-3/+5
Small stuff... might as well get it into the tree. One new test case, some issue # cleanup, remove some unused imports.
2013-09-24comment changes onlyJohn Clements-3/+5
2013-09-24Correctly encode item visibility in metadataAlex Crichton-1/+1
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-23librustc: Fix merge fallout.Patrick Walton-1/+1
2013-09-23test: Fix rustdoc and tests.Patrick Walton-3/+4
2013-09-23libsyntax: Introduce routines and remove all `@fn`s from libsyntax save the ↵Patrick Walton-1/+1
old visitor
2013-09-23libsyntax: Remove some more `@fn`s from the macro expanderPatrick Walton-109/+300
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-151/+344
2013-09-20Implement a web backend for rustdoc_ngAlex Crichton-1/+1
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 #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-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-34/+2
2013-09-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-36/+0
2013-09-17extra: minor cleanup of Zero and Default syntax extensionErick Tryzelaar-10/+6
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-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-121/+61
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-14auto merge of #9183 : alexcrichton/rust/issue-5794, r=catamorphismbors-1/+19
Closes #5794