]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoparse impl type
csmoe [Tue, 25 Sep 2018 14:00:43 +0000 (22:00 +0800)]
parse impl type

5 years agoreject impl keyword in impl header
csmoe [Mon, 24 Sep 2018 03:42:01 +0000 (11:42 +0800)]
reject impl keyword in impl header

5 years agoadd test for impl recovery
csmoe [Mon, 24 Sep 2018 03:41:31 +0000 (11:41 +0800)]
add test for impl recovery

5 years agoMerge #78
bors[bot] [Fri, 21 Sep 2018 13:31:27 +0000 (13:31 +0000)]
Merge #78

78: Remove undefined command in code/package.json r=matklad a=ekrctb

Co-authored-by: ekrctb <ekrctb@gmail.com>
5 years agoRemove undefined command
ekrctb [Fri, 21 Sep 2018 13:20:48 +0000 (22:20 +0900)]
Remove undefined command

5 years agoUse more neutral language in the README
Aleksey Kladov [Fri, 21 Sep 2018 11:16:48 +0000 (14:16 +0300)]
Use more neutral language in the README

5 years agoMerge #75
bors[bot] [Wed, 19 Sep 2018 10:56:31 +0000 (10:56 +0000)]
Merge #75

75: libsyntax2 -> rust-analyzer r=matklad a=kjeremy

Change a few `libsyntax2` to `rust-analyzer`

Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
5 years agoprefer lifetimes in extend selection
Aleksey Kladov [Wed, 19 Sep 2018 10:55:47 +0000 (13:55 +0300)]
prefer lifetimes in extend selection

5 years agocleanup comment
Aleksey Kladov [Tue, 18 Sep 2018 22:15:52 +0000 (01:15 +0300)]
cleanup comment

5 years agocommit lock
Aleksey Kladov [Tue, 18 Sep 2018 22:10:19 +0000 (01:10 +0300)]
commit lock

5 years agoAdd emacs function for extend shirnk selection
Aleksey Kladov [Tue, 18 Sep 2018 21:46:10 +0000 (00:46 +0300)]
Add emacs function for extend shirnk selection

5 years agolibsyntax2 -> rust-analyzer
Jeremy A. Kolb [Tue, 18 Sep 2018 21:40:33 +0000 (17:40 -0400)]
libsyntax2 -> rust-analyzer

5 years agoeprintln
Aleksey Kladov [Sun, 16 Sep 2018 14:24:18 +0000 (17:24 +0300)]
eprintln

5 years agogoto super places cursor on mod
Aleksey Kladov [Sun, 16 Sep 2018 13:25:24 +0000 (16:25 +0300)]
goto super places cursor on mod

5 years agotweak readme
Aleksey Kladov [Sun, 16 Sep 2018 12:36:09 +0000 (15:36 +0300)]
tweak readme

5 years agoUpdate readme
Aleksey Kladov [Sun, 16 Sep 2018 11:29:34 +0000 (14:29 +0300)]
Update readme

5 years agorename all things
Aleksey Kladov [Sun, 16 Sep 2018 09:54:24 +0000 (12:54 +0300)]
rename all things

5 years agofix derecated call
Aleksey Kladov [Sun, 16 Sep 2018 00:06:56 +0000 (03:06 +0300)]
fix derecated call

5 years agofix installation for windows
Aleksey Kladov [Sat, 15 Sep 2018 23:02:25 +0000 (00:02 +0100)]
fix installation for windows

5 years agoget rid of commandspeck
Aleksey Kladov [Sat, 15 Sep 2018 23:12:53 +0000 (02:12 +0300)]
get rid of commandspeck

5 years agoMerge #67
bors[bot] [Sat, 15 Sep 2018 21:11:25 +0000 (21:11 +0000)]
Merge #67

67: Salsa r=matklad a=matklad

The aim of this PR is to transition from rather ad-hock FileData and ModuleMap caching strategy to something resembling a general-purpose red-green engine.

Ideally, we shouldn't recompute ModuleMap at all, unless the set of mod decls or files changes.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoeverysalsa
Aleksey Kladov [Sat, 15 Sep 2018 20:42:01 +0000 (23:42 +0300)]
everysalsa

5 years agokill old module_map
Aleksey Kladov [Sat, 15 Sep 2018 20:19:41 +0000 (23:19 +0300)]
kill old module_map

5 years agomove readonly source to module tree descr
Aleksey Kladov [Sat, 15 Sep 2018 17:56:19 +0000 (20:56 +0300)]
move readonly source to module tree descr

5 years agoModuleTreeDescriptor
Aleksey Kladov [Sat, 15 Sep 2018 17:29:22 +0000 (20:29 +0300)]
ModuleTreeDescriptor

5 years agoyet another db api
Aleksey Kladov [Sat, 15 Sep 2018 14:21:47 +0000 (17:21 +0300)]
yet another db api

5 years agominor
Aleksey Kladov [Sat, 15 Sep 2018 10:55:34 +0000 (13:55 +0300)]
minor

5 years agorenames
Aleksey Kladov [Sat, 15 Sep 2018 10:38:31 +0000 (13:38 +0300)]
renames

5 years agouse salsa for new module map
Aleksey Kladov [Thu, 13 Sep 2018 19:58:36 +0000 (22:58 +0300)]
use salsa for new module map

5 years agoeager invalidation
Aleksey Kladov [Wed, 12 Sep 2018 19:30:48 +0000 (22:30 +0300)]
eager invalidation

5 years agobe generic over data
Aleksey Kladov [Wed, 12 Sep 2018 19:11:26 +0000 (22:11 +0300)]
be generic over data

5 years agogeneric salsa algo
Aleksey Kladov [Wed, 12 Sep 2018 18:50:15 +0000 (21:50 +0300)]
generic salsa algo

5 years agostore params in the graph
Aleksey Kladov [Wed, 12 Sep 2018 14:16:58 +0000 (17:16 +0300)]
store params in the graph

5 years agoany-cache
Aleksey Kladov [Wed, 12 Sep 2018 14:13:11 +0000 (17:13 +0300)]
any-cache

5 years agofix dep tracking
Aleksey Kladov [Tue, 11 Sep 2018 08:31:07 +0000 (11:31 +0300)]
fix dep tracking

5 years agoadd deps tracking
Aleksey Kladov [Tue, 11 Sep 2018 07:31:04 +0000 (10:31 +0300)]
add deps tracking

5 years agoAdd simplisitc global modification caching
Aleksey Kladov [Mon, 10 Sep 2018 18:53:33 +0000 (21:53 +0300)]
Add simplisitc global modification caching

5 years agoinitial query tracing
Aleksey Kladov [Mon, 10 Sep 2018 17:48:32 +0000 (20:48 +0300)]
initial query tracing

5 years agostart query-based modules
Aleksey Kladov [Mon, 10 Sep 2018 17:14:31 +0000 (20:14 +0300)]
start query-based modules

5 years agoMerge #69
bors[bot] [Sat, 15 Sep 2018 20:57:06 +0000 (20:57 +0000)]
Merge #69

69: Incremental reparsing for single tokens  r=matklad a=darksv

Implement incremental reparsing for `WHITESPACE`, `COMMENT`, `DOC_COMMENT`, `IDENT`, `STRING` and `RAW_STRING`. This allows to avoid reparsing whole blocks when a change was made only within these tokens.

Co-authored-by: darksv <darek969-12@o2.pl>
5 years agoindependent tests for incremental reparsing of blocks and leaves
darksv [Sat, 15 Sep 2018 15:05:08 +0000 (17:05 +0200)]
independent tests for incremental reparsing of blocks and leaves

5 years agomove reparsing tests
darksv [Sat, 15 Sep 2018 12:35:30 +0000 (14:35 +0200)]
move reparsing tests

5 years agocommit missing file
darksv [Sat, 15 Sep 2018 11:42:10 +0000 (13:42 +0200)]
commit missing file

5 years agocreate separated mod for reparsing functionality
darksv [Sat, 15 Sep 2018 11:35:55 +0000 (13:35 +0200)]
create separated mod for reparsing functionality

5 years agoMerge #71
bors[bot] [Fri, 14 Sep 2018 22:46:18 +0000 (22:46 +0000)]
Merge #71

71: Support for unions r=matklad a=darksv

Fixes #70

Co-authored-by: darksv <darek969-12@o2.pl>
5 years agoadjust trailing newline
darksv [Fri, 14 Sep 2018 21:45:19 +0000 (23:45 +0200)]
adjust trailing newline

5 years agoadd missing files with inline tests
darksv [Fri, 14 Sep 2018 21:32:24 +0000 (23:32 +0200)]
add missing files with inline tests

5 years agoSupport for unions
darksv [Fri, 14 Sep 2018 20:51:12 +0000 (22:51 +0200)]
Support for unions

5 years agocorrectly handle IDENTs when changed to contextual keywords
darksv [Fri, 14 Sep 2018 17:26:48 +0000 (19:26 +0200)]
correctly handle IDENTs when changed to contextual keywords

5 years agocreate leaf directly without calling the parser
darksv [Fri, 14 Sep 2018 16:09:33 +0000 (18:09 +0200)]
create leaf directly without calling the parser

5 years agoIncremental reparsing for single tokens (WHITESPACE, COMMENT, DOC_COMMENT, IDENT...
darksv [Thu, 13 Sep 2018 21:25:05 +0000 (23:25 +0200)]
Incremental reparsing for single tokens (WHITESPACE, COMMENT, DOC_COMMENT, IDENT, STRING, RAW_STRING)

5 years agodon't get stuck in slice patterns
Aleksey Kladov [Wed, 12 Sep 2018 08:26:52 +0000 (11:26 +0300)]
don't get stuck in slice patterns

5 years agocorrectly setup path-map for fs-changes
Aleksey Kladov [Wed, 12 Sep 2018 08:19:19 +0000 (11:19 +0300)]
correctly setup path-map for fs-changes

5 years agoMerge #68
bors[bot] [Tue, 11 Sep 2018 07:32:36 +0000 (07:32 +0000)]
Merge #68

68: Implement incremental reparsing for remaining braced blocks r=matklad a=darksv

Fixes #66

Co-authored-by: darksv <darek969-12@o2.pl>
5 years agoDo not reparse token tree when it is not delimited by braces
darksv [Mon, 10 Sep 2018 21:21:16 +0000 (23:21 +0200)]
Do not reparse token tree when it is not delimited by braces

5 years agoImplement reparsing for remaining blocks
darksv [Mon, 10 Sep 2018 18:14:09 +0000 (20:14 +0200)]
Implement reparsing for remaining blocks

5 years agostore file rsovler
Aleksey Kladov [Mon, 10 Sep 2018 09:57:40 +0000 (12:57 +0300)]
store file rsovler

5 years agoMerge #65
bors[bot] [Sat, 8 Sep 2018 16:24:24 +0000 (16:24 +0000)]
Merge #65

65: simplify r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agonote about symbol search
Aleksey Kladov [Sat, 8 Sep 2018 16:23:52 +0000 (19:23 +0300)]
note about symbol search

5 years agosimplify
Aleksey Kladov [Sat, 8 Sep 2018 16:16:11 +0000 (19:16 +0300)]
simplify

5 years agoMerge #64
bors[bot] [Sat, 8 Sep 2018 16:11:31 +0000 (16:11 +0000)]
Merge #64

64: Add fuzz test-case with a fix r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoFix yet another parser infinite loop
Aleksey Kladov [Sat, 8 Sep 2018 16:10:20 +0000 (19:10 +0300)]
Fix yet another parser infinite loop

This commit is an example of fixing a common parser error: infinite
loop due to error recovery.

This error typically happens when we parse a list of items and fail to
parse a specific item at the current position.

One choices is to skip a token and try to parse a list item at the
next position. This is a good, but not universal, default. When
parsing a list of arguments in a function call, you, for example,
don't want to skip over `fn`, because it's most likely that it is a
function declaration, and not a mistyped arg:

```
fn foo() {
    quux(1, 2

fn bar() {
}
```

Another choice is to bail out of the loop immediately, but it isn't
perfect either: sometimes skipping over garbage helps:

```
quux(1, foo:, 92) // should skip over `:`, b/c that's part of `foo::bar`
```

In general, parser tries to balance these two cases, though we don't
have a definitive strategy yet.

However, if the parser accidentally neither skips over a token, nor
breaks out of the loop, then it becomes stuck in the loop infinitely
(there's an internal counter to self-check this situation and panic
though), and that's exactly what is demonstrated by the test.

To fix such situation, first of all, add the test case to tests/data/parser/{err,fuzz-failures}.

Then, run

```
RUST_BACKTRACE=short cargo test --package libsyntax2
````

to verify that parser indeed panics, and to get an idea what grammar
production is the culprit (look for `_list` functions!).

In this case, I see

```
  10: libsyntax2::grammar::expressions::atom::match_arm_list
             at crates/libsyntax2/src/grammar/expressions/atom.rs:309
```

and that's look like it might be a culprit. I verify it by adding
`eprintln!("loopy {:?}", p.current());` and indeed I see that this is
printed repeatedly.

Diagnosing this a bit shows that the problem is that
`pattern::pattern` function does not consume anything if the next
token is `let`. That is a good default to make cases like

```
let
let foo = 92;
```

where the user hasn't typed the pattern yet, to parse in a reasonable
they correctly.

For match arms, pretty much the single thing we expect is a pattern,
so, for a fix, I introduce a special variant of pattern that does not
do recovery.

5 years agoAdd fuzz failures dir
Aleksey Kladov [Sat, 8 Sep 2018 15:42:59 +0000 (18:42 +0300)]
Add fuzz failures dir

5 years agomove fuzz-invariants to the library
Aleksey Kladov [Sat, 8 Sep 2018 15:34:41 +0000 (18:34 +0300)]
move fuzz-invariants to the library

5 years agoMerge #63
bors[bot] [Sat, 8 Sep 2018 15:20:46 +0000 (15:20 +0000)]
Merge #63

63: Add trivial fuzzer for parser r=matklad a=killercup

As described in #61, fuzz testing some parts of this would be ~~fun~~
helpful. So, I started with the most trivial fuzzer I could think of:
Put random stuff into File::parse and see what happens.

To speed things up, I also did

    cp src/**/*.rs fuzz/corpus/parser/

in the `crates/libsyntax2/` directory (running the fuzzer once will
generate the necessary directories).

Co-authored-by: Pascal Hertleif <killercup@gmail.com>
5 years agoAdd trivial fuzzer for parser
Pascal Hertleif [Sat, 8 Sep 2018 14:55:53 +0000 (16:55 +0200)]
Add trivial fuzzer for parser

As described in #61, fuzz testing some parts of this would be ~~fun~~
helpful. So, I started with the most trivial fuzzer I could think of:
Put random stuff into File::parse and see what happens.

To speed things up, I also did

    cp src/**/*.rs fuzz/corpus/parser/

in the `crates/libsyntax2/` directory (running the fuzzer once will
generate the necessary directories).

5 years agoDon't overflow when limiting symbol search
Aleksey Kladov [Sat, 8 Sep 2018 12:39:28 +0000 (15:39 +0300)]
Don't overflow when limiting symbol search

5 years agoSome abstraction around workers
Aleksey Kladov [Sat, 8 Sep 2018 10:15:01 +0000 (13:15 +0300)]
Some abstraction around workers

5 years agoDeal with deadlocks in a more principaled way
Aleksey Kladov [Sat, 8 Sep 2018 09:36:02 +0000 (12:36 +0300)]
Deal with deadlocks in a more principaled way

5 years agofix deadlock
Aleksey Kladov [Sat, 8 Sep 2018 09:08:46 +0000 (12:08 +0300)]
fix deadlock

5 years agoFix block structure in enums
Aleksey Kladov [Sat, 8 Sep 2018 07:55:09 +0000 (10:55 +0300)]
Fix block structure in enums

5 years agosimplify
Aleksey Kladov [Sat, 8 Sep 2018 07:38:53 +0000 (10:38 +0300)]
simplify

5 years agoDon't get stuck in tuple exprs
Aleksey Kladov [Sat, 8 Sep 2018 07:35:05 +0000 (10:35 +0300)]
Don't get stuck in tuple exprs

5 years agoDon't get stuck in macros
Aleksey Kladov [Sat, 8 Sep 2018 07:28:53 +0000 (10:28 +0300)]
Don't get stuck in macros

5 years agofix stuck parser
Aleksey Kladov [Sat, 8 Sep 2018 07:13:32 +0000 (10:13 +0300)]
fix stuck parser

5 years agofix labled expressions
Aleksey Kladov [Sat, 8 Sep 2018 06:18:42 +0000 (09:18 +0300)]
fix labled expressions

5 years agonested mod completion
Aleksey Kladov [Fri, 7 Sep 2018 22:35:20 +0000 (01:35 +0300)]
nested mod completion

5 years agoRemove dyn dispatch
Aleksey Kladov [Fri, 7 Sep 2018 22:16:07 +0000 (01:16 +0300)]
Remove dyn dispatch

5 years agoSeparete API from IMPL
Aleksey Kladov [Fri, 7 Sep 2018 19:03:39 +0000 (22:03 +0300)]
Separete API from IMPL

Looks like there's a rule of thumb: don't call API functions from an
implementation! In this case, following this rule of thumb saves us an
Arc-bump!

5 years agoMerge #59
bors[bot] [Thu, 6 Sep 2018 14:05:37 +0000 (14:05 +0000)]
Merge #59

59: Moved TokenSet into it's own file. r=matklad a=Plasticcaz

As discussed in Issue #11, the only thing left in that issue that hasn't been fixed appears to be that TokenSet is not in it's own file. This pull request pulls TokenSet, it's macros and it's test into it's own file.

Co-authored-by: Zac Winter <plasticcaz@gmail.com>
5 years agoMoved TokenSet into it's own file.
Zac Winter [Thu, 6 Sep 2018 13:54:54 +0000 (21:54 +0800)]
Moved TokenSet into it's own file.

5 years agobetter introduce
Aleksey Kladov [Wed, 5 Sep 2018 22:19:24 +0000 (01:19 +0300)]
better introduce

5 years agointroduce variable
Aleksey Kladov [Wed, 5 Sep 2018 21:59:07 +0000 (00:59 +0300)]
introduce variable

5 years agouse correct workdir for the server
Aleksey Kladov [Wed, 5 Sep 2018 18:38:43 +0000 (21:38 +0300)]
use correct workdir for the server

5 years agoMerge #58
bors[bot] [Wed, 5 Sep 2018 17:23:25 +0000 (17:23 +0000)]
Merge #58

58: even less hacks r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoeven less hacks
Aleksey Kladov [Wed, 5 Sep 2018 17:22:52 +0000 (20:22 +0300)]
even less hacks

5 years agoMerge #57
bors[bot] [Wed, 5 Sep 2018 15:28:21 +0000 (15:28 +0000)]
Merge #57

57: less hacky paths r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoless hacky paths
Aleksey Kladov [Wed, 5 Sep 2018 15:27:44 +0000 (18:27 +0300)]
less hacky paths

5 years agoMerge #56
bors[bot] [Wed, 5 Sep 2018 15:07:17 +0000 (15:07 +0000)]
Merge #56

56: Unify lookahead naming between parser and lexer. r=matklad a=zachlute

Resolves Issue #26.

I wanted to play around with libsyntax2, and fixing a random issue seemed like a good way to mess around in the code.

This PR mostly does what's suggested in that issue. I elected to go with `at` and `at_str` instead of trying to do any fancy overloading shenanigans, because...uh, well, frankly I don't really know how to do any fancy overloading shenanigans. The only really questionable bit is `nth_is_p`, which could also have potentially been named `nth_at_p`, but `is` seemed more apropos.

I also added simple tests for `Ptr` so I could be less terrified I broke something.

Comments and criticisms very welcome. I'm still pretty new to Rust.

Co-authored-by: Zach Lute <zach.lute@gmail.com>
5 years agofix tests on windows
Aleksey Kladov [Wed, 5 Sep 2018 14:03:27 +0000 (15:03 +0100)]
fix tests on windows

5 years agoAdded tests for Ptr.
Zach Lute [Wed, 5 Sep 2018 06:26:11 +0000 (23:26 -0700)]
Added tests for Ptr.

5 years agoUpdated Ptr methods to better match Parser method names.
Zach Lute [Wed, 5 Sep 2018 05:56:16 +0000 (22:56 -0700)]
Updated Ptr methods to better match Parser method names.

5 years agoswitch to rayon threadpool
Aleksey Kladov [Tue, 4 Sep 2018 17:43:37 +0000 (20:43 +0300)]
switch to rayon threadpool

5 years agosimplify
Aleksey Kladov [Tue, 4 Sep 2018 16:00:01 +0000 (19:00 +0300)]
simplify

5 years agobetter extend selection
Aleksey Kladov [Tue, 4 Sep 2018 09:48:39 +0000 (12:48 +0300)]
better extend selection

5 years agofor types in bounds
Aleksey Kladov [Tue, 4 Sep 2018 09:25:23 +0000 (12:25 +0300)]
for types in bounds

5 years agodont change readonly files
Aleksey Kladov [Tue, 4 Sep 2018 08:40:45 +0000 (11:40 +0300)]
dont change readonly files

5 years agomicro-optimize
Aleksey Kladov [Tue, 4 Sep 2018 02:09:39 +0000 (05:09 +0300)]
micro-optimize

5 years agoaccidentally quadratic
Aleksey Kladov [Tue, 4 Sep 2018 02:04:55 +0000 (05:04 +0300)]
accidentally quadratic

5 years agowork
Aleksey Kladov [Tue, 4 Sep 2018 01:13:22 +0000 (04:13 +0300)]
work