rust/crates
bors[bot] 5b6ad0971c Merge #996
996: Allow attributes on top level expressions r=matklad a=pcpthm

This PR modifies parser to allow outer attributes on top level expression. Here, top level expression means either
- Expression statement e.g. `foo();`
- Last expression in a block without semicolon `bar()` in `{ foo(); bar() }`.

Except for binary operation expressions and `if` expressions, which are errors (feature gated) in rustc.
Attributes on inner expressions like `foo(#[a] 1)` are not implemented.

I first tried to implement this by passing `Maker` to expression parsers. However, this implementation couldn't parse `#[attr] foo()` correctly as `CallExpr(Attr(..), PathExpr(..), ArgList(..))` and instead parsed incorrectly as `CallExpr(PathExpr(Attr(..), ..), ArgList(..))` due to the way left recursion is handled.
In the end, I introduce `undo_completion` method. Which is not the suggested approach, but it seems not very bad.

Fix #759.


Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-19 10:36:17 +00:00
..
gen_lsp_server show message in client's UI if workspace fails to load 2019-03-05 16:33:05 +03:00
ra_arena
ra_assists Merge #989 2019-03-18 08:24:18 +00:00
ra_batch Upgrade ra_vfs to use new Filtering 2019-03-18 20:53:08 +02:00
ra_cli Updates 2019-03-05 10:26:36 -05:00
ra_db add skeleton for macro-aware name resolutions 2019-03-17 12:46:13 +03:00
ra_fmt
ra_hir Merge #982 2019-03-17 21:41:37 +00:00
ra_ide_api remove old macro support 2019-03-17 12:53:22 +03:00
ra_ide_api_light Updates 2019-03-05 10:26:36 -05:00
ra_lsp_server Upgrade ra_vfs to use new Filtering 2019-03-18 20:53:08 +02:00
ra_mbe hack around non-terminating macro expansion 2019-03-17 12:52:52 +03:00
ra_parser Replace contract_child to a less ad-hoc API 2019-03-19 18:44:23 +09:00
ra_project_model Specify derive feature for serde 2019-03-08 01:58:29 +09:00
ra_syntax Error about attributes on 2019-03-19 17:37:08 +09:00
ra_text_edit
ra_tt
test_utils fix error on wrong path 2019-03-17 12:53:22 +03:00
thread_worker
tools set code less generic 2019-03-18 22:18:54 +03:00