Re: XMLReader skip current element
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Tue, 05 Jun 2007 13:16:34 -0700
On Tue, 05 Jun 2007 12:47:18 -0700, Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote:
It depends on quite how broken you make it.
If you miss off a semi-colon or have a random extra character like "+"
between statements, it's still syntactically invalid, but it recovers
quickly. An extra closing brace certainly confuses it though, yes.
I suppose "recovers" is in the eye of the beholder. What I see when one leaves off a semi-colon is that the end of the statement where the semi-colon was expected is flagged. However, the only reason it can do that is that it is apparent upon seeing the first thing that doesn't make sense in that statement (ie, the next statement) where the error is.
But I don't really see that the editor has "recovered". It is simply pointing out the first place it has detected a problem. Just as the compiler won't compile a file even though it could usually correctly infer the correct location of the semicolon, it's not really like the VS editor has judged the remainder of the file correct and accurate. In fact, it gives up on a variety of automatic stuff once it's stumbled (for example, I've lost count of the number of times that I don't get Intellisense feedback because of a localized compiler-type error in my source code).
Compilers, code editors, and XML editors alike can all make inferences about what the input data *should* look like, and try to produce correct behavior based on those inferences. But my experience (granted, limited in the case of XML editors, but not so limited in other areas) is that if the input data does not comply exactly with what's expected, the user is simply told "this data is bad...I'm not going any further until you fix it".
Pete
.
- Follow-Ups:
- Re: XMLReader skip current element
- From: Jon Skeet [C# MVP]
- Re: XMLReader skip current element
- References:
- XMLReader skip current element
- From: Alex
- Re: XMLReader skip current element
- From: Jon Skeet [C# MVP]
- Re: XMLReader skip current element
- From: Alex
- Re: XMLReader skip current element
- From: Jon Skeet [C# MVP]
- Re: XMLReader skip current element
- From: Peter Duniho
- Re: XMLReader skip current element
- From: Jon Skeet [C# MVP]
- XMLReader skip current element
- Prev by Date: WebBrowser DocumentText getting problem ...
- Next by Date: Flash control for screensaver?
- Previous by thread: Re: XMLReader skip current element
- Next by thread: Re: XMLReader skip current element
- Index(es):
Relevant Pages
|