]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agotranslate \n -> \r\n on the way out
Aleksey Kladov [Tue, 20 Aug 2019 15:53:59 +0000 (18:53 +0300)]
translate \n -> \r\n on the way out

4 years agomake CTX type param instead of assoc type
Aleksey Kladov [Tue, 20 Aug 2019 15:33:23 +0000 (18:33 +0300)]
make CTX type param instead of assoc type

that way, we can implement ConvWith<&'_ CTX> for different lifetimes

4 years agoadd tests for crlf
Aleksey Kladov [Tue, 20 Aug 2019 15:26:07 +0000 (18:26 +0300)]
add tests for crlf

4 years agominor
Aleksey Kladov [Tue, 20 Aug 2019 15:25:27 +0000 (18:25 +0300)]
minor

4 years agoMerge #1707
bors[bot] [Tue, 20 Aug 2019 16:27:57 +0000 (16:27 +0000)]
Merge #1707

1707: make sure lockfile is used for cargo install r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agomake sure lockfile is used for cargo install
Aleksey Kladov [Tue, 20 Aug 2019 16:27:33 +0000 (19:27 +0300)]
make sure lockfile is used for cargo install

4 years agoMerge #1703
bors[bot] [Mon, 19 Aug 2019 12:42:06 +0000 (12:42 +0000)]
Merge #1703

1703: don't load sysroot in most heavy tests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agodon't load sysroot in most heavy tests
Aleksey Kladov [Mon, 19 Aug 2019 12:41:18 +0000 (15:41 +0300)]
don't load sysroot in most heavy tests

4 years agoMerge #1702
bors[bot] [Mon, 19 Aug 2019 12:09:33 +0000 (12:09 +0000)]
Merge #1702

1702: replace heck with just ascii transformation r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoreplace heck with just ascii transformation
Aleksey Kladov [Mon, 19 Aug 2019 12:08:36 +0000 (15:08 +0300)]
replace heck with just ascii transformation

4 years agoMerge #1701
bors[bot] [Mon, 19 Aug 2019 11:31:01 +0000 (11:31 +0000)]
Merge #1701

1701:  qualify ast types with `ast::`  r=matklad a=matklad

(only the last commit is relevant, the rest are from #1700)

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoqualify ast types with `ast::`
Aleksey Kladov [Mon, 19 Aug 2019 11:27:15 +0000 (14:27 +0300)]
qualify ast types with `ast::`

By convention, ast nodes should always be used as `ast::FnDef`. This
is to avoid confusion with similarly-named hir types.

4 years agoMerge #1700
bors[bot] [Mon, 19 Aug 2019 11:18:09 +0000 (11:18 +0000)]
Merge #1700

1700: remove  ast::*Kind enums r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoremove ast::*Kind from ra_ide_api
Aleksey Kladov [Mon, 19 Aug 2019 11:13:58 +0000 (14:13 +0300)]
remove ast::*Kind from ra_ide_api

4 years agoremove ast::*Kind enums from assists
Aleksey Kladov [Mon, 19 Aug 2019 11:11:09 +0000 (14:11 +0300)]
remove ast::*Kind enums from assists

4 years agoremove ast::*Kind from hir
Aleksey Kladov [Mon, 19 Aug 2019 11:04:51 +0000 (14:04 +0300)]
remove ast::*Kind from hir

4 years agoremove ast::*Kind enums
Aleksey Kladov [Mon, 19 Aug 2019 10:58:49 +0000 (13:58 +0300)]
remove ast::*Kind enums

With the new owned trees, we don't need an indirection here

4 years agoMerge #1699
bors[bot] [Mon, 19 Aug 2019 10:30:19 +0000 (10:30 +0000)]
Merge #1699

1699: :arrow_up: vfs r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: vfs
Aleksey Kladov [Mon, 19 Aug 2019 10:21:34 +0000 (13:21 +0300)]
:arrow_up: vfs

4 years agoMerge #1698
bors[bot] [Mon, 19 Aug 2019 10:17:23 +0000 (10:17 +0000)]
Merge #1698

1698: use derive(Debug) for SyntaxKind r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agouse derive(Debug) for SyntaxKind
Aleksey Kladov [Mon, 19 Aug 2019 10:11:51 +0000 (13:11 +0300)]
use derive(Debug) for SyntaxKind

4 years agoMerge #1697
bors[bot] [Mon, 19 Aug 2019 09:37:03 +0000 (09:37 +0000)]
Merge #1697

1697: Use quote instead of tera for boilerplate generation r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoplug new boilerplate_gen into ra_tools
Aleksey Kladov [Mon, 19 Aug 2019 09:26:34 +0000 (12:26 +0300)]
plug new boilerplate_gen into ra_tools

4 years agorename codegen -> boilerplate_gen
Aleksey Kladov [Mon, 19 Aug 2019 08:39:12 +0000 (11:39 +0300)]
rename codegen -> boilerplate_gen

4 years agodrop tera dependency
Aleksey Kladov [Mon, 19 Aug 2019 08:05:49 +0000 (11:05 +0300)]
drop tera dependency

4 years agouse new quote-generated syntax kinds
Aleksey Kladov [Mon, 19 Aug 2019 08:02:18 +0000 (11:02 +0300)]
use new quote-generated syntax kinds

4 years agoMerge #1696
bors[bot] [Mon, 19 Aug 2019 08:05:39 +0000 (08:05 +0000)]
Merge #1696

1696: fix #1424 r=matklad a=coderfox

- resolve "~" in raLspServerPath

I think expanding simply `~/` is quite simple as node provides `homedir`, but expanding `~foo/` is difficult as there is no cross-platform approach of reading home directory of another user. So this pull request only resolves `~/` in `raLspServerPath`.

Besides, the source code is arranged in a way hard to write tests. Would anyone provide me with instructions of writing tests for this feature, or no test is required for this feature?

Co-authored-by: xfoxfu <i@xfox.me>
4 years agouse quote! to generate syntax kinds
Aleksey Kladov [Mon, 19 Aug 2019 08:02:04 +0000 (11:02 +0300)]
use quote! to generate syntax kinds

4 years agofix #1424
xfoxfu [Mon, 19 Aug 2019 02:48:39 +0000 (10:48 +0800)]
fix #1424
resolve "~" in raLspServerPath

4 years agouse new quote-generated ast
Aleksey Kladov [Sun, 18 Aug 2019 20:36:22 +0000 (23:36 +0300)]
use new quote-generated ast

4 years agouse quote! macro to generate grammar
Aleksey Kladov [Sun, 18 Aug 2019 20:11:08 +0000 (23:11 +0300)]
use quote! macro to generate grammar

We already use syn&quote elsewhere (transitively), so it make sense to
cut down on the number of technologies and get rid of tera

4 years agodeserialize grammar
Aleksey Kladov [Sun, 18 Aug 2019 18:54:51 +0000 (21:54 +0300)]
deserialize grammar

4 years agoswitch to new codegen
Aleksey Kladov [Sun, 18 Aug 2019 18:44:24 +0000 (21:44 +0300)]
switch to new codegen

4 years agocodegen boilerplate
Aleksey Kladov [Sun, 18 Aug 2019 18:34:55 +0000 (21:34 +0300)]
codegen boilerplate

4 years agoadd quote dep
Aleksey Kladov [Sun, 18 Aug 2019 18:33:31 +0000 (21:33 +0300)]
add quote dep

4 years agoMerge #1695
bors[bot] [Sat, 17 Aug 2019 19:23:16 +0000 (19:23 +0000)]
Merge #1695

1695: update lsp r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoupdate lsp
Aleksey Kladov [Sat, 17 Aug 2019 18:34:31 +0000 (21:34 +0300)]
update lsp

4 years agoMerge #1694
bors[bot] [Sat, 17 Aug 2019 15:57:02 +0000 (15:57 +0000)]
Merge #1694

1694: Implement initial type-inference support for Index r=flodiebold a=matklad

This doesn't actually infer indexing types, but at least it walks sub-expressions!

Initially, I wanted to make `Index` just a new kind of `BinOp` (b/c indexing is kind of a binary op), so I've refactoring binop handing a bit.

However, in the end I've decided to add a separate expr kind for Index, because `foo[0]`, `&foo[1]` and `&mut foo[1]` all seem to need slightly different handing, which is not binop-like

r? @flodiebold

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoimplement initial type inference for index expressions
Aleksey Kladov [Sat, 17 Aug 2019 15:05:20 +0000 (18:05 +0300)]
implement initial type inference for index expressions

4 years agonormalize ordering ops
Aleksey Kladov [Sat, 17 Aug 2019 14:51:01 +0000 (17:51 +0300)]
normalize ordering ops

4 years agoIntroduce separate hir::BinaryOp
Aleksey Kladov [Sat, 17 Aug 2019 14:42:41 +0000 (17:42 +0300)]
Introduce separate hir::BinaryOp

Unlike ast::BinOp, it has significantly more structure to it, so it's
easier to, say, handle all assignment-like operations in the same way.

4 years agoimplement accessors for IndexExpr
Aleksey Kladov [Sat, 17 Aug 2019 14:17:01 +0000 (17:17 +0300)]
implement accessors for IndexExpr

4 years agosimplify
Aleksey Kladov [Sat, 17 Aug 2019 14:14:22 +0000 (17:14 +0300)]
simplify

4 years agoMerge #1693
bors[bot] [Sat, 17 Aug 2019 12:30:33 +0000 (12:30 +0000)]
Merge #1693

1693: Remove cpuprofile dependencies r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove cpuprofile dependencies
Aleksey Kladov [Sat, 17 Aug 2019 12:29:57 +0000 (15:29 +0300)]
Remove cpuprofile dependencies

4 years agoMerge #1692
bors[bot] [Sat, 17 Aug 2019 10:53:33 +0000 (10:53 +0000)]
Merge #1692

1692: :arrow_up: deps r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: deps
Aleksey Kladov [Sat, 17 Aug 2019 10:51:22 +0000 (13:51 +0300)]
:arrow_up: deps

4 years agoMerge #1691
bors[bot] [Fri, 16 Aug 2019 14:24:51 +0000 (14:24 +0000)]
Merge #1691

1691: Show inherent and trait impls of structs and enums r=viorina a=viorina

Co-authored-by: Ekaterina Babshukova <ekaterina.babshukova@yandex.ru>
4 years agoshow inherent and trait impls of structs and enums
Ekaterina Babshukova [Fri, 16 Aug 2019 13:34:47 +0000 (16:34 +0300)]
show inherent and trait impls of structs and enums

4 years agoMerge #1689
bors[bot] [Fri, 16 Aug 2019 02:44:13 +0000 (02:44 +0000)]
Merge #1689

1689: Update deps r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoUpdate deps
kjeremy [Fri, 16 Aug 2019 02:36:17 +0000 (22:36 -0400)]
Update deps

4 years agoMerge #1686
bors[bot] [Thu, 15 Aug 2019 12:58:33 +0000 (12:58 +0000)]
Merge #1686

1686: :arrow_up: deps r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: deps
Aleksey Kladov [Thu, 15 Aug 2019 12:58:08 +0000 (15:58 +0300)]
:arrow_up: deps

4 years agoMerge #1445
bors[bot] [Thu, 15 Aug 2019 12:35:12 +0000 (12:35 +0000)]
Merge #1445

1445: Use the new "durability" infrastructure from salsa r=matklad a=matklad

Based on https://github.com/nikomatsakis/salsa/tree/durability

Durability allows us to skip *validation* work for sysroot and crates.io libraries, which massively speeds up some workloads

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoswitch to upstream salsa
Aleksey Kladov [Thu, 15 Aug 2019 12:18:48 +0000 (15:18 +0300)]
switch to upstream salsa

4 years agoimplement durability
Aleksey Kladov [Wed, 26 Jun 2019 06:12:46 +0000 (09:12 +0300)]
implement durability

4 years agoswitch from volatile to untracked read
Aleksey Kladov [Fri, 5 Jul 2019 14:45:57 +0000 (17:45 +0300)]
switch from volatile to untracked read

4 years agoMerge #1685
bors[bot] [Thu, 15 Aug 2019 05:49:13 +0000 (05:49 +0000)]
Merge #1685

1685: fix error of RangeFrom in for-loop r=DJMcNab a=bravomikekilo

fix [issue-1542](https://github.com/rust-analyzer/rust-analyzer/issues/1542) @matklad

Co-authored-by: bravomikekilo <bmk1221@126.com>
4 years agoMerge #1676
bors[bot] [Wed, 14 Aug 2019 15:10:31 +0000 (15:10 +0000)]
Merge #1676

1676: Fix for<'lifetime> for types specified by path r=matklad a=eupn

Fixes #1467.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agofix test position
bravomikekilo [Wed, 14 Aug 2019 13:20:04 +0000 (21:20 +0800)]
fix test position

4 years agofix test
bravomikekilo [Wed, 14 Aug 2019 04:42:58 +0000 (12:42 +0800)]
fix test

4 years agofix error of RangeFrom in for-loop
bravomikekilo [Wed, 14 Aug 2019 03:55:21 +0000 (11:55 +0800)]
fix error of RangeFrom in for-loop

4 years agoFix is_path_start to accept T![<], fix is_path_start usages
Evgenii P [Tue, 13 Aug 2019 15:36:01 +0000 (22:36 +0700)]
Fix is_path_start to accept T![<], fix is_path_start usages

4 years agoMerge #1636
bors[bot] [Tue, 13 Aug 2019 12:46:47 +0000 (12:46 +0000)]
Merge #1636

1636: fix block parse problem r=matklad a=bravomikekilo

try to fix [issue-1598](https://github.com/rust-analyzer/rust-analyzer/issues/1598).

Co-authored-by: bravomikekilo <bmk1221@126.com>
4 years agoadd inline test
bravomikekilo [Tue, 13 Aug 2019 10:17:10 +0000 (18:17 +0800)]
add inline test

4 years agoMerge #1677
bors[bot] [Mon, 12 Aug 2019 19:43:57 +0000 (19:43 +0000)]
Merge #1677

1677: Associated types r=flodiebold a=flodiebold

This implements basic support for (fully qualified) associated type projections:
 - handle fully qualified paths like `<T as Trait>::AssocType` (basically desugaring to something like `Trait<Self=T>::AssocType`)
 - lower these to a new `Ty::Projection` enum variant
 - also introduce `Ty::UnselectedProjection` for cases like `T::AssocType` where the trait from which the type comes isn't specified, but these aren't handled further so far
 - in inference, normalize these projections using Chalk: basically, when encountering a type e.g. from a type annotation or signature, we replace these `Ty::Projection`s by type variables and add obligations to normalize the associated type

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoHandle placeholder assoc types when Chalk produces them
Florian Diebold [Sun, 11 Aug 2019 13:54:31 +0000 (15:54 +0200)]
Handle placeholder assoc types when Chalk produces them

4 years agoNormalize assoc types in more places
Florian Diebold [Sun, 11 Aug 2019 11:52:34 +0000 (13:52 +0200)]
Normalize assoc types in more places

4 years agoImprove debug logging a bit
Florian Diebold [Sat, 10 Aug 2019 10:13:39 +0000 (12:13 +0200)]
Improve debug logging a bit

4 years agoNormalize associated types during inference
Florian Diebold [Wed, 7 Aug 2019 20:06:09 +0000 (22:06 +0200)]
Normalize associated types during inference

4 years agoLower fully qualified associated type paths
Florian Diebold [Mon, 5 Aug 2019 20:42:38 +0000 (22:42 +0200)]
Lower fully qualified associated type paths

I.e. `<T as Trait>::Foo`.

4 years agoAdd representations of associated types
Florian Diebold [Mon, 5 Aug 2019 19:13:34 +0000 (21:13 +0200)]
Add representations of associated types

This adds three different representations, copied from the Chalk model:
 - `Ty::Projection` is an associated type projection written somewhere in the
   code, like `<Foo as Trait>::Bar`.
 - `Ty::UnselectedProjection` is similar, but we don't know the trait
   yet (`Foo::Bar`).
 - The above representations are normalized to their actual types during type
   inference. When that isn't possible, for example for `T::Item` inside an `fn
   foo<T: Iterator>`, the type is normalized to an application type with
   `TypeCtor::AssociatedType`.

4 years agoAdd another test for assoc type resolution
Florian Diebold [Sun, 14 Jul 2019 12:19:00 +0000 (14:19 +0200)]
Add another test for assoc type resolution

4 years agoMerge #1683
bors[bot] [Mon, 12 Aug 2019 16:22:58 +0000 (16:22 +0000)]
Merge #1683

1683: Use Source in Diagnostic r=matklad a=eupn

Closes #1681.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoUse Source in Diagnostic and implement
Evgenii P [Mon, 12 Aug 2019 16:06:08 +0000 (23:06 +0700)]
Use Source in Diagnostic and implement

4 years agoMerge #1682
bors[bot] [Mon, 12 Aug 2019 10:49:59 +0000 (10:49 +0000)]
Merge #1682

1682: Drop support for old extendSelection API r=matklad a=matklad

Emacs now handles this via native LSP request

https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f

r? @flodiebold

(Have not actually tried elisp code)

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop support for old extendSelection API
Aleksey Kladov [Mon, 12 Aug 2019 10:12:45 +0000 (13:12 +0300)]
Drop support for old extendSelection API

Emacs now handles this via native LSP request

https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f

4 years agoMerge #1667
bors[bot] [Mon, 12 Aug 2019 10:33:59 +0000 (10:33 +0000)]
Merge #1667

1667: Show backtraces in lens runnables r=matklad a=SomeoneToIgnore

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoMerge #1675
bors[bot] [Mon, 12 Aug 2019 10:23:33 +0000 (10:23 +0000)]
Merge #1675

1675: Improvements to emacs inlay hints r=matklad a=flodiebold

 - only send request if workspace is initialized (emacs-lsp doesn't seem to
   prevent sending requests before the initialized notification is sent)
 - check whether we're still in the correct buffer before sending request

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoFix for<'lifetime> for types specified by path
Evgenii P [Sun, 11 Aug 2019 09:56:05 +0000 (16:56 +0700)]
Fix for<'lifetime> for types specified by path

4 years agoImprovements to emacs inlay hints
Florian Diebold [Mon, 5 Aug 2019 19:15:44 +0000 (21:15 +0200)]
Improvements to emacs inlay hints

 - only send request if workspace is initialized (emacs-lsp doesn't seem to
   prevent sending requests before the initialized notification is sent)
 - check whether we're still in the correct buffer before sending request

4 years agoAlways set the runnable name
Kirill Bulatov [Fri, 9 Aug 2019 20:34:14 +0000 (23:34 +0300)]
Always set the runnable name

4 years agoExtract common logic
Kirill Bulatov [Fri, 9 Aug 2019 19:18:47 +0000 (22:18 +0300)]
Extract common logic

4 years agoShow backtraces in lens runnables
Kirill Bulatov [Thu, 8 Aug 2019 19:23:05 +0000 (22:23 +0300)]
Show backtraces in lens runnables

4 years agoMerge #1673
bors[bot] [Fri, 9 Aug 2019 10:17:47 +0000 (10:17 +0000)]
Merge #1673

1673: Move numeric names inside of `NameRef` r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMove numeric names inside of `NameRef`
Aleksey Kladov [Fri, 9 Aug 2019 10:16:47 +0000 (12:16 +0200)]
Move numeric names inside of `NameRef`

4 years agoMerge #1669
bors[bot] [Fri, 9 Aug 2019 09:21:50 +0000 (09:21 +0000)]
Merge #1669

1669: Parse tuple struct field initialization r=matklad a=eupn

Closes #1218.

This PR modifies the parser to accept the following code:
```rust
fn main() {
    struct TupleStruct(usize);
    let s = TupleStruct {
        0: 1usize,
    };

    dbg!(s.0);
}
```

<details><summary>with following AST:</summary>

```
SOURCE_FILE@[0; 118)
  FN_DEF@[0; 116)
    FN_KW@[0; 2) "fn"
    WHITESPACE@[2; 3) " "
    NAME@[3; 7)
      IDENT@[3; 7) "main"
    PARAM_LIST@[7; 9)
      L_PAREN@[7; 8) "("
      R_PAREN@[8; 9) ")"
    WHITESPACE@[9; 10) " "
    BLOCK@[10; 116)
      L_CURLY@[10; 11) "{"
      WHITESPACE@[11; 16) "\n    "
      STRUCT_DEF@[16; 42)
        STRUCT_KW@[16; 22) "struct"
        WHITESPACE@[22; 23) " "
        NAME@[23; 34)
          IDENT@[23; 34) "TupleStruct"
        POS_FIELD_DEF_LIST@[34; 41)
          L_PAREN@[34; 35) "("
          POS_FIELD_DEF@[35; 40)
            PATH_TYPE@[35; 40)
              PATH@[35; 40)
                PATH_SEGMENT@[35; 40)
                  NAME_REF@[35; 40)
                    IDENT@[35; 40) "usize"
          R_PAREN@[40; 41) ")"
        SEMI@[41; 42) ";"
      WHITESPACE@[42; 47) "\n    "
      LET_STMT@[47; 94)
        LET_KW@[47; 50) "let"
        WHITESPACE@[50; 51) " "
        BIND_PAT@[51; 52)
          NAME@[51; 52)
            IDENT@[51; 52) "s"
        WHITESPACE@[52; 53) " "
        EQ@[53; 54) "="
        WHITESPACE@[54; 55) " "
        STRUCT_LIT@[55; 93)
          PATH@[55; 66)
            PATH_SEGMENT@[55; 66)
              NAME_REF@[55; 66)
                IDENT@[55; 66) "TupleStruct"
          WHITESPACE@[66; 67) " "
          NAMED_FIELD_LIST@[67; 93)
            L_CURLY@[67; 68) "{"
            WHITESPACE@[68; 77) "\n        "
            NAMED_FIELD@[77; 86)
              NAME_REF@[77; 78)
                INT_NUMBER@[77; 78) "0"
              COLON@[78; 79) ":"
              WHITESPACE@[79; 80) " "
              LITERAL@[80; 86)
                INT_NUMBER@[80; 86) "1usize"
            COMMA@[86; 87) ","
            WHITESPACE@[87; 92) "\n    "
            R_CURLY@[92; 93) "}"
        SEMI@[93; 94) ";"
      WHITESPACE@[94; 104) "\n    \n    "
      EXPR_STMT@[104; 114)
        MACRO_CALL@[104; 113)
          PATH@[104; 107)
            PATH_SEGMENT@[104; 107)
              NAME_REF@[104; 107)
                IDENT@[104; 107) "dbg"
          EXCL@[107; 108) "!"
          TOKEN_TREE@[108; 113)
            L_PAREN@[108; 109) "("
            IDENT@[109; 110) "s"
            DOT@[110; 111) "."
            INT_NUMBER@[111; 112) "0"
            R_PAREN@[112; 113) ")"
        SEMI@[113; 114) ";"
      WHITESPACE@[114; 115) "\n"
      R_CURLY@[115; 116) "}"
  WHITESPACE@[116; 118) "\n\n"
```

</summary>

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoMake name_ref to accept numeric names optionally
Evgenii P [Fri, 9 Aug 2019 09:08:36 +0000 (16:08 +0700)]
Make name_ref to accept numeric names optionally

4 years agoParse tuple struct field initialization
Evgenii P [Fri, 9 Aug 2019 08:38:52 +0000 (15:38 +0700)]
Parse tuple struct field initialization

4 years agoMerge #1668
bors[bot] [Fri, 9 Aug 2019 08:11:26 +0000 (08:11 +0000)]
Merge #1668

1668: Reduce code duplication in lexer r=matklad a=eupn

During an investigation of a fix for #1218, I stumbled upon some code duplication in the lexer.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoChange macro to function
Evgenii P [Fri, 9 Aug 2019 08:04:13 +0000 (15:04 +0700)]
Change macro to function

4 years agorustfmt
Evgenii P [Fri, 9 Aug 2019 07:23:13 +0000 (14:23 +0700)]
rustfmt

4 years agoReduce code duplication in lexer by introducing small macro
Evgenii P [Fri, 9 Aug 2019 07:08:34 +0000 (14:08 +0700)]
Reduce code duplication in lexer by introducing small macro

4 years agoMerge #1661
bors[bot] [Thu, 8 Aug 2019 13:04:28 +0000 (13:04 +0000)]
Merge #1661

1661: Parse function parameters attributes r=matklad a=eupn

Fixes #1397. The [RFC-2565](https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md) specifies `#[attributes]` to function parameters:

```rust
fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
    // ...
}
```

This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.

Co-authored-by: Evgenii P <eupn@protonmail.com>
4 years agoFix parser tests according to review
Evgenii P [Thu, 8 Aug 2019 02:12:07 +0000 (09:12 +0700)]
Fix parser tests according to review

4 years agoDeduplicate while loop break condition
Evgenii P [Thu, 8 Aug 2019 01:58:28 +0000 (08:58 +0700)]
Deduplicate while loop break condition

4 years agoMerge #1664
bors[bot] [Wed, 7 Aug 2019 19:00:38 +0000 (19:00 +0000)]
Merge #1664

1664: assoc types bounds r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoassoc types bounds
Aleksey Kladov [Wed, 7 Aug 2019 19:00:02 +0000 (21:00 +0200)]
assoc types bounds

4 years agoMerge #1663
bors[bot] [Wed, 7 Aug 2019 18:31:37 +0000 (18:31 +0000)]
Merge #1663

1663: architecture.md: update path to parser tests r=matklad a=eupn

Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>
4 years agoMerge #1662
bors[bot] [Wed, 7 Aug 2019 18:21:33 +0000 (18:21 +0000)]
Merge #1662

1662: architecture.md: "finish not Y" -> "finish node Y" r=matklad a=eupn

Is this a typo?

Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>