Skip to content
Snippets Groups Projects
Verified Commit 3f37c791 authored by Miles Vella's avatar Miles Vella
Browse files

Remove SuffixIdentifierRenaming, the default quotes invalid identifiers which is enough

parent 718e3a45
No related branches found
No related tags found
No related merge requests found
Pipeline #157635 passed
...@@ -8,7 +8,6 @@ import de.be4.classicalb.core.parser.exceptions.PreParseException; ...@@ -8,7 +8,6 @@ import de.be4.classicalb.core.parser.exceptions.PreParseException;
import de.be4.classicalb.core.parser.node.Node; import de.be4.classicalb.core.parser.node.Node;
import de.be4.classicalb.core.parser.node.Start; import de.be4.classicalb.core.parser.node.Start;
import de.be4.classicalb.core.parser.util.PrettyPrinter; import de.be4.classicalb.core.parser.util.PrettyPrinter;
import de.be4.classicalb.core.parser.util.SuffixIdentifierRenaming;
import de.hhu.stups.sablecc.patch.PositionedNode; import de.hhu.stups.sablecc.patch.PositionedNode;
import de.prob.prolog.output.PrologTermOutput; import de.prob.prolog.output.PrologTermOutput;
import de.tla2b.analysis.*; import de.tla2b.analysis.*;
...@@ -82,7 +81,6 @@ public class Translator { ...@@ -82,7 +81,6 @@ public class Translator {
Translator translator = new Translator(moduleName, moduleString, configString); Translator translator = new Translator(moduleName, moduleString, configString);
Start bAST = translator.getBAST(); Start bAST = translator.getBAST();
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
pp.setRenaming(new SuffixIdentifierRenaming());
bAST.apply(pp); bAST.apply(pp);
return pp.getPrettyPrint(); return pp.getPrettyPrint();
} }
...@@ -230,7 +228,6 @@ public class Translator { ...@@ -230,7 +228,6 @@ public class Translator {
} }
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
pp.setRenaming(new SuffixIdentifierRenaming());
getBAST().apply(pp); getBAST().apply(pp);
try (BufferedWriter out = Files.newBufferedWriter(machineFile.toPath(), StandardCharsets.UTF_8)) { try (BufferedWriter out = Files.newBufferedWriter(machineFile.toPath(), StandardCharsets.UTF_8)) {
out.write(GENERATED_BY_TLA2B_HEADER + VERSION_NUMBER + " */\n" + pp.getPrettyPrint()); out.write(GENERATED_BY_TLA2B_HEADER + VERSION_NUMBER + " */\n" + pp.getPrettyPrint());
......
...@@ -38,6 +38,6 @@ public class TestKeywords { ...@@ -38,6 +38,6 @@ public class TestKeywords {
@Test @Test
public void testDom() throws Exception { public void testDom() throws Exception {
compareExpr("dom_1 = 1", "dom = 1"); compareExpr("`dom` = 1", "dom = 1");
} }
} }
...@@ -23,7 +23,6 @@ public class OperationsTest { ...@@ -23,7 +23,6 @@ public class OperationsTest {
String resultTree = TestUtil.getTreeAsString(start); String resultTree = TestUtil.getTreeAsString(start);
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
// FIXME Is it intentional that we don't use SuffixIdentifierRenaming here?
start.apply(pp); start.apply(pp);
// parse pretty print result // parse pretty print result
......
...@@ -10,7 +10,6 @@ import de.be4.classicalb.core.parser.exceptions.BCompoundException; ...@@ -10,7 +10,6 @@ import de.be4.classicalb.core.parser.exceptions.BCompoundException;
import de.be4.classicalb.core.parser.node.Node; import de.be4.classicalb.core.parser.node.Node;
import de.be4.classicalb.core.parser.node.Start; import de.be4.classicalb.core.parser.node.Start;
import de.be4.classicalb.core.parser.util.PrettyPrinter; import de.be4.classicalb.core.parser.util.PrettyPrinter;
import de.be4.classicalb.core.parser.util.SuffixIdentifierRenaming;
import de.prob.prolog.output.PrologTermStringOutput; import de.prob.prolog.output.PrologTermStringOutput;
import de.tla2b.exceptions.TLA2BException; import de.tla2b.exceptions.TLA2BException;
import de.tla2bAst.Translator; import de.tla2bAst.Translator;
...@@ -51,7 +50,6 @@ public class TestUtil { ...@@ -51,7 +50,6 @@ public class TestUtil {
Start start = t.translate(); Start start = t.translate();
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
// FIXME Is it intentional that we don't use SuffixIdentifierRenaming here?
start.apply(pp); start.apply(pp);
System.out.println(pp.getPrettyPrint()); System.out.println(pp.getPrettyPrint());
final BParser parser = new BParser("testcase"); final BParser parser = new BParser("testcase");
...@@ -69,7 +67,6 @@ public class TestUtil { ...@@ -69,7 +67,6 @@ public class TestUtil {
ToolIO.reset(); ToolIO.reset();
Start resultNode = Translator.translateExpressionWithoutModel(tlaExpr); Start resultNode = Translator.translateExpressionWithoutModel(tlaExpr);
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
pp.setRenaming(new SuffixIdentifierRenaming());
resultNode.apply(pp); resultNode.apply(pp);
String bAstString = getAstStringofBExpressionString(bExpr); String bAstString = getAstStringofBExpressionString(bExpr);
String result = getAstStringofBExpressionString(pp.getPrettyPrint()); String result = getAstStringofBExpressionString(pp.getPrettyPrint());
...@@ -82,7 +79,6 @@ public class TestUtil { ...@@ -82,7 +79,6 @@ public class TestUtil {
trans.translate(); trans.translate();
Start resultNode = trans.translateExpressionIncludingModel(tlaExpr); Start resultNode = trans.translateExpressionIncludingModel(tlaExpr);
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
pp.setRenaming(new SuffixIdentifierRenaming());
resultNode.apply(pp); resultNode.apply(pp);
String bAstString = getAstStringofBExpressionString(bExpr); String bAstString = getAstStringofBExpressionString(bExpr);
String result = getAstStringofBExpressionString(pp.getPrettyPrint()); String result = getAstStringofBExpressionString(pp.getPrettyPrint());
...@@ -120,7 +116,6 @@ public class TestUtil { ...@@ -120,7 +116,6 @@ public class TestUtil {
Translator t = new Translator(tlaFile); Translator t = new Translator(tlaFile);
Start start = t.translate(); Start start = t.translate();
PrettyPrinter pp = new PrettyPrinter(); PrettyPrinter pp = new PrettyPrinter();
pp.setRenaming(new SuffixIdentifierRenaming());
start.apply(pp); start.apply(pp);
final BParser parser = new BParser("testcase"); final BParser parser = new BParser("testcase");
parser.parseMachine(pp.getPrettyPrint()); parser.parseMachine(pp.getPrettyPrint());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment