We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
CodeGenerator.write
writeToWriter
1 parent ce241de commit f0a5a2cCopy full SHA for f0a5a2c
tool/src/org/antlr/v4/codegen/CodeGenerator.java
@@ -168,13 +168,18 @@ public void writeVocabFile() {
168
}
169
170
171
+ // Don't inline: used in https://github.com/antlr/antlr4/issues/3874
172
+ protected void writeToWriter(ST code, Writer w) throws IOException{
173
+ STWriter wr = new AutoIndentWriter(w);
174
+ wr.setLineWidth(lineWidth);
175
+ code.write(wr);
176
+ }
177
+
178
public void write(ST code, String fileName) {
179
try {
180
// long start = System.currentTimeMillis();
181
Writer w = tool.getOutputFileWriter(g, fileName);
- STWriter wr = new AutoIndentWriter(w);
- wr.setLineWidth(lineWidth);
- code.write(wr);
182
+ writeToWriter(code, w);
183
w.close();
184
// long stop = System.currentTimeMillis();
185
0 commit comments