Skip to content
Snippets Groups Projects
Commit 320ce075 authored by Jakub Konvička's avatar Jakub Konvička
Browse files

feat(#27): Add support for range based loops for AD

parent f27b9784
1 merge request!15merge: develop into main
Pipeline #1029 passed with stages
in 3 minutes and 1 second
...@@ -205,7 +205,17 @@ public class CppActivityDiagramVisitor : CPP14ParserBaseVisitor<object> ...@@ -205,7 +205,17 @@ public class CppActivityDiagramVisitor : CPP14ParserBaseVisitor<object>
public override object VisitIterationStatement(CPP14Parser.IterationStatementContext context) public override object VisitIterationStatement(CPP14Parser.IterationStatementContext context)
{ {
var condition = context.condition().GetText(); string condition = string.Empty;
if (context.forRangeDeclaration() != null)
{
string rangeDecl = ExtractOriginalText(context.forRangeDeclaration());
string rangeExpr = ExtractOriginalText(context.forRangeInitializer());
condition = $"{rangeDecl}:{rangeExpr}";
}
else if(context.condition() != null)
{
condition = context.condition().GetText();
}
if(context.forInitStatement() != null) if(context.forInitStatement() != null)
{ {
......
...@@ -38,6 +38,10 @@ int main() { ...@@ -38,6 +38,10 @@ int main() {
person1.age = 25; person1.age = 25;
person1.displayInfo(); person1.displayInfo();
for(auto& outlink : node->outlinks) {
outlink.hi();
}
if(person1.age > 18) { if(person1.age > 18) {
std::cout << "Student is an adult" << std::endl; std::cout << "Student is an adult" << std::endl;
int i = 0; int i = 0;
......
...@@ -380,6 +380,11 @@ public class WebApiTests ...@@ -380,6 +380,11 @@ public class WebApiTests
//check if filestream is not empty //check if filestream is not empty
var stream = fileStreamResult.FileStream; var stream = fileStreamResult.FileStream;
Assert.That(stream.Length > 0); Assert.That(stream.Length > 0);
string contents;
using(var sr = new StreamReader(stream))
{
contents = sr.ReadToEnd();
}
} }
else else
{ {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment