summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-1/+56
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-29removed extra linereedlepee-1/+0
2013-10-29Indentationreedlepee-1/+1
2013-10-29updated the places where the struct is created #7427reedlepee-2/+3
2013-10-29Changed name to non_copyable #7427reedlepee-1/+1
2013-10-29Added the comment #7427reedlepee-1/+1
2013-10-29Replaced empty destructors with NonCopyable #7427reedlepee-5/+2
closes #7427
2013-10-28Field identifiers now include specific spans (Closes #8263).Joshua Yanovski-1/+2
2013-10-25libsyntax: Get rid of some logic for some obsolete syntax.Luqman Aden-14/+5
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-21/+10
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-1/+9
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-14/+16
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-13/+13
Who doesn't like a massive renaming?
2013-10-16path2: Update based on more review feedbackKevin Ballard-1/+1
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Remove .with_display_str and friendsKevin Ballard-2/+2
Rewrite these methods as methods on Display and FilenameDisplay. This turns do path.with_display_str |s| { ... } into do path.display().with_str |s| { ... }
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-5/+5
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-21/+16
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
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-2/+2
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 #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 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-2/+5
Treat it as a synonym for LIT_STR for now.
2013-10-04Remove specific errors for very old obsolete syntaxBenjamin Herr-283/+56
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-01Migrate users of 'loop' to 'continue'Alex Crichton-1/+1
Closes #9467
2013-10-01Obsolete parsing 'loop' as 'continue'Alex Crichton-0/+1
2013-09-30syntax: Remove usage of fmt!Alex Crichton-59/+58
2013-09-29Remove all usage of @ast::CrateAlex Crichton-2/+2
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-0/+12
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-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-0/+5
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-31/+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-24Stop accepting 'impl ...;', require {} insteadAlex Crichton-1/+3
Progress on #7981
2013-09-24cleanupJohn Clements-0/+5
2013-09-24Correctly encode item visibility in metadataAlex Crichton-31/+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-16switch Drop to `&mut self`Daniel Micay-1/+1
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-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-12std: Add Option.{result_or_default,or_default} that uses DefaultErick Tryzelaar-1/+1
2013-09-12std: rename Option::unwrap_or_default() to unwrap_or()Erick Tryzelaar-4/+4
2013-09-11Flag unsafe blocks from format! as compiler-generatedAlex Crichton-1/+1
2013-09-11Implement the notion of a "generated unsafe block"Alex Crichton-1/+1
This way syntax extensions can generate unsafe blocks without worrying about them generating unnecessary unsafe warnings. Perhaps a special keyword could be added to be used in macros, but I don't think that's the best solution.