<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libsyntax/parse, branch 1.6.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.6.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.6.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2015-12-04T08:46:29+00:00</updated>
<entry>
<title>Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelix</title>
<updated>2015-12-04T08:46:29+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2015-12-04T08:46:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=77ed39cfe37a17737e0b2256b1a1689e01c32b26'/>
<id>urn:sha1:77ed39cfe37a17737e0b2256b1a1689e01c32b26</id>
<content type='text'>
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701

- Added syntax support for attributes on expressions and all syntax nodes in statement position.
- Extended `#[cfg]` folder to allow removal of statements, and
of expressions in optional positions like expression lists and trailing
block expressions.
- Extended lint checker to recognize lint levels on expressions and
locals.
- As per RFC, attributes are not yet accepted on `if` expressions.

Examples:
  ```rust
let x = y;
{
        ...
}
assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3));

let FOO = 0;
```

Implementation wise, there are a few rough corners and open questions:
- The parser work ended up a bit ugly.
- The pretty printer change was based mostly on guessing.
- Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts,
  but where it seemed weird to accept attributes and hence the parser doesn't. This includes:
  - const expressions in patterns
  - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls)
  - on range expressions, since `#[attr] x .. y` parses as  `(#[attr] x) .. y`, which is inconsistent with
    `#[attr] .. y` which would parse as `#[attr] (.. y)`
- Attributes are added as additional `Option&lt;Box&lt;Vec&lt;Attribute&gt;&gt;&gt;` fields in expressions and locals.
- Memory impact has not been measured yet.
- A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work:
```rust
let x = {
    #[cfg(foo)]
    Foo { data: x }
    #[cfg(not(foo))]
    Foo { data: y }
};
```
- One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way.
- Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point?
- Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder.
- The work on pretty printer tests for this did trigger, but not fix errors regarding macros:
  - expression `foo![]` prints as `foo!()`
  - expression `foo!{}` prints as `foo!()`
  - statement `foo![];` prints as `foo!();`
  - statement `foo!{};` prints as `foo!();`
  - statement `foo!{}` triggers a `None` unwrap ICE.
</content>
</entry>
<entry>
<title>Use last_span for macro spans</title>
<updated>2015-11-29T05:54:54+00:00</updated>
<author>
<name>Kevin Yeh</name>
<email>kevinyeah@utexas.edu</email>
</author>
<published>2015-11-29T04:36:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=920120ed4ce2389b0db5cdabb3eb60535da5836d'/>
<id>urn:sha1:920120ed4ce2389b0db5cdabb3eb60535da5836d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Moved and refactored ThinAttributes</title>
<updated>2015-11-26T20:46:12+00:00</updated>
<author>
<name>Marvin Löbel</name>
<email>loebel.marvin@gmail.com</email>
</author>
<published>2015-11-15T16:17:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f0beba0217ad4ac748e93f7ea8d16c3b1fc4db1d'/>
<id>urn:sha1:f0beba0217ad4ac748e93f7ea8d16c3b1fc4db1d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add syntax support for attributes on expressions and all syntax</title>
<updated>2015-11-26T20:46:12+00:00</updated>
<author>
<name>Marvin Löbel</name>
<email>loebel.marvin@gmail.com</email>
</author>
<published>2015-11-03T16:39:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2a8f358de7ee71934b8129dff5d908730454d7b1'/>
<id>urn:sha1:2a8f358de7ee71934b8129dff5d908730454d7b1</id>
<content type='text'>
nodes in statement position.

Extended #[cfg] folder to allow removal of statements, and
of expressions in optional positions like expression lists and trailing
block expressions.

Extended lint checker to recognize lint levels on expressions and
locals.
</content>
</entry>
<entry>
<title>Fix spans for macros</title>
<updated>2015-11-26T20:38:45+00:00</updated>
<author>
<name>Kevin Yeh</name>
<email>kevinyeah@utexas.edu</email>
</author>
<published>2015-11-26T19:14:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b4295b9fb0789b9c354d17457dc60a7ca13119a6'/>
<id>urn:sha1:b4295b9fb0789b9c354d17457dc60a7ca13119a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add some unicode aliases for ".</title>
<updated>2015-11-18T06:16:32+00:00</updated>
<author>
<name>Huon Wilson</name>
<email>dbau.pp+github@gmail.com</email>
</author>
<published>2015-11-17T23:32:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=41f7f0c341aad4c3f197bf8b8f1e3c55da493daf'/>
<id>urn:sha1:41f7f0c341aad4c3f197bf8b8f1e3c55da493daf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #29766 - oli-obk:impl_item, r=nikomatsakis</title>
<updated>2015-11-17T18:24:19+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2015-11-17T18:24:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b31cc644d188126de6728b08b1cde707c1dc9400'/>
<id>urn:sha1:b31cc644d188126de6728b08b1cde707c1dc9400</id>
<content type='text'>
[breaking change]

I'm not sure if those renames are ok. [TokenType::Tt* to TokenType::*](https://github.com/rust-lang/rust/pull/29582) was obvious, but for all those Item-enums it's less obvious to me what the right way forward is due to the underscore.
</content>
</entry>
<entry>
<title>Detect confusing unicode characters and show the alternative</title>
<updated>2015-11-17T06:44:28+00:00</updated>
<author>
<name>Ravi Shankar</name>
<email>wafflespeanut@gmail.com</email>
</author>
<published>2015-11-14T21:07:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7f63c7cf4c2938c31de3d63fc769706f0d87cb54'/>
<id>urn:sha1:7f63c7cf4c2938c31de3d63fc769706f0d87cb54</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`</title>
<updated>2015-11-16T09:35:30+00:00</updated>
<author>
<name>Oliver Schneider</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2015-11-13T13:15:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d09220de13a72b283d824285a2883da9e014f3f7'/>
<id>urn:sha1:d09220de13a72b283d824285a2883da9e014f3f7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move the panicking parse functions out of the parser</title>
<updated>2015-11-14T03:18:59+00:00</updated>
<author>
<name>Kyle Mayes</name>
<email>kyle@mayeses.com</email>
</author>
<published>2015-11-14T03:18:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=44d8abcc0f372dbc7ad58f312303d2e59612dec9'/>
<id>urn:sha1:44d8abcc0f372dbc7ad58f312303d2e59612dec9</id>
<content type='text'>
Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
</content>
</entry>
</feed>
