Browse Source

run CheckParentVisitor on VB.NET unit tests;

fixed parent for Erase statement

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3361 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 17 years ago
parent
commit
a1d947d5cd
  1. 448
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  2. 11
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  3. 9
      src/Libraries/NRefactory/Test/Parser/ParseUtilVBNet.cs

448
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff

11
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -2449,14 +2449,13 @@ EmbeddedStatement<out Statement statement> @@ -2449,14 +2449,13 @@ EmbeddedStatement<out Statement statement>
(. SafeAdd(reDimStatement, reDimStatement.ReDimClauses, expr as InvocationExpression); .)
}
| /* 10.12.2 */
"Erase"
"Erase"
Expr<out expr>
(.List<Expression> arrays = new List<Expression>();
if (expr != null) { arrays.Add(expr);}
EraseStatement eraseStatement = new EraseStatement(arrays);
(.
EraseStatement eraseStatement = new EraseStatement();
if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr);}
.)
{ "," Expr<out expr> (. if (expr != null) { arrays.Add(expr); }.) }
{ "," Expr<out expr> (. if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr); }.) }
(. statement = eraseStatement; .)
| /* 10.11 */
"Stop" (. statement = new StopStatement(); .)

9
src/Libraries/NRefactory/Test/Parser/ParseUtilVBNet.cs

@ -24,13 +24,22 @@ namespace ICSharpCode.NRefactory.Tests.Ast @@ -24,13 +24,22 @@ namespace ICSharpCode.NRefactory.Tests.Ast
{
IParser parser = ParserFactory.CreateParser(SupportedLanguage.VBNet, new StringReader(program));
parser.Parse();
if (expectErrors)
Assert.IsFalse(parser.Errors.ErrorOutput.Length == 0, "Expected errors, but operation completed successfully");
else
Assert.AreEqual("", parser.Errors.ErrorOutput);
Assert.IsNotNull(parser.CompilationUnit);
Assert.IsNotNull(parser.CompilationUnit.Children);
Assert.IsNotNull(parser.CompilationUnit.Children[0]);
Assert.AreEqual(1, parser.CompilationUnit.Children.Count);
Type type = typeof(T);
Assert.IsTrue(type.IsAssignableFrom(parser.CompilationUnit.Children[0].GetType()), String.Format("Parsed expression was {0} instead of {1} ({2})", parser.CompilationUnit.Children[0].GetType(), type, parser.CompilationUnit.Children[0]));
parser.CompilationUnit.AcceptVisitor(new CheckParentVisitor(), null);
return (T)parser.CompilationUnit.Children[0];
}

Loading…
Cancel
Save