Skip to content
Snippets Groups Projects
Commit 145a05f3 authored by Guillaume PICHON's avatar Guillaume PICHON
Browse files

Bug correction : For write parsers, the write variable name must be readed in...

Bug correction : For write parsers, the write variable name must be readed in the constructor before the expresions are initialized.
parent beb8b12a
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<groupId>fr.soleil.deviceservers</groupId> <groupId>fr.soleil.deviceservers</groupId>
<artifactId>TangoParser</artifactId> <artifactId>TangoParser</artifactId>
<version>3.3.7</version> <version>3.3.8</version>
<name>TangoParser</name> <name>TangoParser</name>
<description>TangoParser Device</description> <description>TangoParser Device</description>
......
...@@ -47,6 +47,19 @@ public final class JepParserWrite extends AJepParser { ...@@ -47,6 +47,19 @@ public final class JepParserWrite extends AJepParser {
super(deviceName, name, expression, variables, variablesJepToRead, dataSource); super(deviceName, name, expression, variables, variablesJepToRead, dataSource);
this.expression = expression.trim(); this.expression = expression.trim();
this.variables = variables; this.variables = variables;
int equalIndex = expression.indexOf('=');
if (equalIndex < 1) {
// The equal symbol cannot be absent or the first character.
throw DevFailedUtils.newDevFailed("The equal symbol cannot be absent or the first character.",
"The symbol '=' is absent or is the first character.\nThe expression should be like x = f(y).");
}
resultSymbol = expression.substring(0, equalIndex).trim();
if (resultSymbol.isEmpty()) {
// The result symbol is the name of the writer, it's mandatory.
throw DevFailedUtils.newDevFailed("The result symbol is missing.",
"A result symbol is required before the '='.");
}
logger.debug("resultSymbol is {} for {} ", resultSymbol, expression);
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment