Commit aa05f548 authored by Pim Wijn's avatar Pim Wijn

Fixed problem with syntax errors differently

parent 8d8f1727
......@@ -1819,16 +1819,13 @@ public class LTSminPrinter {
private static int generateMaybe(StringWriter w, Expression e, LTSminPointer state) {
if (e == null) return 0;
if (e instanceof LTSminIdentifier) {
} else if (e instanceof Identifier) {
Identifier id = (Identifier) e;
generateMaybe(w, id.getArrayExpr(), state);
generateMaybe(w, id.getSub(), state);
if (id.getArrayExpr() != null) {
if (w.options.total) {
w.append(" || ");
}
generateExpression(w, id.getArrayExpr(), state);
w.append(" < 0 || ");
......@@ -2097,6 +2094,7 @@ public class LTSminPrinter {
w.append("(0");
} else {
w.append("(");
maybe = maybe.replaceFirst(" \\|\\|", "");
}
w.append(maybe);
w.append(") ? 2 :").appendLine();
......@@ -2110,6 +2108,7 @@ public class LTSminPrinter {
private static void generateBoundsChecks(StringWriter w, LTSminModel model, Expression e) {
StringWriter w2 = new StringWriter(w.options);
generateMaybe(w2, e, out(model));
if (w2.length() > 0) {
if (w.options.total) {
w.appendPrefix();
......@@ -2117,7 +2116,7 @@ public class LTSminPrinter {
w.appendPostfix();
} else {
w.appendPrefix();
w.append("assert( !("+ w2.toString() +") );");
w.append("assert( !("+ w2.toString().replaceFirst(" \\|\\|", "") +") );");
w.appendPostfix();
}
}
......
Markdown is supported
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