Skip to content

Commit

Permalink
Tests passed
Browse files Browse the repository at this point in the history
  • Loading branch information
balazssimon committed Oct 1, 2019
1 parent 615494e commit 584ddc3
Show file tree
Hide file tree
Showing 13 changed files with 1,348 additions and 1,337 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4678,6 +4678,9 @@ function string GetDeclarationTreeBuilderVisitElement(Antlr4ParserRule rule, Ant
if (annot.Name == MetaCompilerAnnotationInfo.Name)
body = GenerateDeclarationTreeBuilderName(annot, "node."+elem.RedName(), body);
end if
if (annot.Name == MetaCompilerAnnotationInfo.Scope)
body = GenerateDeclarationTreeBuilderScope(annot, "node."+elem.RedName(), body);
end if
if (annot.Name == MetaCompilerAnnotationInfo.SymbolDef)
body = GenerateDeclarationTreeBuilderSymbolDef(annot, "node."+elem.RedName(), body);
end if
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MetaDslx.VisualStudio.cf2296b0-4cb6-423a-9130-8a56bfd89938" Version="0.10.105" Language="en-US" Publisher="Balazs Simon" />
<Identity Id="MetaDslx.VisualStudio.cf2296b0-4cb6-423a-9130-8a56bfd89938" Version="0.10.112" Language="en-US" Publisher="Balazs Simon" />
<DisplayName>MetaDslx Extension for Visual Studio</DisplayName>
<Description xml:space="preserve">Visual Studio extension for the MetaDslx metamodeling platform.</Description>
<License>license.txt</License>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test06 namespace Test06A
{
arrow V1 -> Test06B.V2;
arrow V1 -> V2;
vertex V1;
}

test06 namespace Test06B
{
vertex V2;
arrow Test06A.V1 -> V2;
arrow V1 -> V2;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test07 namespace Test07A
{
arrow V1 -> Test07B.V2;
arrow V1 -> V2;
vertex V1;
}

test07 namespace Test07B
{
vertex V2;
arrow Test07A.V1 -> V2;
arrow V1 -> V2;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test08 namespace Test08A
{
arrow V1 -> Test08B.V2;
arrow V1 -> V2;
vertex V1;
}

test08 namespace Test08B
{
vertex V2;
arrow Test08A.V1 -> V2;
arrow V1 -> V2;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test09 namespace Test09A
{
arrow V1 -> Test09B.V2;
arrow V1 -> V2;
vertex V1;
}

test09 namespace Test09B
{
vertex V2;
arrow Test09A.V1 -> V2;
arrow V1 -> V2;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test10 namespace Test10A
{
arrow V1 -> Test10B.V2;
arrow V1 -> V2;
vertex V1;
}

test10 namespace Test10B
{
vertex V2;
arrow Test10A.V1 -> V2;
arrow V1 -> V2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test: test01 | test02 | test03 | test04 | test05 | test06 | test07 | test08 | te

// ===== Test01 =====

test01: KTest01 namespaceDeclaration01;
test01: KTest01 namespaceDeclaration01*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration01: KNamespace qualifiedName namespaceBody01;
Expand All @@ -31,7 +31,7 @@ arrow01 : KArrow $Property(Source) $SymbolUse(Vertex) source=qualifier TArrow $P

// ===== Test02 =====

test02: KTest02 namespaceDeclaration02;
test02: KTest02 namespaceDeclaration02*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration02: KNamespace qualifiedName namespaceBody02;
Expand Down Expand Up @@ -59,7 +59,7 @@ target02 : qualifier;

// ===== Test03 =====

test03: KTest03 namespaceDeclaration03;
test03: KTest03 namespaceDeclaration03*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration03: KNamespace qualifiedName namespaceBody03;
Expand All @@ -81,7 +81,7 @@ target03 : $Property(Target) $SymbolUse(Vertex) qualifier;

// ===== Test04 =====

test04: KTest04 namespaceDeclaration04;
test04: KTest04 namespaceDeclaration04*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration04: KNamespace qualifiedName namespaceBody04;
Expand All @@ -100,7 +100,7 @@ arrow04 : KArrow $Property(Source) $SymbolUse(Vertex) source=qualifier TArrow $P

// ===== Test05 =====

test05: KTest05 namespaceDeclaration05;
test05: KTest05 namespaceDeclaration05*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration05: KNamespace qualifiedName $Scope $Property(Declarations) namespaceBody05;
Expand All @@ -117,7 +117,7 @@ arrow05 : KArrow $Property(Source) $SymbolUse(Vertex) source=qualifier TArrow $P

// ===== Test06 =====

test06: KTest06 namespaceDeclaration06;
test06: KTest06 namespaceDeclaration06*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration06: KNamespace qualifiedName namespaceBody06;
Expand All @@ -132,11 +132,11 @@ $SymbolDef(symbolType=Vertex,merge=true)
vertex06 : KVertex name TSemicolon;

$SymbolDef(Arrow)
arrow06 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=qualifiedName TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=qualifiedName TSemicolon;
arrow06 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=name TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=name TSemicolon;

// ===== Test07 =====

test07: KTest07 namespaceDeclaration07;
test07: KTest07 namespaceDeclaration07*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration07: KNamespace qualifiedName namespaceBody07;
Expand All @@ -147,7 +147,7 @@ namespaceBody07 : TOpenBrace declaration07* TCloseBrace;
declaration07 : vertex07 | arrow07;

$Property(Declarations)
$SymbolDef(Vertex)
$SymbolDef(symbolType=Vertex,merge=true)
vertex07 : KVertex name TSemicolon;

$Property(Declarations)
Expand All @@ -157,16 +157,16 @@ arrow07 : KArrow source07 TArrow target07 TSemicolon;
$Property(Source)
$Property(name=Declarations,owner=CurrentScope)
$SymbolDef(symbolType=Vertex,merge=true)
source07 : qualifiedName;
source07 : name;

$Property(Target)
$Property(name=Declarations,owner=CurrentScope)
$SymbolDef(symbolType=Vertex,merge=true)
target07 : qualifiedName;
target07 : name;

// ===== Test08 =====

test08: KTest08 namespaceDeclaration08;
test08: KTest08 namespaceDeclaration08*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration08: KNamespace qualifiedName namespaceBody08;
Expand All @@ -176,19 +176,19 @@ namespaceBody08 : TOpenBrace declaration08* TCloseBrace;

declaration08 : vertex08 | arrow08;

vertex08 : KVertex $Property(Declarations) $SymbolDef(Vertex) name TSemicolon;
vertex08 : KVertex $Property(Declarations) $SymbolDef(symbolType=Vertex,merge=true) name TSemicolon;

$Property(Declarations)
$SymbolDef(Arrow)
arrow08 : KArrow source08 TArrow target08 TSemicolon;

source08 : $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) qualifiedName;
source08 : $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) name;

target08 : $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) qualifiedName;
target08 : $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) name;

// ===== Test09 =====

test09: KTest09 namespaceDeclaration09;
test09: KTest09 namespaceDeclaration09*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration09: KNamespace qualifiedName namespaceBody09;
Expand All @@ -199,15 +199,15 @@ namespaceBody09 : TOpenBrace declaration09* TCloseBrace;
$Property(Declarations)
declaration09 : vertex09 | arrow09;

$SymbolDef(Vertex)
$SymbolDef(symbolType=Vertex,merge=true)
vertex09 : KVertex name TSemicolon;

$SymbolDef(Arrow)
arrow09 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=qualifiedName TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=qualifiedName TSemicolon;
arrow09 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=name TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=name TSemicolon;

// ===== Test10 =====

test10: KTest10 namespaceDeclaration10;
test10: KTest10 namespaceDeclaration10*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration10: KNamespace qualifiedName $Scope $Property(Declarations) namespaceBody10;
Expand All @@ -216,15 +216,15 @@ namespaceBody10 : TOpenBrace declaration10* TCloseBrace;

declaration10 : vertex10 | arrow10;

$SymbolDef(Vertex)
$SymbolDef(symbolType=Vertex,merge=true)
vertex10 : KVertex name TSemicolon;

$SymbolDef(Arrow)
arrow10 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=qualifiedName TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=qualifiedName TSemicolon;
arrow10 : KArrow $Property(Source) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) source=name TArrow $Property(Target) $Property(name=Declarations,owner=CurrentScope) $SymbolDef(symbolType=Vertex,merge=true) target=name TSemicolon;

// ===== Test11 =====

test11: KTest11 namespaceDeclaration11;
test11: KTest11 namespaceDeclaration11*;

$SymbolDef(symbolType=Namespace,nestingProperty=Members,merge=true)
namespaceDeclaration11: KNamespace qualifiedName namespaceBody11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected TestLangOneCompilation Compile(string testId, string fileId, bool asse
TestLangOneDescriptor.Initialize();
string text = File.ReadAllText($@"..\..\..\InputFiles\Test{testId}-File{fileId}.txt");
var st = TestLangOneSyntaxTree.ParseText(text);
var options = new TestLangOneCompilationOptions(TestLangOneLanguage.Instance, Microsoft.CodeAnalysis.OutputKind.DynamicallyLinkedLibrary, topLevelBinderFlags: (BinderFlags)BinderFlags.IgnoreAccessibility);
var options = new TestLangOneCompilationOptions(TestLangOneLanguage.Instance, Microsoft.CodeAnalysis.OutputKind.DynamicallyLinkedLibrary, topLevelBinderFlags: (BinderFlags)BinderFlags.IgnoreAccessibility, concurrentBuild: false);
var comp = TestLangOneCompilation.Create("Test").WithOptions(options).AddSyntaxTrees(st);
comp.ForceComplete();
if (assertEmptyDiagnostics) AssertEmptyDiagnostics(comp);
Expand Down
30 changes: 17 additions & 13 deletions src/Test/MetaDslx.CodeAnalysis.Antlr4.Test/UnitTestBase02.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,29 @@ public void File03()
var comp = Compile(TestId, "03");
var model = comp.Model;
var modelSymbols = model.Symbols.ToList();
Assert.Equal(6, modelSymbols.Count);
Assert.Equal(8, modelSymbols.Count);
var ns1 = Assert.IsAssignableFrom<Namespace>(modelSymbols[0]);
Assert.Equal($"Test{TestId}A", ns1.Name);
var ns2 = Assert.IsAssignableFrom<Namespace>(modelSymbols[1]);
Assert.Equal($"Test{TestId}B", ns2.Name);
var ns1decls = ns1.Declarations;
Assert.Equal(2, ns1decls.Count);
Assert.Equal(3, ns1decls.Count);
var ns2decls = ns2.Declarations;
Assert.Equal(2, ns2decls.Count);
var a1 = Assert.IsAssignableFrom<Arrow>(ns1decls[0]);
var v1 = Assert.IsAssignableFrom<Vertex>(ns1decls[1]);
Assert.Equal("V1", v1.Name);
var a2 = Assert.IsAssignableFrom<Arrow>(ns2decls[1]);
var v2 = Assert.IsAssignableFrom<Vertex>(ns2decls[0]);
Assert.Equal("V2", v2.Name);
Assert.Equal(v1, a1.Source);
Assert.Equal(v2, a1.Target);
Assert.Equal(v1, a2.Source);
Assert.Equal(v2, a2.Target);
Assert.Equal(3, ns2decls.Count);
var a1a = Assert.IsAssignableFrom<Arrow>(ns1decls[2]);
var v1a = Assert.IsAssignableFrom<Vertex>(ns1decls[0]);
Assert.Equal("V1", v1a.Name);
var v2a = Assert.IsAssignableFrom<Vertex>(ns1decls[1]);
Assert.Equal("V2", v2a.Name);
Assert.Equal(v1a, a1a.Source);
Assert.Equal(v2a, a1a.Target);
var a1b = Assert.IsAssignableFrom<Arrow>(ns2decls[2]);
var v1b = Assert.IsAssignableFrom<Vertex>(ns2decls[1]);
Assert.Equal("V1", v1b.Name);
var v2b = Assert.IsAssignableFrom<Vertex>(ns2decls[0]);
Assert.Equal("V2", v2b.Name);
Assert.Equal(v1b, a1b.Source);
Assert.Equal(v2b, a1b.Target);
}


Expand Down
4 changes: 2 additions & 2 deletions src/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
-->
<PropertyGroup>
<OfficialBuild>true</OfficialBuild>
<VersionPrefix>0.10.111</VersionPrefix>
<VersionPrefix>0.10.112</VersionPrefix>
<VersionSuffix Condition="'$(OfficialBuild)' != 'true' and '$(DotNetUseShippingVersions)' != 'true'">alpha1</VersionSuffix>
<BootstrapVersion>0.10.110</BootstrapVersion>
<BootstrapVersion>0.10.111</BootstrapVersion>
<SemanticVersioningV1>true</SemanticVersioningV1>
<!--
By default the assembly version in official builds is "$(VersionPrefix).0".
Expand Down

0 comments on commit 584ddc3

Please sign in to comment.