Skip to content
Snippets Groups Projects
Commit db3f71c2 authored by Florian Lugou's avatar Florian Lugou
Browse files

fixed bug with syntactically wrong guards

parent e94709aa
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,10 @@ public abstract class AvatarTerm extends AvatarElement {
}
public static AvatarTerm createFromString (AvatarStateMachineOwner block, String toParse) {
return AvatarTerm.createFromString(block, toParse, false);
}
public static AvatarTerm createFromString (AvatarStateMachineOwner block, String toParse, boolean allowRaw) {
if (toParse == null || toParse.isEmpty ())
return null;
......@@ -105,7 +109,10 @@ public abstract class AvatarTerm extends AvatarElement {
//TraceManager.addDev ("AvatarConstant '" + toParse + "' couldn't be parsed");
//TraceManager.addDev ("AvatarTerm '" + toParse + "' couldn't be parsed");
return new AvatarTermRaw (toParse, block);
if (allowRaw)
return new AvatarTermRaw (toParse, block);
else
return null;
}
public static AvatarAction createActionFromString (AvatarStateMachineOwner block, String toParse) {
......
......@@ -62,8 +62,8 @@ public class AvatarTuple extends AvatarLeftHand {
public static AvatarTuple createFromString (AvatarStateMachineOwner block, String toParse) {
AvatarTuple result = null;
int indexLParen = toParse.indexOf ("(");
if (indexLParen != -1) {
if (toParse.trim().startsWith("(")) {
int indexLParen = toParse.indexOf ("(");
int indexRParen = toParse.indexOf (")", indexLParen);
if (indexRParen == -1)
indexRParen = toParse.length ();
......
......@@ -43,6 +43,8 @@
* @see
*/
package avatartranslator;
import org.junit.Test;
import org.junit.*;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment