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

fix: skip func body if not exists

parent dec96800
Branches
2 merge requests!17merge: develop into main,!16merge: develop into main
Pipeline #1224 passed with stages
in 2 minutes and 35 seconds
...@@ -99,15 +99,18 @@ public class CppActivityDiagramVisitor : CPP14ParserBaseVisitor<object> ...@@ -99,15 +99,18 @@ public class CppActivityDiagramVisitor : CPP14ParserBaseVisitor<object>
public override object VisitCompoundStatement(CPP14Parser.CompoundStatementContext context) public override object VisitCompoundStatement(CPP14Parser.CompoundStatementContext context)
{ {
foreach (var statement in context.statementSeq().statement()) if(context.statementSeq() != null)
{ {
var text = Visit(statement); foreach (var statement in context.statementSeq().statement())
if (text != null)
{ {
var pop = _decisionBuilderStack.Pop(); var text = Visit(statement);
var push = pop.Item1.AddAction(text.ToString(), pop.Item2.Peek());
_decisionBuilderStack.Push((push, pop.Item2)); if (text != null)
{
var pop = _decisionBuilderStack.Pop();
var push = pop.Item1.AddAction(text.ToString(), pop.Item2.Peek());
_decisionBuilderStack.Push((push, pop.Item2));
}
} }
} }
return null; return null;
......
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