Skip to content

Commit

Permalink
Some minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny authored Sep 19, 2024
2 parents 9feca2b + 7649d61 commit b18288b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ jobs:
- name: Build and test (Windows release)
os: windows-2019
mode: Release
- name: Build and test (Windows debug)
- name: Build (Windows debug)
os: windows-2019
mode: Debug
- name: Build and test (Linux release)
os: ubuntu-20.04
mode: Release
- name: Build and test (Linux debug)
- name: Build (Linux debug)
os: ubuntu-20.04
mode: Debug
- name: Build and test (macOS release)
os: macos-12
mode: Release
- name: Build and test (macOS debug)
- name: Build (macOS debug)
os: macos-12
mode: Debug
env:
Expand Down
1 change: 1 addition & 0 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ macro(configure_clang_and_clang_tidy TARGET_NAME)
-Wno-anon-enum-enum-conversion
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-cast-function-type-strict
-Wno-documentation
-Wno-exit-time-destructors
-Wno-extra-semi-stmt
Expand Down
14 changes: 8 additions & 6 deletions scripts/genericci
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ if [ -d $appDir/build ]; then
exit $exitCode
fi

if [ "`uname -s`" = "Linux" ]; then
$appDir/build/bin/runtests
else
$appDir/build/OpenCOR.app/Contents/MacOS/runtests
fi
if [ "$version" = "release" ]; then
if [ "`uname -s`" = "Linux" ]; then
$appDir/build/bin/runtests
else
$appDir/build/OpenCOR.app/Contents/MacOS/runtests
fi

exitCode=$?
exitCode=$?
fi

if [ $exitCode -eq 0 ]; then
echo -e "\033[42;37;1mAll done!\033[0m"
Expand Down
4 changes: 3 additions & 1 deletion scripts/genericci.bat
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ IF EXIST !AppDir!build (
EXIT /B !ExitCode!
)

!AppDir!build\bin\runtests.exe
IF "%Version" == "release" (
!AppDir!build\bin\runtests.exe
)

EXIT /B !ERRORLEVEL!
) ELSE (
Expand Down
70 changes: 35 additions & 35 deletions src/plugins/editing/CellMLTextView/src/cellmltextviewparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,11 +1119,11 @@ bool CellmlTextViewParser::parseModelDefinition(QDomNode &pDomNode)
if (mScanner.token() == CellmlTextViewScanner::Token::Def) {
// Expect a model definition

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Import,
CellmlTextViewScanner::Token::Unit,
CellmlTextViewScanner::Token::Comp,
CellmlTextViewScanner::Token::Group,
CellmlTextViewScanner::Token::Map };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::Import,
CellmlTextViewScanner::Token::Unit,
CellmlTextViewScanner::Token::Comp,
CellmlTextViewScanner::Token::Group,
CellmlTextViewScanner::Token::Map };

mScanner.getNextToken();

Expand All @@ -1132,7 +1132,7 @@ bool CellmlTextViewParser::parseModelDefinition(QDomNode &pDomNode)
"comp",
"group",
"map"),
Tokens)) {
SubTokens)) {
if (mScanner.token() == CellmlTextViewScanner::Token::Import) {
if (!parseImportDefinition(pDomNode)) {
return false;
Expand Down Expand Up @@ -1444,12 +1444,12 @@ bool CellmlTextViewParser::parseUnitsDefinition(QDomNode &pDomNode)
// We are dealing with a 'normal' unit definition, so loop while we have
// "unit" or leave if we get "enddef"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Unit,
CellmlTextViewScanner::Token::EndDef };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::Unit,
CellmlTextViewScanner::Token::EndDef };

while (tokenType(unitsElement, tr("'%1' or '%2'").arg("unit",
"enddef"),
Tokens)) {
SubTokens)) {
if (mScanner.token() == CellmlTextViewScanner::Token::Unit) {
if (!parseUnitDefinition(unitsElement)) {
return false;
Expand Down Expand Up @@ -1520,18 +1520,18 @@ bool CellmlTextViewParser::parseUnitDefinition(QDomNode &pDomNode)
forever {
// Expect "pref", "expo", "mult" or "off"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Pref,
CellmlTextViewScanner::Token::Expo,
CellmlTextViewScanner::Token::Mult,
CellmlTextViewScanner::Token::Off };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::Pref,
CellmlTextViewScanner::Token::Expo,
CellmlTextViewScanner::Token::Mult,
CellmlTextViewScanner::Token::Off };

mScanner.getNextToken();

if (!tokenType(unitElement, tr("'%1', '%2', '%3' or '%4'").arg("pref",
"expo",
"mult",
"off"),
Tokens)) {
SubTokens)) {
return false;
}

Expand Down Expand Up @@ -1843,16 +1843,16 @@ bool CellmlTextViewParser::parseVariableDeclaration(QDomNode &pDomNode)
forever {
// Expect "init", "pub" or "priv"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Init,
CellmlTextViewScanner::Token::Pub,
CellmlTextViewScanner::Token::Priv };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::Init,
CellmlTextViewScanner::Token::Pub,
CellmlTextViewScanner::Token::Priv };

mScanner.getNextToken();

if (!tokenType(variableElement, tr("'%1', '%2' or '%3'").arg("init",
"pub",
"priv"),
Tokens)) {
SubTokens)) {
return false;
}

Expand Down Expand Up @@ -1906,11 +1906,11 @@ bool CellmlTextViewParser::parseVariableDeclaration(QDomNode &pDomNode)

// Expect a number or an identifier

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Number,
CellmlTextViewScanner::Token::IdentifierOrCmetaId };
static const CellmlTextViewScanner::Tokens SubSubTokens = { CellmlTextViewScanner::Token::Number,
CellmlTextViewScanner::Token::IdentifierOrCmetaId };

if (!tokenType(variableElement, tr("A number or an identifier"),
Tokens)) {
SubSubTokens)) {
return false;
}

Expand All @@ -1924,14 +1924,14 @@ bool CellmlTextViewParser::parseVariableDeclaration(QDomNode &pDomNode)
} else {
// Expect "in", "out" or "none"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::In,
CellmlTextViewScanner::Token::Out,
CellmlTextViewScanner::Token::None };
static const CellmlTextViewScanner::Tokens SubSubTokens = { CellmlTextViewScanner::Token::In,
CellmlTextViewScanner::Token::Out,
CellmlTextViewScanner::Token::None };

if (!tokenType(variableElement, tr("'%1', '%2' or '%3'").arg("in",
"out",
"none"),
Tokens)) {
SubSubTokens)) {
return false;
}
}
Expand Down Expand Up @@ -2140,13 +2140,13 @@ bool CellmlTextViewParser::parseGroupDefinition(QDomNode &pDomNode)

// Expect an identifier, "and" or "for"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::IdentifierOrCmetaId,
CellmlTextViewScanner::Token::And,
CellmlTextViewScanner::Token::For };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::IdentifierOrCmetaId,
CellmlTextViewScanner::Token::And,
CellmlTextViewScanner::Token::For };

if (!tokenType(groupElement, tr("An identifier, '%1' or '%2'").arg("and",
"for"),
Tokens)) {
SubTokens)) {
return false;
}

Expand Down Expand Up @@ -2181,12 +2181,12 @@ bool CellmlTextViewParser::parseGroupDefinition(QDomNode &pDomNode)

// Expect "and" or "for"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::And,
CellmlTextViewScanner::Token::For };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::And,
CellmlTextViewScanner::Token::For };

if (tokenType(groupElement, tr("'%1' or '%2'").arg("and",
"for"),
Tokens)) {
SubTokens)) {
if (mScanner.token() == CellmlTextViewScanner::Token::For) {
break;
}
Expand Down Expand Up @@ -2270,8 +2270,8 @@ bool CellmlTextViewParser::parseComponentRefDefinition(QDomNode &pDomNode)
// Expect at least one "comp", then loop while we have "comp" or leave
// if we get "enddcomp"

static const CellmlTextViewScanner::Tokens Tokens = { CellmlTextViewScanner::Token::Comp,
CellmlTextViewScanner::Token::EndComp };
static const CellmlTextViewScanner::Tokens SubTokens = { CellmlTextViewScanner::Token::Comp,
CellmlTextViewScanner::Token::EndComp };

bool firstTime = true;

Expand All @@ -2297,7 +2297,7 @@ bool CellmlTextViewParser::parseComponentRefDefinition(QDomNode &pDomNode)
}
} while (tokenType(componentRefElement, tr("'%1' or '%2'").arg("comp",
"endcomp"),
Tokens));
SubTokens));

// Expect ";"

Expand Down

0 comments on commit b18288b

Please sign in to comment.