| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | __7.3.0 (SNAPSHOT)__ | |
| 2 | 2 | ||
| 3 | + - added way to manipulate current JCP text buffers as string variables: `jcp.text.buffer.all`,`jcp.text.buffer.middle`,`jcp.text.buffer.prefix` and `jcp.text.buffer.postfix` | ||
| 3 | 4 | - added way to find `PreprocessorExtension` and `SpecialVariableProcessor` among Java services | |
| 4 | 5 | - refactoring of API for `SpecialVariableProcessor` and `CommentTextProcessor` | |
| 5 | 6 | - replaced single string property `actionPreprocessorExtension` by string list `actionPreprocessorExtensions` to provide way for many preprocessor extensions. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ | |||
| 33 | 33 | import com.igormaznitsa.jcp.exceptions.FilePositionInfo; | |
| 34 | 34 | import com.igormaznitsa.jcp.exceptions.PreprocessorException; | |
| 35 | 35 | import com.igormaznitsa.jcp.utils.PreprocessorUtils; | |
| 36 | - import com.igormaznitsa.jcp.utils.ResetablePrinter; | ||
| 36 | + import com.igormaznitsa.jcp.utils.ResettablePrinter; | ||
| 37 | 37 | import java.io.File; | |
| 38 | 38 | import java.io.IOException; | |
| 39 | 39 | import java.util.ArrayList; | |
@@ -437,7 +437,7 @@ private void flushTextBufferForRemovedComments( | |||
| 437 | 437 | final AtomicReference<Map.Entry<String, String>> firstDetectedUncommentLinePtr, | |
| 438 | 438 | final int stringIndex, | |
| 439 | 439 | final List<String> textPieces, | |
| 440 | - final ResetablePrinter resetablePrinter, | ||
| 440 | + final ResettablePrinter resettablePrinter, | ||
| 441 | 441 | final PreprocessingState state, | |
| 442 | 442 | final PreprocessorContext context) | |
| 443 | 443 | throws IOException { | |
@@ -456,7 +456,7 @@ private void flushTextBufferForRemovedComments( | |||
| 456 | 456 | ||
| 457 | 457 | if (accumulated.isEmpty()) { | |
| 458 | 458 | if (lastEol) { | |
| 459 | - resetablePrinter.print(context.getEol()); | ||
| 459 | + resettablePrinter.print(context.getEol()); | ||
| 460 | 460 | } | |
| 461 | 461 | } else { | |
| 462 | 462 | final List<CommentTextProcessor> processors = context.getCommentTextProcessors(); | |
@@ -495,7 +495,7 @@ private void flushTextBufferForRemovedComments( | |||
| 495 | 495 | text = results.stream().collect(Collectors.joining(context.getEol())); | |
| 496 | 496 | } | |
| 497 | 497 | } | |
| 498 | - resetablePrinter.print(text + (lastEol ? context.getEol() : "")); | ||
| 498 | + resettablePrinter.print(text + (lastEol ? context.getEol() : "")); | ||
| 499 | 499 | } | |
| 500 | 500 | } | |
| 501 | 501 | ||
@@ -544,8 +544,8 @@ public PreprocessingState preprocessFileWithNotification(final PreprocessingStat | |||
| 544 | 544 | new AtomicReference<>(); | |
| 545 | 545 | ||
| 546 | 546 | while (!Thread.currentThread().isInterrupted()) { | |
| 547 | - final ResetablePrinter thePrinter = | ||
| 548 | - requireNonNull(theState.getPrinter(), "Printer must be defined"); | ||
| 547 | + final ResettablePrinter thePrinter = | ||
| 548 | + requireNonNull(theState.getSelectedPrinter(), "Printer must be defined"); | ||
| 549 | 549 | ||
| 550 | 550 | String rawString = theState.nextLine(); | |
| 551 | 551 | final boolean presentedNextLine = theState.hasReadLineNextLineInEnd(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,10 @@ | |||
| 40 | 40 | */ | |
| 41 | 41 | public class JCPSpecialVariableProcessor implements SpecialVariableProcessor { | |
| 42 | 42 | ||
| 43 | + public static final String VAR_JCP_BUFFER_ALL = "jcp.text.buffer.all"; | ||
| 44 | + public static final String VAR_JCP_BUFFER_MIDDLE = "jcp.text.buffer.middle"; | ||
| 45 | + public static final String VAR_JCP_BUFFER_PREFIX = "jcp.text.buffer.prefix"; | ||
| 46 | + public static final String VAR_JCP_BUFFER_POSTFIX = "jcp.text.buffer.postfix"; | ||
| 43 | 47 | public static final String VAR_DEST_DIR = "jcp.dst.dir"; | |
| 44 | 48 | public static final String VAR_VERSION = "jcp.version"; | |
| 45 | 49 | public static final String VAR_DEST_FILE_NAME = "jcp.dst.name"; | |
@@ -84,12 +88,25 @@ public static List<NameReferencePair> getReference() { | |||
| 84 | 88 | result.add( | |
| 85 | 89 | new NameReferencePair(VAR_TIMESTAMP, "Source file timestamp (EEE MMM dd HH:mm:ss yyyy)")); | |
| 86 | 90 | ||
| 91 | + result.add(new NameReferencePair(VAR_JCP_BUFFER_ALL, | ||
| 92 | + "Whole current text buffer for preprocessing file")); | ||
| 93 | + result.add(new NameReferencePair(VAR_JCP_BUFFER_MIDDLE, | ||
| 94 | + "Current middle text buffer for preprocessing file")); | ||
| 95 | + result.add(new NameReferencePair(VAR_JCP_BUFFER_PREFIX, | ||
| 96 | + "Current prefix text buffer for preprocessing file")); | ||
| 97 | + result.add(new NameReferencePair(VAR_JCP_BUFFER_POSTFIX, | ||
| 98 | + "Current postfix text buffer for preprocessing file")); | ||
| 99 | + | ||
| 87 | 100 | return result; | |
| 88 | 101 | } | |
| 89 | 102 | ||
| 90 | 103 | @Override | |
| 91 | 104 | public Set<String> getVariableNames() { | |
| 92 | 105 | return Set.of( | |
| 106 | + VAR_JCP_BUFFER_PREFIX, | ||
| 107 | + VAR_JCP_BUFFER_MIDDLE, | ||
| 108 | + VAR_JCP_BUFFER_POSTFIX, | ||
| 109 | + VAR_JCP_BUFFER_ALL, | ||
| 93 | 110 | VAR_DEST_DIR, | |
| 94 | 111 | VAR_DEST_FILE_NAME, | |
| 95 | 112 | VAR_DEST_FULLPATH, | |
@@ -112,6 +129,17 @@ public Value getVariable(final String varName, final PreprocessorContext context | |||
| 112 | 129 | final PreprocessingState state = context.getPreprocessingState(); | |
| 113 | 130 | ||
| 114 | 131 | switch (varName) { | |
| 132 | + case VAR_JCP_BUFFER_ALL: | ||
| 133 | + return Value.valueOf(context.getPreprocessingState().getCurrentText()); | ||
| 134 | + case VAR_JCP_BUFFER_POSTFIX: | ||
| 135 | + return Value.valueOf(context.getPreprocessingState().findPrinter( | ||
| 136 | + PreprocessingState.PrinterType.POSTFIX).getText()); | ||
| 137 | + case VAR_JCP_BUFFER_MIDDLE: | ||
| 138 | + return Value.valueOf(context.getPreprocessingState().findPrinter( | ||
| 139 | + PreprocessingState.PrinterType.NORMAL).getText()); | ||
| 140 | + case VAR_JCP_BUFFER_PREFIX: | ||
| 141 | + return Value.valueOf(context.getPreprocessingState().findPrinter( | ||
| 142 | + PreprocessingState.PrinterType.PREFIX).getText()); | ||
| 115 | 143 | case VAR_DEST_DIR: | |
| 116 | 144 | return Value.valueOf(state.getRootFileInfo().getTargetFolder()); | |
| 117 | 145 | case VAR_DEST_FILE_NAME: | |
@@ -164,6 +192,22 @@ public void setVariable(final String varName, final Value value, | |||
| 164 | 192 | final PreprocessorContext context) { | |
| 165 | 193 | final PreprocessingState state = context.getPreprocessingState(); | |
| 166 | 194 | switch (varName) { | |
| 195 | + case VAR_JCP_BUFFER_ALL: { | ||
| 196 | + state.setBufferText(value.toString()); | ||
| 197 | + } | ||
| 198 | + break; | ||
| 199 | + case VAR_JCP_BUFFER_POSTFIX: { | ||
| 200 | + state.setBufferText(value.toString(), PreprocessingState.PrinterType.POSTFIX); | ||
| 201 | + } | ||
| 202 | + break; | ||
| 203 | + case VAR_JCP_BUFFER_MIDDLE: { | ||
| 204 | + state.setBufferText(value.toString(), PreprocessingState.PrinterType.NORMAL); | ||
| 205 | + } | ||
| 206 | + break; | ||
| 207 | + case VAR_JCP_BUFFER_PREFIX: { | ||
| 208 | + state.setBufferText(value.toString(), PreprocessingState.PrinterType.PREFIX); | ||
| 209 | + } | ||
| 210 | + break; | ||
| 167 | 211 | case VAR_DEST_DIR: | |
| 168 | 212 | if (value.getType() != ValueType.STRING) { | |
| 169 | 213 | throw new IllegalArgumentException("Only STRING type allowed"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,14 +24,16 @@ | |||
| 24 | 24 | import static com.igormaznitsa.jcp.removers.AbstractCommentRemover.makeCommentRemover; | |
| 25 | 25 | import static com.igormaznitsa.jcp.utils.IOUtils.closeQuietly; | |
| 26 | 26 | import static com.igormaznitsa.jcp.utils.PreprocessorUtils.findFirstActiveFileContainer; | |
| 27 | + import static java.util.Objects.requireNonNull; | ||
| 28 | + import static java.util.Objects.requireNonNullElse; | ||
| 27 | 29 | ||
| 28 | 30 | import com.igormaznitsa.jcp.containers.FileInfoContainer; | |
| 29 | 31 | import com.igormaznitsa.jcp.containers.PreprocessingFlag; | |
| 30 | 32 | import com.igormaznitsa.jcp.containers.TextFileDataContainer; | |
| 31 | 33 | import com.igormaznitsa.jcp.exceptions.FilePositionInfo; | |
| 32 | 34 | import com.igormaznitsa.jcp.exceptions.PreprocessorException; | |
| 33 | 35 | import com.igormaznitsa.jcp.utils.PreprocessorUtils; | |
| 34 | - import com.igormaznitsa.jcp.utils.ResetablePrinter; | ||
| 36 | + import com.igormaznitsa.jcp.utils.ResettablePrinter; | ||
| 35 | 37 | import java.io.BufferedInputStream; | |
| 36 | 38 | import java.io.BufferedOutputStream; | |
| 37 | 39 | import java.io.BufferedWriter; | |
@@ -52,7 +54,6 @@ | |||
| 52 | 54 | import java.util.EnumSet; | |
| 53 | 55 | import java.util.LinkedList; | |
| 54 | 56 | import java.util.List; | |
| 55 | - import java.util.Objects; | ||
| 56 | 57 | import java.util.Optional; | |
| 57 | 58 | import java.util.Set; | |
| 58 | 59 | import java.util.concurrent.atomic.AtomicBoolean; | |
@@ -79,15 +80,15 @@ public final class PreprocessingState { | |||
| 79 | 80 | private final LinkedList<TextFileDataContainer> ifStack = new LinkedList<>(); | |
| 80 | 81 | private final LinkedList<TextFileDataContainer> includeStack = new LinkedList<>(); | |
| 81 | 82 | private final LinkedList<ExcludeIfInfo> deferredExcludeStack = new LinkedList<>(); | |
| 82 | - private final ResetablePrinter prefixPrinter = new ResetablePrinter(1024); | ||
| 83 | - private final ResetablePrinter postfixPrinter = new ResetablePrinter(64 * 1024); | ||
| 84 | - private final ResetablePrinter normalPrinter = new ResetablePrinter(1024); | ||
| 83 | + private final ResettablePrinter prefixPrinter = new ResettablePrinter(1024); | ||
| 84 | + private final ResettablePrinter postfixPrinter = new ResettablePrinter(64 * 1024); | ||
| 85 | + private final ResettablePrinter normalPrinter = new ResettablePrinter(1024); | ||
| 85 | 86 | private final boolean overrideOnlyIfContentChanged; | |
| 86 | 87 | private final EnumSet<PreprocessingFlag> preprocessingFlags = | |
| 87 | 88 | EnumSet.noneOf(PreprocessingFlag.class); | |
| 88 | 89 | private final PreprocessorContext context; | |
| 89 | 90 | private final boolean mockMode; | |
| 90 | - private ResetablePrinter currentPrinter; | ||
| 91 | + private ResettablePrinter selectedPrinter; | ||
| 91 | 92 | private TextFileDataContainer activeIf; | |
| 92 | 93 | private TextFileDataContainer activeWhile; | |
| 93 | 94 | private String lastReadString; | |
@@ -96,8 +97,8 @@ public final class PreprocessingState { | |||
| 96 | 97 | PreprocessingState(final PreprocessorContext context, final Charset inEncoding, | |
| 97 | 98 | final Charset outEncoding) { | |
| 98 | 99 | this.mockMode = true; | |
| 99 | - this.globalInCharacterEncoding = Objects.requireNonNull(inEncoding); | ||
| 100 | - this.globalOutCharacterEncoding = Objects.requireNonNull(outEncoding); | ||
| 100 | + this.globalInCharacterEncoding = requireNonNull(inEncoding); | ||
| 101 | + this.globalOutCharacterEncoding = requireNonNull(outEncoding); | ||
| 101 | 102 | this.rootReference = null; | |
| 102 | 103 | this.lastReadString = ""; | |
| 103 | 104 | this.rootFileInfo = new FileInfoContainer(new File("global"), "global", true); | |
@@ -114,10 +115,10 @@ public final class PreprocessingState { | |||
| 114 | 115 | this.context = context; | |
| 115 | 116 | ||
| 116 | 117 | this.overrideOnlyIfContentChanged = overrideOnlyIfContentChanged; | |
| 117 | - this.globalInCharacterEncoding = Objects.requireNonNull(inEncoding); | ||
| 118 | - this.globalOutCharacterEncoding = Objects.requireNonNull(outEncoding); | ||
| 118 | + this.globalInCharacterEncoding = requireNonNull(inEncoding); | ||
| 119 | + this.globalOutCharacterEncoding = requireNonNull(outEncoding); | ||
| 119 | 120 | ||
| 120 | - this.rootFileInfo = Objects.requireNonNull(rootFile, "The root file is null"); | ||
| 121 | + this.rootFileInfo = requireNonNull(rootFile, "The root file is null"); | ||
| 121 | 122 | init(); | |
| 122 | 123 | rootReference = openFile(rootFile.getSourceFile()); | |
| 123 | 124 | } | |
@@ -129,11 +130,11 @@ public final class PreprocessingState { | |||
| 129 | 130 | ||
| 130 | 131 | this.context = context; | |
| 131 | 132 | ||
| 132 | - this.globalInCharacterEncoding = Objects.requireNonNull(inEncoding); | ||
| 133 | - this.globalOutCharacterEncoding = Objects.requireNonNull(outEncoding); | ||
| 133 | + this.globalInCharacterEncoding = requireNonNull(inEncoding); | ||
| 134 | + this.globalOutCharacterEncoding = requireNonNull(outEncoding); | ||
| 134 | 135 | this.overrideOnlyIfContentChanged = overrideOnlyIfContentChanged; | |
| 135 | 136 | ||
| 136 | - this.rootFileInfo = Objects.requireNonNull(rootFile, "The root file is null"); | ||
| 137 | + this.rootFileInfo = requireNonNull(rootFile, "The root file is null"); | ||
| 137 | 138 | init(); | |
| 138 | 139 | rootReference = rootContainer; | |
| 139 | 140 | includeStack.push(rootContainer); | |
@@ -161,8 +162,8 @@ public String getLastReadString() { | |||
| 161 | 162 | ||
| 162 | 163 | public void pushExcludeIfData(final FileInfoContainer infoContainer, | |
| 163 | 164 | final String excludeIfCondition, final int stringIndex) { | |
| 164 | - Objects.requireNonNull(infoContainer, "File info is null"); | ||
| 165 | - Objects.requireNonNull(excludeIfCondition, "Condition is null"); | ||
| 165 | + requireNonNull(infoContainer, "File info is null"); | ||
| 166 | + requireNonNull(excludeIfCondition, "Condition is null"); | ||
| 166 | 167 | ||
| 167 | 168 | if (stringIndex < 0) { | |
| 168 | 169 | throw new IllegalArgumentException("Unexpected string index [" + stringIndex + ']'); | |
@@ -171,6 +172,9 @@ public void pushExcludeIfData(final FileInfoContainer infoContainer, | |||
| 171 | 172 | deferredExcludeStack.push(new ExcludeIfInfo(infoContainer, excludeIfCondition, stringIndex)); | |
| 172 | 173 | } | |
| 173 | 174 | ||
| 175 | + public ResettablePrinter getSelectedPrinter() { | ||
| 176 | + return this.selectedPrinter; | ||
| 177 | + } | ||
| 174 | 178 | ||
| 175 | 179 | public List<ExcludeIfInfo> popAllExcludeIfInfoData() { | |
| 176 | 180 | final List<ExcludeIfInfo> result = new ArrayList<>(deferredExcludeStack); | |
@@ -188,22 +192,29 @@ public Set<PreprocessingFlag> getPreprocessingFlags() { | |||
| 188 | 192 | return preprocessingFlags; | |
| 189 | 193 | } | |
| 190 | 194 | ||
| 191 | - | ||
| 192 | - public ResetablePrinter getPrinter() throws IOException { | ||
| 193 | - return currentPrinter; | ||
| 195 | + public ResettablePrinter findPrinter(final PrinterType type) { | ||
| 196 | + switch (requireNonNull(type, "Type is null")) { | ||
| 197 | + case NORMAL: | ||
| 198 | + return this.normalPrinter; | ||
| 199 | + case POSTFIX: | ||
| 200 | + return this.postfixPrinter; | ||
| 201 | + case PREFIX: | ||
| 202 | + return this.prefixPrinter; | ||
| 203 | + default: | ||
| 204 | + throw new IllegalArgumentException("Unsupported type detected [" + type.name() + ']'); | ||
| 205 | + } | ||
| 194 | 206 | } | |
| 195 | 207 | ||
| 196 | - public void setPrinter(final PrinterType type) { | ||
| 197 | - Objects.requireNonNull(type, "Type is null"); | ||
| 198 | - switch (type) { | ||
| 208 | + public void selectPrinter(final PrinterType type) { | ||
| 209 | + switch (requireNonNull(type, "Type is null")) { | ||
| 199 | 210 | case NORMAL: | |
| 200 | - currentPrinter = normalPrinter; | ||
| 211 | + this.selectedPrinter = this.normalPrinter; | ||
| 201 | 212 | break; | |
| 202 | 213 | case POSTFIX: | |
| 203 | - currentPrinter = postfixPrinter; | ||
| 214 | + this.selectedPrinter = this.postfixPrinter; | ||
| 204 | 215 | break; | |
| 205 | 216 | case PREFIX: | |
| 206 | - currentPrinter = prefixPrinter; | ||
| 217 | + this.selectedPrinter = this.prefixPrinter; | ||
| 207 | 218 | break; | |
| 208 | 219 | default: | |
| 209 | 220 | throw new IllegalArgumentException("Unsupported type detected [" + type.name() + ']'); | |
@@ -217,7 +228,7 @@ public TextFileDataContainer getRootTextContainer() { | |||
| 217 | 228 | ||
| 218 | 229 | ||
| 219 | 230 | public TextFileDataContainer openFile(final File file) throws IOException { | |
| 220 | - Objects.requireNonNull(file, "The file is null"); | ||
| 231 | + requireNonNull(file, "The file is null"); | ||
| 221 | 232 | ||
| 222 | 233 | final AtomicBoolean endedByNextLineContainer = new AtomicBoolean(); | |
| 223 | 234 | ||
@@ -276,7 +287,6 @@ public TextFileDataContainer popTextContainer() { | |||
| 276 | 287 | return this.includeStack.pop(); | |
| 277 | 288 | } | |
| 278 | 289 | ||
| 279 | - | ||
| 280 | 290 | public FileInfoContainer getRootFileInfo() { | |
| 281 | 291 | return rootFileInfo; | |
| 282 | 292 | } | |
@@ -422,15 +432,50 @@ private void init() { | |||
| 422 | 432 | preprocessingFlags.clear(); | |
| 423 | 433 | resetPrinters(); | |
| 424 | 434 | ||
| 425 | - setPrinter(PrinterType.NORMAL); | ||
| 435 | + selectPrinter(PrinterType.NORMAL); | ||
| 426 | 436 | } | |
| 427 | 437 | ||
| 428 | 438 | public void resetPrinters() { | |
| 429 | 439 | normalPrinter.reset(); | |
| 430 | 440 | prefixPrinter.reset(); | |
| 431 | 441 | postfixPrinter.reset(); | |
| 432 | 442 | ||
| 433 | - currentPrinter = normalPrinter; | ||
| 443 | + selectedPrinter = normalPrinter; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + public void setBufferText(final String text) { | ||
| 447 | + this.prefixPrinter.reset(); | ||
| 448 | + this.normalPrinter.reset(); | ||
| 449 | + this.postfixPrinter.reset(); | ||
| 450 | + this.setBufferText(text, PrinterType.NORMAL); | ||
| 451 | + } | ||
| 452 | + | ||
| 453 | + public void setBufferText(final String text, final PrinterType printerType) { | ||
| 454 | + switch (printerType) { | ||
| 455 | + case NORMAL: { | ||
| 456 | + this.normalPrinter.reset(); | ||
| 457 | + this.normalPrinter.print(requireNonNullElse(text, "")); | ||
| 458 | + } | ||
| 459 | + break; | ||
| 460 | + case PREFIX: { | ||
| 461 | + this.prefixPrinter.reset(); | ||
| 462 | + this.prefixPrinter.print(requireNonNullElse(text, "")); | ||
| 463 | + } | ||
| 464 | + break; | ||
| 465 | + case POSTFIX: { | ||
| 466 | + this.postfixPrinter.reset(); | ||
| 467 | + this.postfixPrinter.print(requireNonNullElse(text, "")); | ||
| 468 | + } | ||
| 469 | + break; | ||
| 470 | + default: | ||
| 471 | + throw new IllegalArgumentException("Unsupported printer type: " + printerType); | ||
| 472 | + } | ||
| 473 | + } | ||
| 474 | + | ||
| 475 | + public String getCurrentText() { | ||
| 476 | + return this.prefixPrinter.getText() | ||
| 477 | + + this.normalPrinter.getText() | ||
| 478 | + + this.postfixPrinter.getText(); | ||
| 434 | 479 | } | |
| 435 | 480 | ||
| 436 | 481 | public void saveBuffersToStreams(final OutputStream prefix, final OutputStream normal, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,11 +57,11 @@ public AfterDirectiveProcessingBehaviour execute(final String string, | |||
| 57 | 57 | if (!string.isEmpty()) { | |
| 58 | 58 | switch (string.charAt(0)) { | |
| 59 | 59 | case '+': { | |
| 60 | - state.setPrinter(PreprocessingState.PrinterType.POSTFIX); | ||
| 60 | + state.selectPrinter(PreprocessingState.PrinterType.POSTFIX); | ||
| 61 | 61 | } | |
| 62 | 62 | break; | |
| 63 | 63 | case '-': { | |
| 64 | - state.setPrinter(PreprocessingState.PrinterType.NORMAL); | ||
| 64 | + state.selectPrinter(PreprocessingState.PrinterType.NORMAL); | ||
| 65 | 65 | } | |
| 66 | 66 | break; | |
| 67 | 67 | default: { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,11 +57,11 @@ public AfterDirectiveProcessingBehaviour execute(final String string, | |||
| 57 | 57 | if (!string.isEmpty()) { | |
| 58 | 58 | switch (string.charAt(0)) { | |
| 59 | 59 | case '+': { | |
| 60 | - state.setPrinter(PreprocessingState.PrinterType.PREFIX); | ||
| 60 | + state.selectPrinter(PreprocessingState.PrinterType.PREFIX); | ||
| 61 | 61 | } | |
| 62 | 62 | break; | |
| 63 | 63 | case '-': { | |
| 64 | - state.setPrinter(PreprocessingState.PrinterType.NORMAL); | ||
| 64 | + state.selectPrinter(PreprocessingState.PrinterType.NORMAL); | ||
| 65 | 65 | } | |
| 66 | 66 | break; | |
| 67 | 67 | default: { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,9 @@ | |||
| 36 | 36 | */ | |
| 37 | 37 | public interface PreprocessorExtension extends ExecutionAllowable { | |
| 38 | 38 | ||
| 39 | + /** | ||
| 40 | + * Undefined arity. In case of functions it means to check only name. | ||
| 41 | + */ | ||
| 39 | 42 | int ANY_ARITY = -1; | |
| 40 | 43 | ||
| 41 | 44 | @Override | |
| Back | FazBrowse Home | New Git URL |
0 commit comments