Commit Graph

2128 Commits

Author SHA1 Message Date
Marcus Klaas 3a360fca78 Fix overly long spans for break and continue
The spans of break and continue would include the next token.
2015-09-02 20:55:17 +02:00
Marcus Klaas b69347c00c Assign correct span to continue expression
Fixes https://github.com/rust-lang/rust/issues/28105.
2015-08-30 20:44:36 +02:00
Georg Brandl 29945d5db0 syntax: fix use of "vector" for [x; n] literal and [x, y] patterns 2015-08-11 17:41:06 +02:00
bors 8856927f64 Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219).

The RFC is not merged yet, but once merged, this could be.
2015-08-10 20:24:06 +00:00
Sean McArthur cfcd449c4c rustc: rename multiple imports in a list 2015-08-08 11:54:15 -07:00
Jared Roesch edca562c87 Make parser recognize macro invocations in types
Reapplied the changes from https://github.com/freebroccolo/rust/commit/8b07abaa6e8ab42d37656dfad89de0eb5810c3b3
to a clean branch of master
2015-08-04 16:05:06 -07:00
bors f50518e05a Auto merge of #27447 - eefriedman:parser-cleanup, r=alexcrichton 2015-08-01 04:49:02 +00:00
Seo Sanghyeon b5139c5c58 Fix impl A .. {} 2015-07-31 21:24:55 +09:00
Eli Friedman f9692d5d00 Remove unused code in parser. 2015-07-30 20:51:51 -07:00
Simonas Kazlauskas cca0ea718d Replace illegal with invalid in most diagnostics 2015-07-29 01:59:31 +03:00
bors 55ede7ed8e Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb
this has quite some fallout. but also made lots of stuff more readable imo

[breaking-change] for plugin authors
2015-07-28 21:14:28 +00:00
Oliver Schneider 00a5e66f81 remove get_ident and get_name, make as_str sound 2015-07-28 18:07:20 +02:00
Eduard Burtescu cc09b1a08c Turn on box(PLACE) expr deprecation warning post-snapshot. 2015-07-27 18:11:43 +03:00
mitaa adfdbc4bd7 Remove ast::LocalSource with only one used variant
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-26 08:56:29 +02:00
bors 9413a926fc Auto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakis
Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol.

Includes Placer API that one can override to integrate support for `in` into one's own type.  (See [RFC 809].)

[RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md

Part of #22181

Replaced PR #26180.

Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`.

(Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax.  In particular I still want to play around with some other alternatives.  Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.)

----

Also, this PR leaves out support for desugaring-based `box EXPR`.  We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.
2015-07-24 10:12:20 +00:00
bors 2e5b165e18 Auto merge of #27203 - marcusklaas:fix-range-span, r=alexcrichton
Right trims the span for certain range expressions.

Closes https://github.com/rust-lang/rust/issues/27162.
2015-07-23 12:52:21 +00:00
Felix S. Klock II abad7d6bba placate make tidy. 2015-07-22 23:23:36 +02:00
Felix S. Klock II 9f6f35bef4 Added support for parsing in PLACE { BLOCK_CONTENT }. 2015-07-22 15:34:01 +02:00
Marcus Klaas b36d107b83 Assign proper span to range expression 2015-07-21 23:04:23 +02:00
Nick Cameron f47d20aecd Use a span from the correct file for the inner span of a module
This basically only affects modules which are empty (or only contain comments).

Closes #26755
2015-07-21 21:55:19 +12:00
Marcus Klaas 12963606d0 Include label in the span of loops 2015-07-18 11:53:55 +02:00
bors 07be6299d8 Auto merge of #26947 - nagisa:unicode-escape-error, r=nrc
Inspired by the now-mysteriously-closed https://github.com/rust-lang/rust/pull/26782.

This PR introduces better error messages when unicode escapes have invalid format (e.g. `\uFFFF`). It also makes rustc always tell the user that escape may not be used in byte-strings and bytes and fixes some spans to not include unecessary characters and include escape backslash in some others.
2015-07-13 04:00:49 +00:00
bors 7ea2674c75 Auto merge of #26750 - nrc:refactor-submod, r=sfackler
This makes the functionality usable from outside the parser
2015-07-13 01:07:51 +00:00
Simonas Kazlauskas 4d65ef4549 Tell unicode escapes can’t be used as bytes earlier/more 2015-07-13 02:09:22 +03:00
Wesley Wiser 93ddee6cee Change some instances of .connect() to .join() 2015-07-10 19:40:46 -04:00
Simonas Kazlauskas d22f189da1 Improve some of the string escape diagnostic spans 2015-07-10 22:28:51 +03:00
Simonas Kazlauskas 0bd5dd6449 Improve incomplete unicode escape reporting
This improves diagnostic messages when \u escape is used incorrectly and { is
missing. Instead of saying “unknown character escape: u”, it will now report
that unicode escape sequence is incomplete and suggest what the correct syntax
is.
2015-07-10 22:26:19 +03:00
Nick Cameron f28f79b796 Fix a span bug for qualified paths 2015-07-09 12:24:39 +12:00
Nick Cameron f3ba950a34 Refactor how the parser looks for sub-modules
This makes the functionality usable from outside the parser
2015-07-03 17:29:24 +12:00
Ariel Ben-Yehuda a18d9842ed Make the unused_mut lint smarter with respect to locals.
Fixes #26332
2015-07-01 00:12:12 +03:00
Yongqian Li f21682ba2d fix minor indentation issues 2015-06-22 15:30:56 -07:00
bors b5b3a99f84 Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton
Pull request for #26188.
2015-06-11 18:10:08 +00:00
Joshua Landau ca7418b846 Removed many pointless calls to *iter() and iter_mut() 2015-06-10 21:14:03 +01:00
Steve Klabnik 2c75256c15 Exise 'unsafe pointer' in favor of 'raw pointer'
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09 16:49:24 -04:00
bors 61c43b4733 Auto merge of #26091 - chellmuth:pub-struct-field-span, r=nrc
Issue: #26083 

Re-submitting https://github.com/rust-lang/rust/pull/26084

r? @nrc
2015-06-08 14:35:27 +00:00
Chris Hellmuth a72283832d StructField span should include pub 2015-06-07 16:34:03 -06:00
Marcus Klaas 0000d4c62a Fix span for ExprPath variants 2015-06-04 02:40:12 +02:00
Nick Hamann d8d4a6a842 Fix typo. 2015-05-26 15:12:52 -05:00
Niko Matsakis 82ded3cd03 Two more small fixes. 2015-05-22 08:45:05 -04:00
Niko Matsakis df93deab10 Make various fixes:
- add feature gate
- add basic tests
- adjust parser to eliminate conflict between `const fn` and associated
constants
- allow `const fn` in traits/trait-impls, but forbid later in type check
- correct some merge conflicts
2015-05-21 11:47:30 -04:00
Eduard Burtescu af3795721c syntax: parse const fn for free functions and inherent methods. 2015-05-21 11:47:30 -04:00
bors c23a9d42ea Auto merge of #25387 - eddyb:syn-file-loader, r=nikomatsakis
This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:
* `ParseSess::{next_node_id, reserve_node_ids}` moved to rustc's `Session`
* `new_parse_sess` -> `ParseSess::new`
* `new_parse_sess_special_handler` -> `ParseSess::with_span_handler`
* `mk_span_handler` -> `SpanHandler::new`
* `default_handler` -> `Handler::new`
* `mk_handler` -> `Handler::with_emitter`
* `string_to_filemap(sess source, path)` -> `sess.codemap().new_filemap(path, source)`
2015-05-17 00:05:34 +00:00
bors 8fdb3a4ad9 Auto merge of #25487 - P1start:extern-crate-unexpected-error, r=huonw
Closes #25468.
2015-05-16 10:53:25 +00:00
P1start dadac15477 Clarify the error message for malformed extern crate statements
Closes #25468.
2015-05-16 22:35:59 +12:00
P1start 5a1b336a01 Fix the spans of move closures
Closes #24986.
2015-05-16 11:24:06 +12:00
bors b948d81c44 Auto merge of #25219 - Eljay:fix-comment-parsing, r=alexcrichton
Fixes #25182, parser didn't account for \r\n in regular comments, only doc-comments.
2015-05-15 16:53:53 +00:00
Erick Tryzelaar 7b00658413 syntax: Add unquoting ast::{Generics,WhereClause} 2015-05-15 08:01:55 -07:00
Lee Jeffery 2dcc200be0 Fix stupid mistake from previous commit 2015-05-14 18:28:28 +01:00
Lee Jeffery 93af5f9b44 Make BytePos calculation same as original 2015-05-14 18:19:51 +01:00
Eduard Burtescu 07d4f77790 syntax: abstract over the file loading mechanism. 2015-05-14 01:47:56 +03:00