Browse Source

* Src/Parser/CSharp/cs.ATG:

* Src/Parser/CSharp/Parser.cs: Catch clauses have now set their
  correct positions.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4526 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 16 years ago
parent
commit
ffc41d4a7c
  1. 915
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  2. 18
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

915
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

File diff suppressed because it is too large Load Diff

18
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -1721,22 +1721,30 @@ CatchClauses<out List<CatchClause> catchClauses>
"catch" (. string identifier; "catch" (. string identifier;
Statement stmt; Statement stmt;
TypeReference typeRef; TypeReference typeRef;
Location startPos = t.Location;
CatchClause catchClause = null;
.) .)
/*--- general catch clause (as only catch clause) */ /*--- general catch clause (as only catch clause) */
( (
Block<out stmt> (. catchClauses.Add(new CatchClause(stmt)); .) Block<out stmt> (. catchClause = new CatchClause(stmt); .)
/*--- specific catch clause */ /*--- specific catch clause */
| "(" ClassType<out typeRef, false> (. identifier = null; .) | "(" ClassType<out typeRef, false> (. identifier = null; .)
[ Identifier (. identifier = t.val; .) ] [ Identifier (. identifier = t.val; .) ]
")" Block<out stmt> ")" Block<out stmt>
(. catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); .) (. catchClause = new CatchClause(typeRef, identifier, stmt); .)
{ IF (IsTypedCatch()) "catch" "(" ClassType<out typeRef, false> (. identifier = null; .) { IF (IsTypedCatch()) "catch" "(" ClassType<out typeRef, false> (. identifier = null; .)
[ Identifier (. identifier = t.val; .) ] [ Identifier (. identifier = t.val; .) ]
")" Block<out stmt> ")" Block<out stmt>
(. catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); .) } (. catchClause = new CatchClause(typeRef, identifier, stmt); .) }
/*--- general catch clause (after specific catch clauses, optional) */ /*--- general catch clause (after specific catch clauses, optional) */
[ "catch" Block<out stmt> (. catchClauses.Add(new CatchClause(stmt)); .) ] [ "catch" Block<out stmt> (. catchClause = new CatchClause(stmt); .) ]
) ) (.
if (catchClause != null) {
catchClause.StartLocation = startPos;
catchClause.EndLocation = t.Location;
catchClauses.Add(catchClause);
}
.)
. .
GotoStatement<out Statement stmt> GotoStatement<out Statement stmt>

Loading…
Cancel
Save