rust/src/libsyntax/parse
Felix S. Klock II eee044734c Add parse-error recovery for erroneous struct_id { } form.
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-09 18:32:46 +02:00
..
attr.rs syntax: modernise attribute handling in syntax::attr. 2013-07-20 01:06:16 +10:00
classify.rs syntax: implement foreach .. in .. { .. } via desugaring. 2013-07-30 18:50:28 -07:00
comments.rs remove obsolete foreach keyword 2013-08-03 22:48:02 -04:00
common.rs
lexer.rs remove obsolete foreach keyword 2013-08-03 22:48:02 -04:00
mod.rs New naming convention for ast::{node_id, local_crate, crate_node_id, blk_check_mode, ty_field, ty_method} 2013-07-29 16:16:48 +02:00
obsolete.rs librustc: Disallow "unsafe" for external functions 2013-08-02 21:57:59 -07:00
parser.rs Add parse-error recovery for erroneous struct_id { } form. 2013-08-09 18:32:46 +02:00
token.rs core: option.map_consume -> option.map_move 2013-08-07 08:52:09 -07:00