about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2013-10-10Remove named extern blocks from the ASTAlex Crichton-7/+5
There's currently a fair amount of code which is being ignored on unnamed blocks (which are the default now), and I opted to leave it commented out for now. I intend on very soon revisiting on how we perform linking with extern crates in an effort to support static linking.
2013-10-09option: rewrite the API to use compositionDaniel Micay-3/+3
2013-10-08auto merge of #9753 : alexcrichton/rust/macro-attrs, r=brsonbors-3/+0
It's unclear to me why these currently aren't allowed, and my best guess is that a long time ago we didn't strip the ast of cfg nodes before syntax expansion. Now that this is done, I'm not certain that we should continue to prohibit this functionality. This is a step in the right direction towards #5605, because now we can add an empty `std::macros` module to the documentation with a bunch of empty macros explaining how they're supposed to be used.
2013-10-08Allow attributes on macrosAlex Crichton-3/+0
It's unclear to me why these currently aren't allowed, and my best guess is that a long time ago we didn't strip the ast of cfg nodes before syntax expansion. Now that this is done, I'm not certain that we should continue to prohibit this functionality. This is a step in the right direction towards #5605, because now we can add an empty `std::macros` module to the documentation with a bunch of empty macros explaining how they're supposed to be used.
2013-10-08auto merge of #9771 : alexcrichton/rust/snapshots, r=thestingerbors-19/+0
Still building locally, we'll see if anything dies...
2013-10-08Register new snapshotsAlex Crichton-19/+0
2013-10-08auto merge of #9756 : catamorphism/rust/issue-2354, r=alexcrichtonbors-1/+11
r? anybody It's more helpful to list the span of each open delimiter seen so far than to print out an error with the span of the last position in the file. Closes #2354
2013-10-08Add bindings for start and ends of keyword ranges; use bindings in match arms.Felix S. Klock II-11/+40
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-22/+22
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-07syntax: Remove unnecessary @Tim Chevalier-3/+3
2013-10-07syntax: Display spans for open delimiters when a file ends prematurelyTim Chevalier-1/+11
It's more helpful to list the span of each open delimiter seen so far than to print out an error with the span of the last position in the file. Closes #2354
2013-10-08add token::LIT_STR_RAW(ident, num of # symbols)Benjamin Herr-4/+14
Treat it as a synonym for LIT_STR for now.
2013-10-08lex raw string literals, like r#"blah"#Benjamin Herr-2/+66
Raw string literals are lexed into regular string literals. This is okay for them to "work" and be usable/testable, but the pretty-printer does not know about them yet and will just emit regular string literals.
2013-10-04Remove specific errors for very old obsolete syntaxBenjamin Herr-449/+58
Replaces existing tests for removed obsolete-syntax errors with tests for the resulting regular errors, adds a test for each of the removed parser errors to make sure that obsolete forms don't start working again, removes some obsolete/superfluous tests that were now failing. Deletes some amount of dead code in the parser, also includes some small changes to parser error messages to accomodate new tests.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-2/+9
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-2/+2
Closes #9467
2013-10-01Obsolete parsing 'loop' as 'continue'Alex Crichton-0/+7
2013-10-01remove the `float` typeDaniel Micay-6/+1
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-09-30syntax: Remove usage of fmt!Alex Crichton-94/+92
2013-09-29Remove all usage of @ast::CrateAlex Crichton-4/+4
2013-09-27auto merge of #9540 : alexcrichton/rust/more-rustdoc-improvements, r=brsonbors-3/+3
Commit messages have the details, mostly just knocking out more low-hanging-fruit type issues.
2013-09-26auto merge of #9525 : klutzy/rust/obsolete-span-fix, r=alexcrichtonbors-6/+9
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-18/+33
2013-09-26rustdoc: Generate documentation for foreign itemsAlex Crichton-3/+3
This slurps up everything inside of an 'extern' block into the enclosing module in order to document them. The documentation must be on the items themselves, and they'll show up next to everything else on the module index pages. Closes #5953
2013-09-26syntax: Fix wrong span on trait fn visibilityklutzy-1/+2
Fixes #9348.
2013-09-26syntax: Fix wrong span on ObsoleteModeklutzy-4/+6
2013-09-26syntax: Fix wrong span on ObsoleteEmptyImplklutzy-1/+1
2013-09-25rustdoc: Improve comment strippingAlex Crichton-15/+40
There is less implicit removal of various comment styles, and it also removes extraneous stars occasionally found in docblock comments. It turns out that the bug for getops was just a differently formatted block. Closes #9425 Closes #9417
2013-09-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-10/+52
Small stuff... might as well get it into the tree. One new test case, some issue # cleanup, remove some unused imports.
2013-09-25auto merge of #9432 : alexcrichton/rust/correct-item-visibility, r=pcwaltonbors-48/+8
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-24auto merge of #9335 : alexcrichton/rust/issue-7945, r=thestingerbors-21/+28
As documented in issue #7945, these literal identifiers are all accepted by rust today, but they should probably be disallowed (especially `'''`). This changes all escapable sequences to being *required* to be escaped. Closes #7945 I wanted to write the tests with more exact spans, but I think #9308 will be fixing that?
2013-09-24Disallow char literals which should be escapedAlex Crichton-21/+28
As documented in issue #7945, these literal identifiers are all accepted by rust today, but they should probably be disallowed (especially `'''`). This changes all escapable sequences to being *required* to be escaped. Closes #7945
2013-09-24added test case for tokenization of macro_rulesJohn Clements-0/+45
2013-09-24auto merge of #9336 : alexcrichton/rust/issue-7981, r=catamorphismbors-1/+8
Progress on #7981 This doesn't completely close the issue because `struct A;` is still allowed, and it's a much larger change to disallow that. I'm also not entirely sure that we want to disallow that. Regardless, punting that discussion to the issue instead.
2013-09-24Stop accepting 'impl ...;', require {} insteadAlex Crichton-1/+8
Progress on #7981
2013-09-24cleanupJohn Clements-10/+7
2013-09-24Correctly encode item visibility in metadataAlex Crichton-48/+8
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: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-1/+1
2013-09-22Reserve the `alignof`, `offsetof`, and `sizeof` keywordsBirunthan Mohanathas-4/+14
Closes #9333.
2013-09-20Implement a web backend for rustdoc_ngAlex Crichton-3/+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-19lexer: further slight improvements to lexer errorsBenjamin Herr-16/+30
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-18Register new snapshotsAlex Crichton-2/+1
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-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-16Update syntax testCorey Richardson-1/+123
2013-09-16Fix hardcoded string in libsyntaxCorey Richardson-24/+2
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.