summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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
2013-09-12std: Add Option.{result_or_default,or_default} that uses DefaultErick Tryzelaar-1/+1
2013-09-12libsyntax: add Default implementation to OptVecErick Tryzelaar-0/+4
2013-09-12std: rename Option::unwrap_or_default() to unwrap_or()Erick Tryzelaar-4/+4
2013-09-12auto merge of #9135 : jbclements/rust/let-var-hygiene, r=ericktbors-1/+2
Fixes issue #9110, changes field_ty element to Name, adds test case, improves fail error message
2013-09-12Implement a format_args!() macroAlex Crichton-61/+108
The purpose of this macro is to further reduce the number of allocations which occur when dealing with formatting strings. This macro will perform all of the static analysis necessary to validate that a format string is safe, and then it will wrap up the "format string" into an opaque struct which can then be passed around. Two safe functions are added (write/format) which take this opaque argument structure, unwrap it, and then call the unsafe version of write/format (in an unsafe block). Other than these two functions, it is not intended for anyone to ever look inside this opaque struct. The macro looks a bit odd, but mostly because of rvalue lifetimes this is the only way for it to be safe that I know of. Example use-cases of this are: * third-party libraries can use the default formatting syntax without any forced allocations * the fail!() macro can avoid allocating the format string * the logging macros can avoid allocation any strings
2013-09-11more helpful error message for ident comparison failureJohn Clements-1/+2
2013-09-11auto merge of #9061 : jakub-/rust/pretty-print-empty-impl, r=huonwbors-1/+3
2013-09-11Properly encode/decode structural variants.SiegeLord-3/+3
2013-09-11auto merge of #9093 : pnkfelix/rust/fsk-remove-oldvisit, r=alexcrichtonbors-780/+0
2013-09-11Flag unsafe blocks from format! as compiler-generatedAlex Crichton-3/+9
2013-09-11Implement the notion of a "generated unsafe block"Alex Crichton-3/+3
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.
2013-09-10change type of ExprLoop and ExprBreak elts from ident->name.John Clements-10/+21
Lots of downstream changes in librustc, should be infinitesimally faster.
2013-09-10auto merge of #9088 : nikomatsakis/rust/issue-6304-AST-tree-not-DAG, ↵bors-318/+360
r=catamorphism Ensures that each AST node has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-10Delay assignment of node ids until after expansion. Ensures that each AST nodeNiko Matsakis-318/+360
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-10auto merge of #9090 : jbclements/rust/let-var-hygiene, r=luqmanabors-13/+2
This appears to fix issue #9049. It also re-enables the ICE check on comparing idents for equality; it appears that ICEs are better than seg faults.
2013-09-10Remove oldvisit.rs (yay!); part of #7081 refactoring.Felix S. Klock II-780/+0
2013-09-09auto merge of #9062 : blake2-ppc/rust/vec-iterator, r=alexcrichtonbors-1/+1
Visit the free functions of std::vec and reimplement or remove some. Most prominently, remove `each_permutation` and replace with two iterators, ElementSwaps and Permutations. Replace unzip, unzip_slice with an updated `unzip` that works with an iterator argument. Replace each_permutation with a Permutation iterator. The new permutation iterator is more efficient since it uses an algorithm that produces permutations in an order where each is only one element swap apart, including swapping back to the original state with one swap at the end. Unify the seldomly used functions `build`, `build_sized`, `build_sized_opt` into just one function `build`. Remove `equal_sizes`
2013-09-09undo cowardly hiding of eq-checkJohn Clements-13/+2
I've reversed my thinking on this restrictive definition of eq after two separate bugs were hidden by commenting it out; it's better to get ICEs than SIGSEGV's, any day. RE-ENABLING ICE MACHINE!
2013-09-10std::at_vec and vec: Unify build_sized, build_sized_opt into buildblake2-ppc-1/+1
These functions have very few users since they are mostly replaced by iterator-based constructions. Convert a few remaining users in-tree, and reduce the number of functions by basically renaming build_sized_opt to build, and removing the other two. This for both the vec and the at_vec versions.
2013-09-09auto merge of #9034 : catamorphism/rust/rustpkg-workcache, r=metajackbors-78/+9
r? @metajack or @brson - This pull request makes rustpkg use the workcache library to avoid recompilation.
2013-09-09auto merge of #9005 : alexcrichton/rust/rusty-log, r=brsonbors-83/+49
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
2013-09-08rustpkg: Use workcacheTim Chevalier-78/+9
rustpkg now uses the workcache library to avoid recompilation. Hooray!
2013-09-08Fix pretty-printing of empty impl itemsJakub-1/+3
2013-09-08syntax: aesthetic improvements to the `for` desugaring.Huon Wilson-130/+38
2013-09-08syntax: implement labelled breaks for `for`.Huon Wilson-15/+25
`for` desugars to `loop` so it is trivial to just desugar to `loop` while retaining any label.
2013-09-08auto merge of #9035 : alexcrichton/rust/fewer-clownshoes, r=huonwbors-23/+23
This removes another large chunk of this odd 'clownshoes' identifier showing up in symbol names. These all originated from external crates because the encoded items were encoded independently of the paths calculated in ast_map. The encoding of these paths now uses the helper function in ast_map to calculate the "pretty name" for an impl block. Unfortunately there is still no information about generics in the symbol name, but it's certainly vastly better than before hash::__extensions__::write::_version::v0.8 becomes hash::Writer$SipState::write::hversion::v0.8 This also fixes bugs in which lots of methods would show up as `meth_XXX`, they now only show up as `meth` and throw some extra characters onto the version string.
2013-09-06Remove even more usage of clownshoes in symbolsAlex Crichton-23/+23
This removes another large chunk of this odd 'clownshoes' identifier showing up in symbol names. These all originated from external crates because the encoded items were encoded independently of the paths calculated in ast_map. The encoding of these paths now uses the helper function in ast_map to calculate the "pretty name" for an impl block. Unfortunately there is still no information about generics in the symbol name, but it's certainly vastly better than before hash::__extensions__::write::_version::v0.8 becomes hash::Writer$SipState::write::hversion::v0.8 This also fixes bugs in which lots of methods would show up as `meth_XXX`, they now only show up as `meth` and throw some extra characters onto the version string.
2013-09-06added index to test cases, more debugging outputJohn Clements-4/+11
2013-09-06quote_* macros no longer need to be capturingJohn Clements-91/+19
This is actually almost a problem, because those were my poster-child macros for "here's how to implement a capturing macro." Following this change, there will be no macros that use capturing; this will probably make life unpleasant for the first person that wants to implement a capturing macro. I should probably create a dummy_capturing macro, just to show how it works.
2013-09-06comment fixJohn Clements-1/+1
2013-09-06add test case, cleanupJohn Clements-17/+14
2013-09-06add display_sctable fn to ast_utilJohn Clements-0/+9
2013-09-06fixed a bug that caused double-expand-traversal of macros that expand into ↵John Clements-19/+10
modules.
2013-09-06WIP: adding mark-cancelling for macro_rulesJohn Clements-7/+57
2013-09-06added string_to_ttsJohn Clements-0/+6
2013-09-06commentsJohn Clements-0/+9
2013-09-06comment on hygienic context extension train fnsJohn Clements-0/+11
2013-09-06awesome new bug! added test caseJohn Clements-13/+68
2013-09-06expose mtwt_marksof for testingJohn Clements-0/+5
2013-09-06ident->nameJohn Clements-2/+2
2013-09-06remove unneeded imports, clean up unused var warningsJohn Clements-16/+15
2013-09-06whitespace, reindentation, and comments onlyJohn Clements-24/+37
2013-09-06memoization for resolveJohn Clements-40/+93
2013-09-06uncomment mtwt_resolve callsJohn Clements-19/+43
2013-09-06added utility functionJohn Clements-0/+37
2013-09-06fix one remaining token comparison, refactor token comparison to avoid == checkJohn Clements-11/+10