rust/src/libsyntax
bors de48274c50 auto merge of #8418 : pnkfelix/rust/fsk-issue3192-improve-parse-error-for-empty-struct-init, r=pcwalton,me
Fix #3192.  r? anyone

There are 4 different new tests, to check some different scenarios for
what the parse context is at the time of recovery, becasue our
compile-fail infrastructure does not appear to handle verifying
error-recovery situations.

Differentiate between unit-like struct definition item and unit-like
struct construction in the error message.

----

More generally, outlines a more generic strategy for parse error
recovery: By committing to an expression/statement at set points in
the parser, we can then do some look-ahead to catch common mistakes
and skip over them.

One detail about this strategy is that you want to avoid emitting the
"helpful" message unless the input is reasonably close to the case of
interest.  (E.g. do not warn about a potential unit struct for an
input of the form `let hmm = do foo { } { };`)

To accomplish this, I added (partial) last_token tracking; used for
`commit_stmt` support.

The check_for_erroneous_unit_struct_expecting fn returns bool to
signal whether it "made progress"; currently unused; this is meant for
use to compose several such recovery checks together in a loop.
2013-08-12 00:32:11 -07:00
..
ext auto merge of #8455 : nikomatsakis/rust/issue-5762-objects-dralston-d, r=graydon 2013-08-11 14:17:09 -07:00
parse auto merge of #8418 : pnkfelix/rust/fsk-issue3192-improve-parse-error-for-empty-struct-init, r=pcwalton,me 2013-08-12 00:32:11 -07:00
print libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
util
abi.rs
ast_map.rs libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
ast_util.rs libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
ast.rs std/rustc/rustpkg/syntax: Support the extern mod = ... form 2013-08-09 14:11:50 -07:00
attr.rs libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
codemap.rs auto merge of #8278 : cmr/rust/workaround, r=brson 2013-08-05 20:07:59 -07:00
diagnostic.rs libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
fold.rs std: Rename Iterator.transform -> .map 2013-08-10 07:33:21 -07:00
oldvisit.rs
opt_vec.rs Merge branch 'enum-method-privacy' of https://github.com/michaelwoerister/rust into rollup 2013-08-10 12:59:52 -07:00
syntax.rs Add initial support for a new formatting syntax 2013-08-07 19:21:43 -07:00
visit.rs libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00