aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-07-31 12:02:53 (EDT)
committerAlexander Kurtakov2013-07-31 12:10:06 (EDT)
commit58076fc211c0bc5830ecbc22e51c01904491eb5a (patch)
tree7c886e6f5a0228d8064f146cd85c7fcfec252d64
parentdc7c6fb9cdfd629467b1fe38e387668fff697cd7 (diff)
downloadorg.eclipse.linuxtools-58076fc211c0bc5830ecbc22e51c01904491eb5a.zip
org.eclipse.linuxtools-58076fc211c0bc5830ecbc22e51c01904491eb5a.tar.gz
org.eclipse.linuxtools-58076fc211c0bc5830ecbc22e51c01904491eb5a.tar.bz2
Systemtap: Initial clean up of sonar warningsrefs/changes/16/15016/5
* Remove commented out code and trailing whitespace Change-Id: I12e8c7c665acae276d4348e19ab5f1dc830be55d Reviewed-on: https://git.eclipse.org/r/15016 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> IP-Clean: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/IndentUtil.java95
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAlignment.java48
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAutoEditStrategy.java47
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterConstants.java374
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java310
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPHeuristicScanner.java1
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPIndenter.java62
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPScribe.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/Scanner.java34
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java62
10 files changed, 224 insertions, 847 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/IndentUtil.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/IndentUtil.java
index a3739ca..4d9951a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/IndentUtil.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/IndentUtil.java
@@ -27,7 +27,7 @@ import org.eclipse.jface.text.source.LineRange;
* Utility that indents a number of lines in a document.
*/
public final class IndentUtil {
-
+
private static final String SLASHES= "//"; //$NON-NLS-1$
/**
@@ -53,7 +53,7 @@ public final class IndentUtil {
return hasChanged;
}
}
-
+
private IndentUtil() {
// do not instantiate
}
@@ -62,7 +62,7 @@ public final class IndentUtil {
* Indents the line range specified by <code>lines</code> in
* <code>document</code>. The passed C project may be
* <code>null</code>, it is used solely to obtain formatter preferences.
- *
+ *
* @param document the document to be changed
* @param lines the line range to be indented
* @param project the C project to get the formatter preferences from, or
@@ -77,12 +77,12 @@ public final class IndentUtil {
*/
public static IndentResult indentLines(IDocument document, ILineRange lines, IProject project, IndentResult result) throws BadLocationException {
int numberOfLines= lines.getNumberOfLines();
-
+
if (numberOfLines < 1)
return new IndentResult(null);
-
+
result= reuseOrCreateToken(result, numberOfLines);
-
+
STPHeuristicScanner scanner= new STPHeuristicScanner(document);
STPIndenter indenter= new STPIndenter(document, scanner, project);
boolean changed= false;
@@ -92,7 +92,7 @@ public final class IndentUtil {
changed |= indentLine(document, line, indenter, scanner, result.commentLinesAtColumnZero, i++, tabSize, indentInsideLineComments);
}
result.hasChanged= changed;
-
+
return result;
}
@@ -111,10 +111,10 @@ public final class IndentUtil {
document.replace(offset, 0, indent);
}
}
-
+
/**
* Returns <code>true</code> if line comments at column 0 should be indented inside, <code>false</code> otherwise.
- *
+ *
* @param project the project to get project specific options from
* @return <code>true</code> if line comments at column 0 should be indented inside, <code>false</code> otherwise.
*/
@@ -125,14 +125,13 @@ public final class IndentUtil {
/**
* Returns the possibly <code>project</code>-specific core preference
* defined under <code>key</code>.
- *
+ *
* @param project the project to get the preference from, or
* <code>null</code> to get the global preference
* @param key the key of the preference
* @return the value of the preference
*/
private static String getCoreOption(IProject project, String key) {
-// return project.getOption(key, true);
return "true"; //$NON-NLS-1$ // for now, just return true
}
@@ -143,7 +142,7 @@ public final class IndentUtil {
* lines are adjusted accordingly. The passed C project may be
* <code>null</code>, it is used solely to obtain formatter
* preferences.
- *
+ *
* @param document the document to be changed
* @param lines the line range to be shifted
* @param project the C project to get the formatter preferences
@@ -160,32 +159,32 @@ public final class IndentUtil {
*/
public static IndentResult shiftLines(IDocument document, ILineRange lines, IProject project, IndentResult result) throws BadLocationException {
int numberOfLines= lines.getNumberOfLines();
-
+
if (numberOfLines < 1)
return new IndentResult(null);
-
+
result= reuseOrCreateToken(result, numberOfLines);
result.hasChanged= false;
-
+
STPHeuristicScanner scanner= new STPHeuristicScanner(document);
STPIndenter indenter= new STPIndenter(document, scanner, project);
-
+
boolean indentInsideLineComments= indentInsideLineComments(project);
String current= getCurrentIndent(document, lines.getStartLine(), indentInsideLineComments);
StringBuilder correct= new StringBuilder(computeIndent(document, lines.getStartLine(), indenter, scanner));
-
+
int tabSize= CodeFormatterUtil.getTabWidth(project);
StringBuilder addition= new StringBuilder();
int difference= subtractIndent(correct, current, addition, tabSize);
-
+
if (difference == 0)
return result;
-
+
if (result.leftmostLine == -1)
result.leftmostLine= getLeftMostLine(document, lines, tabSize, indentInsideLineComments);
-
+
int maxReduction= computeVisualLength(getCurrentIndent(document, result.leftmostLine + lines.getStartLine(), indentInsideLineComments), tabSize);
-
+
if (difference > 0) {
for (int line= lines.getStartLine(), last= line + numberOfLines, i= 0; line < last; line++)
addIndent(document, line, addition, result.commentLinesAtColumnZero, i++, indentInsideLineComments);
@@ -194,11 +193,11 @@ public final class IndentUtil {
for (int line= lines.getStartLine(), last= line + numberOfLines, i= 0; line < last; line++)
cutIndent(document, line, reduction, tabSize, result.commentLinesAtColumnZero, i++, indentInsideLineComments);
}
-
+
result.hasChanged= true;
-
+
return result;
-
+
}
/**
@@ -269,7 +268,7 @@ public final class IndentUtil {
while (from < endOffset - 2 && document.get(from, 2).equals(SLASHES))
from += 2;
}
-
+
int to= from;
while (toDelete > 0 && to < endOffset) {
char ch= document.getChar(to);
@@ -281,7 +280,7 @@ public final class IndentUtil {
else
break;
}
-
+
if (endOffset > to + 1 && document.get(to, 2).equals(SLASHES))
commentLines[relative]= true;
@@ -369,7 +368,7 @@ public final class IndentUtil {
while (to < endOffset - 2 && document.get(to, 2).equals(SLASHES))
to += 2;
}
-
+
while (to < endOffset) {
char ch= document.getChar(to);
if (!Character.isWhitespace(ch))
@@ -379,7 +378,7 @@ public final class IndentUtil {
return document.get(from, to - from);
}
-
+
private static int getLeftMostLine(IDocument document, ILineRange lines, int tabSize, boolean indentInsideLineComments) throws BadLocationException {
int numberOfLines= lines.getNumberOfLines();
int first= lines.getStartLine();
@@ -407,11 +406,11 @@ public final class IndentUtil {
}
return token;
}
-
+
/**
* Indents a single line using the heuristic scanner. Multiline comments are
* indented as specified by the <code>CCommentAutoIndentStrategy</code>.
- *
+ *
* @param document the document
* @param line the line to be indented
* @param indenter the C indenter
@@ -430,7 +429,7 @@ public final class IndentUtil {
IRegion currentLine= document.getLineInformation(line);
final int offset= currentLine.getOffset();
int wsStart= offset; // where we start searching for non-WS; after the "//" in single line comments
-
+
String indent= null;
if (offset < document.getLength()) {
ITypedRegion partition= TextUtilities.getPartition(document, STPPartitionScanner.STP_PARTITIONING, offset, true);
@@ -444,7 +443,7 @@ public final class IndentUtil {
return false;
}
}
-
+
// standard C code indentation
if (indent == null) {
StringBuilder computed= indenter.computeIndentation(offset);
@@ -453,7 +452,7 @@ public final class IndentUtil {
else
indent= ""; //$NON-NLS-1$
}
-
+
// change document:
// get current white space
int lineLength= currentLine.getLength();
@@ -462,7 +461,7 @@ public final class IndentUtil {
end= offset + lineLength;
int length= end - offset;
String currentIndent= document.get(offset, length);
-
+
// memorize the fact that a line is a single line comment (but not at column 0) and should be treated like code
// as opposed to commented out code, which should keep its slashes at column 0
// if 'indentInsideLineComments' is false, all comment lines are indented with the code
@@ -472,19 +471,19 @@ public final class IndentUtil {
commentLines[lineIndex]= true;
}
}
-
+
// only change the document if it is a real change
if (!indent.equals(currentIndent)) {
document.replace(offset, length, indent);
return true;
}
-
+
return false;
}
/**
* Computes and returns the indentation for a source line.
- *
+ *
* @param document the document
* @param line the line in document
* @param indenter the C indenter
@@ -495,7 +494,7 @@ public final class IndentUtil {
public static String computeIndent(IDocument document, int line, STPIndenter indenter, STPHeuristicScanner scanner) throws BadLocationException {
IRegion currentLine= document.getLineInformation(line);
final int offset= currentLine.getOffset();
-
+
String indent= null;
if (offset < document.getLength()) {
ITypedRegion partition= TextUtilities.getPartition(document, STPPartitionScanner.STP_PARTITIONING, offset, true);
@@ -507,7 +506,7 @@ public final class IndentUtil {
indent= computePreprocessorIndent(document, line, startingPartition);
}
}
-
+
// standard C code indentation
if (indent == null) {
StringBuilder computed= indenter.computeIndentation(offset);
@@ -518,10 +517,10 @@ public final class IndentUtil {
}
return indent;
}
-
+
/**
* Computes and returns the indentation for a block comment line.
- *
+ *
* @param document the document
* @param line the line in document
* @param scanner the scanner
@@ -532,7 +531,7 @@ public final class IndentUtil {
public static String computeCommentIndent(IDocument document, int line, STPHeuristicScanner scanner, ITypedRegion partition) throws BadLocationException {
if (line == 0) // impossible - the first line is never inside a comment
return null;
-
+
// don't make any assumptions if the line does not start with \s*\* - it might be
// commented out code, for which we don't want to change the indent
final IRegion lineInfo= document.getLineInformation(line);
@@ -545,13 +544,13 @@ public final class IndentUtil {
return document.get(lineStart, lineLength);
return document.get(lineStart, nonWS - lineStart);
}
-
+
// take the indent from the previous line and reuse
IRegion previousLine= document.getLineInformation(line - 1);
int previousLineStart= previousLine.getOffset();
int previousLineLength= previousLine.getLength();
int previousLineEnd= previousLineStart + previousLineLength;
-
+
StringBuilder buf= new StringBuilder();
int previousLineNonWS= scanner.findNonWhitespaceForwardInAnyPartition(previousLineStart, previousLineEnd);
if (previousLineNonWS == STPHeuristicScanner.NOT_FOUND || document.getChar(previousLineNonWS) != '*') {
@@ -563,12 +562,12 @@ public final class IndentUtil {
previousLineNonWS= scanner.findNonWhitespaceForwardInAnyPartition(previousLineStart, previousLineEnd);
if (previousLineNonWS == STPHeuristicScanner.NOT_FOUND)
previousLineNonWS= previousLineEnd;
-
+
// add the initial space
// TODO this may be controlled by a formatter preference in the future
buf.append(' ');
}
-
+
String indentation= document.get(previousLineStart, previousLineNonWS - previousLineStart);
buf.insert(0, indentation);
return buf.toString();
@@ -576,7 +575,7 @@ public final class IndentUtil {
/**
* Computes and returns the indentation for a preprocessor line.
- *
+ *
* @param document the document
* @param line the line in document
* @param partition the comment partition
@@ -603,7 +602,7 @@ public final class IndentUtil {
int previousLineStart= previousLine.getOffset();
int previousLineLength= previousLine.getLength();
int previousLineEnd= previousLineStart + previousLineLength;
-
+
int previousLineNonWS= ppScanner.findNonWhitespaceForwardInAnyPartition(previousLineStart, previousLineEnd);
String previousIndent= document.get(previousLineStart, previousLineNonWS - previousLineStart);
computed= new StringBuilder(previousIndent);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAlignment.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAlignment.java
index 8289b77..8ab058b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAlignment.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAlignment.java
@@ -15,7 +15,7 @@ import java.util.Arrays;
/**
* Alignment management
- *
+ *
* @since 4.0
*/
public class STPAlignment {
@@ -40,16 +40,16 @@ public class STPAlignment {
/** Link to the enclosing alignment. */
public STPAlignment enclosing;
-
+
/** Start location of this alignment. */
public STPLocation location;
/**
* Tail formatter is an encapsulation mechanism for formatting of the trailing text that should
- * be kept together with the last element of a list.
+ * be kept together with the last element of a list.
*/
public Runnable tailFormatter;
-
+
// Indentation management
public int fragmentIndex;
public int fragmentCount;
@@ -69,7 +69,7 @@ public class STPAlignment {
public int currentFragmentStartLine;
public final STPScribe scribe;
-
+
/*
* Alignment modes
*/
@@ -78,7 +78,7 @@ public class STPAlignment {
public static final int M_INDENT_BY_ONE = 4; // if bit set, broken fragments will be indented one level below current (not using continuation indentation)
// Split modes can be combined either with M_FORCE or M_INDENT_ON_COLUMN
-
+
/** foobar(#fragment1, #fragment2, <ul>
* <li> #fragment3, #fragment4 </li>
* </ul>
@@ -121,7 +121,7 @@ public class STPAlignment {
//64+32
//64+32+16
-
+
// Mode controlling column alignments
/**
* <table BORDER COLS=4 WIDTH="100%" >
@@ -131,23 +131,23 @@ public class STPAlignment {
* </table>
*/
public static final int M_MULTICOLUMN = 256; // fragments are on same line, but multiple line of fragments will be aligned vertically
-
+
public static final int M_NO_ALIGNMENT = 0;
-
+
public int mode;
-
+
public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT;
// Alignment tie-break rules - when split is needed, will decide whether innermost/outermost alignment is to be chosen
public static final int R_OUTERMOST = 1;
public static final int R_INNERMOST = 2;
public int tieBreakRule;
-
+
// Alignment effects on a per fragment basis
public static final int BREAK_NOT_ALLOWED = -1;
public static final int NONE = 0;
public static final int BREAK = 2;
-
+
// Chunk kind
public static final int CHUNK_FIELD = 1;
public static final int CHUNK_METHOD = 2;
@@ -174,7 +174,7 @@ public class STPAlignment {
if (currentColumn == 1) {
currentColumn = this.location.outputIndentationLevel + 1;
}
-
+
// Initialize the break indentation level, using modes and continuationIndentationLevel
// preference.
final int indentSize = this.scribe.indentationSize;
@@ -206,11 +206,11 @@ public class STPAlignment {
couldBreak();
}
}
-
+
public boolean checkChunkStart(int kind, int startIndex, int sourceRestart) {
if (this.chunkKind != kind) {
this.chunkKind = kind;
-
+
// When redoing same chunk alignment, must not reset
if (startIndex != this.chunkStartIndex) {
this.chunkStartIndex = startIndex;
@@ -237,10 +237,6 @@ public class STPAlignment {
}
// Backtrack only once all fragments got checked
if (this.needRedoColumnAlignment && this.fragmentIndex == this.fragmentCount - 1) { // alignment too small
-// if (CodeFormatterVisitor.DEBUG) {
-// System.out.println("ALIGNMENT TOO SMALL");
-// System.out.println(this);
-// }
this.needRedoColumnAlignment = false;
int relativeDepth = 0;
STPAlignment targetAlignment = this.scribe.memberAlignment;
@@ -254,7 +250,7 @@ public class STPAlignment {
}
}
}
-
+
public boolean couldBreak() {
int i;
switch (mode & SPLIT_MASK) {
@@ -308,7 +304,7 @@ public class STPAlignment {
this.fragmentIndentations[i] = this.breakIndentationLevel;
return wasSplit = true;
}
- } while ((this.fragmentBreaks[i] != BREAK || (this.mode & M_INDENT_ON_COLUMN) != 0) && --i >= 0);
+ } while ((this.fragmentBreaks[i] != BREAK || (this.mode & M_INDENT_ON_COLUMN) != 0) && --i >= 0);
break;
/* # aligned fragment
@@ -329,7 +325,7 @@ public class STPAlignment {
return wasSplit = true;
}
break;
-
+
/* # aligned fragment
* foo(
* #AAAAA,
@@ -384,11 +380,11 @@ public class STPAlignment {
}
}
}
-
+
public STPAlignment getAlignment(String targetName) {
if (targetName.equals(this.name)) return this;
if (this.enclosing == null) return null;
-
+
return this.enclosing.getAlignment(targetName);
}
@@ -463,7 +459,7 @@ public class STPAlignment {
public void toFragmentsString(StringBuffer buffer) {
// default implementation
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer(10);
@@ -496,7 +492,7 @@ public class STPAlignment {
buffer.append('\n');
return buffer.toString();
}
-
+
public void update() {
for (int i = 1; i < this.fragmentCount; i++) {
if (this.fragmentBreaks[i] == BREAK) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAutoEditStrategy.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAutoEditStrategy.java
index a5bb1ac..b51d1bd 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAutoEditStrategy.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPAutoEditStrategy.java
@@ -36,12 +36,12 @@ public class STPAutoEditStrategy extends
private String fPartitioning;
private IProject fProject;
-
+
public STPAutoEditStrategy(String fPartitioning, IProject project) {
this.fPartitioning = fPartitioning;
this.fProject = project;
}
-
+
/**
* Returns the block balance, i.e. zero if the blocks are balanced at
* <code>offset</code>, a negative number if there are more closing than opening
@@ -74,12 +74,12 @@ public class STPAutoEditStrategy extends
return 1;
}
}
-
+
@Override
public void customizeDocumentCommand(IDocument document,
DocumentCommand command) {
boolean modified = false;
- boolean isNewLine= command.length == 0 && command.text != null
+ boolean isNewLine= command.length == 0 && command.text != null
&& isLineDelimiter(document, command.text);
if (isNewLine) {
smartIndentAfterNewLine(document, command);
@@ -107,7 +107,7 @@ public class STPAutoEditStrategy extends
super.customizeDocumentCommand(document, command);
}
-
+
private boolean inStringOrComment(IDocument d, DocumentCommand c) {
int docLength = d.getLength();
if (c.offset == -1 || docLength == 0)
@@ -115,7 +115,7 @@ public class STPAutoEditStrategy extends
try {
ITypedRegion partition= TextUtilities.getPartition(d, fPartitioning, c.offset, false);
String partitionType = partition.getType();
- if (c.offset > 0 &&
+ if (c.offset > 0 &&
(STPPartitionScanner.STP_COMMENT.equals(partitionType)
|| STPPartitionScanner.STP_MULTILINE_COMMENT.equals(partitionType)
|| STPPartitionScanner.STP_STRING.equals(partitionType))) {
@@ -165,14 +165,14 @@ public class STPAutoEditStrategy extends
}
}
return inString || inChar || inComment;
-
+
} catch (BadLocationException e) {
IDEPlugin.log(e);
}
- return false;
+ return false;
}
-
+
private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
int docLength = d.getLength();
if (c.offset == -1 || docLength == 0)
@@ -397,7 +397,7 @@ public class STPAutoEditStrategy extends
return -1;
}
-
+
/**
* Finds a closing parenthesis to the left of <code>position</code> in document, where that parenthesis is only
* separated by whitespace from <code>position</code>. If no such parenthesis can be found, <code>position</code> is returned.
@@ -414,7 +414,7 @@ public class STPAutoEditStrategy extends
return scanner.getPosition() + 1;
return position;
}
-
+
private boolean isClosedBrace(IDocument document, int offset, int length) {
return getBlockBalance(document, offset, fPartitioning) <= 0;
}
@@ -430,9 +430,6 @@ public class STPAutoEditStrategy extends
case 'e':
smartIndentUponE(document, command);
break;
-// case ':':
-// smartIndentAfterColumn(document, command);
-// break;
case '#':
smartIndentAfterHash(document, command);
break;
@@ -452,7 +449,7 @@ public class STPAutoEditStrategy extends
* A closing char (e.g. right paren ')') is being inserted. If one already exists
* at current location in the document, skip over it and don't do an
* insert.
- *
+ *
* @param d - document
* @param c - insert text
* @param ch - closing char being inserted
@@ -496,7 +493,7 @@ public class STPAutoEditStrategy extends
IDEPlugin.log(e);
}
}
-
+
private void smartIndentAfterOpeningBracket(IDocument d, DocumentCommand c) {
if (c.offset < 1 || d.getLength() == 0)
return;
@@ -538,14 +535,14 @@ public class STPAutoEditStrategy extends
IDEPlugin.log(e);
}
}
-
+
private boolean isLineDelimiter(IDocument document, String text) {
String[] delimiters = document.getLegalLineDelimiters();
if (delimiters != null)
return TextUtilities.equals(delimiters, text) > -1;
return false;
}
-
+
private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
int bracketcount = 0;
while (start < end) {
@@ -598,8 +595,8 @@ public class STPAutoEditStrategy extends
}
return bracketcount;
}
-
-
+
+
// ----------- bracket counting ------------------------------------------------------
private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
@@ -624,7 +621,7 @@ public class STPAutoEditStrategy extends
}
return ""; //$NON-NLS-1$
}
-
+
private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
while (pos < end) {
char curr = d.getChar(pos);
@@ -684,7 +681,7 @@ public class STPAutoEditStrategy extends
*/
private static void installPartitioner(Document document) {
String[] types= new String[] {
- IDocument.DEFAULT_CONTENT_TYPE,
+ IDocument.DEFAULT_CONTENT_TYPE,
STPPartitionScanner.STP_COMMENT,
STPPartitionScanner.STP_CONDITIONAL,
};
@@ -701,7 +698,7 @@ public class STPAutoEditStrategy extends
private static void removePartitioner(Document document) {
document.setDocumentPartitioner(STPPartitionScanner.STP_PARTITIONING, null);
}
-
+
private void smartPaste(IDocument document, DocumentCommand command) {
int newOffset= command.offset;
int newLength= command.length;
@@ -1011,7 +1008,7 @@ public class STPAutoEditStrategy extends
return firstPeer;
firstPeer= peer;
break; // keep searching
-
+
case STPSymbols.TokenCASE:
case STPSymbols.TokenDEFAULT:
{
@@ -1034,7 +1031,7 @@ public class STPAutoEditStrategy extends
firstPeer= peer;
}
break; // keep searching
-
+
case STPSymbols.TokenEOF:
return firstPeer;
default:
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterConstants.java
index 830088d..93b52cf 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterConstants.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterConstants.java
@@ -20,7 +20,7 @@ import org.eclipse.linuxtools.internal.systemtap.ui.ide.IDEPlugin;
/**
* Constants used to set up the options of the code formatter.
- *
+ *
* @since 4.0
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -31,7 +31,7 @@ public class STPDefaultCodeFormatterConstants {
* <pre>
* FORMATTER / Option for the language
* - option id: "org.eclipse.cdt.core.formatter.language"
- * - possible values: object of class <code>ILanguage</code> or <code>null</code>
+ * - possible values: object of class <code>ILanguage</code> or <code>null</code>
* - default: null
* </pre>
*/
@@ -41,7 +41,7 @@ public class STPDefaultCodeFormatterConstants {
* <pre>
* FORMATTER / Option for the current file
* - option id: "org.eclipse.cdt.core.formatter.current_file"
- * - possible values: object of class <code>IFile</code> or <code>null</code>
+ * - possible values: object of class <code>IFile</code> or <code>null</code>
* - default: null
* </pre>
*/
@@ -51,7 +51,7 @@ public class STPDefaultCodeFormatterConstants {
* <pre>
* FORMATTER / Option for the translation unit
* - option id: "org.eclipse.cdt.core.formatter.current_translation_unit"
- * - possible values: object of class <code>ITranslationUnit</code> or <code>null</code>
+ * - possible values: object of class <code>ITranslationUnit</code> or <code>null</code>
* - default: null
* </pre>
*/
@@ -75,29 +75,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
*/
public static final String FALSE = "false"; //$NON-NLS-1$
-
-// /**
-// * <pre>
-// * FORMATTER / Option to align type members of a type declaration on column
-// * - option id: "org.eclipse.cdt.core.formatter.formatter.align_type_members_on_columns"
-// * - possible values: { TRUE, FALSE }
-// * - default: FALSE
-// * </pre>
-// * @see #TRUE
-// * @see #FALSE
-// */
-// public static final String FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS = IDEPlugin.PLUGIN_ID + ".formatter.align_type_members_on_columns"; //$NON-NLS-1$
-//
-// /**
-// * <pre>
-// * FORMATTER / Option for alignment of arguments in allocation expression
-// * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_allocation_expression"
-// * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
-// * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
-// * </pre>
-// * @see #createAlignmentValue(boolean, int, int)
-// */
-// public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_allocation_expression"; //$NON-NLS-1$
+
/**
* <pre>
* FORMATTER / Option for alignment of arguments in method invocation
@@ -170,7 +148,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
* @see #createAlignmentValue(boolean, int, int)
*/
- public static final String FORMATTER_ALIGNMENT_FOR_DECLARATOR_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_declarator_list"; //$NON-NLS-1$
+ public static final String FORMATTER_ALIGNMENT_FOR_DECLARATOR_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_declarator_list"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option for alignment of a enumerator list
@@ -180,7 +158,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
* @see #createAlignmentValue(boolean, int, int)
*/
- public static final String FORMATTER_ALIGNMENT_FOR_ENUMERATOR_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_enumerator_list"; //$NON-NLS-1$
+ public static final String FORMATTER_ALIGNMENT_FOR_ENUMERATOR_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_enumerator_list"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option for alignment of a expression list (except arguments in a method invocation)
@@ -190,7 +168,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
* @see #createAlignmentValue(boolean, int, int)
*/
- public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSION_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_expression_list"; //$NON-NLS-1$
+ public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSION_LIST = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_expression_list"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option for alignment of expressions in initializer list
@@ -234,16 +212,6 @@ public class STPDefaultCodeFormatterConstants {
* @see #createAlignmentValue(boolean, int, int)
*/
public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_method_declaration"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option for alignment of selector in method invocation
-// * - option id: "org.eclipse.cdt.core.formatter.alignment_for_selector_in_method_invocation"
-// * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
-// * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
-// * </pre>
-// * @see #createAlignmentValue(boolean, int, int)
-// */
-// public static final String FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_selector_in_method_invocation"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option for alignment of base-clause in type declaration
@@ -275,87 +243,6 @@ public class STPDefaultCodeFormatterConstants {
* @see #createAlignmentValue(boolean, int, int)
*/
public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_method_declaration"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines after #include directive
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_after_includes"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_AFTER_INCLUDES = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_after_includes"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines at the beginning of the method body
-// * - option id: "org.eclipse.cdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY = IDEPlugin.PLUGIN_ID + ".formatter.number_of_blank_lines_at_beginning_of_method_body"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before a field declaration
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_field"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_field"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before the first class body declaration
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_first_class_body_declaration"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_first_class_body_declaration"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before #include directive
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_includes"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_INCLUDES = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_includes"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before a member type declaration
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_member_type"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before a method declaration
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_method"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_method"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines before a new chunk
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_new_chunk"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to add blank lines between type declarations
-// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_between_type_declarations"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "0"
-// * </pre>
-// */
-// public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = IDEPlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to position the braces of initializer list
@@ -396,19 +283,6 @@ public class STPDefaultCodeFormatterConstants {
* @see #NEXT_LINE_ON_WRAP
*/
public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = IDEPlugin.PLUGIN_ID + ".formatter.brace_position_for_block_in_case"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to position the braces of an enum declaration
-// * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_enum_declaration"
-// * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
-// * - default: END_OF_LINE
-// * </pre>
-// * @see #END_OF_LINE
-// * @see #NEXT_LINE
-// * @see #NEXT_LINE_SHIFTED
-// * @see #NEXT_LINE_ON_WRAP
-// */
-// public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to position the braces of a method declaration
@@ -461,64 +335,6 @@ public class STPDefaultCodeFormatterConstants {
* @see #NEXT_LINE_ON_WRAP
*/
public static final String FORMATTER_BRACE_POSITION_FOR_NAMESPACE_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.brace_position_for_namespace_declaration"; //$NON-NLS-1$
-
-// /**
-// * <pre>
-// * FORMATTER / Option to control whether blank lines are cleared inside comments
-// * - option id: "org.eclipse.cdt.core.formatter.comment.clear_blank_lines"
-// * - possible values: { TRUE, FALSE }
-// * - default: FALSE
-// * </pre>
-// * @see #TRUE
-// * @see #FALSE
-// */
-// public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = IDEPlugin.PLUGIN_ID + ".formatter.comment.clear_blank_lines"; //$NON-NLS-1$
-//
-// /**
-// * <pre>
-// * FORMATTER / Option to control whether comments are formatted
-// * - option id: "org.eclipse.cdt.core.formatter.comment.format_comments"
-// * - possible values: { TRUE, FALSE }
-// * - default: TRUE
-// * </pre>
-// * @see #TRUE
-// * @see #FALSE
-// */
-// public final static String FORMATTER_COMMENT_FORMAT = IDEPlugin.PLUGIN_ID + ".formatter.comment.format_comments"; //$NON-NLS-1$
-//
-// /**
-// * <pre>
-// * FORMATTER / Option to control whether the header comment of a C/C++ source file is formatted
-// * - option id: "org.eclipse.cdt.core.formatter.comment.format_header"
-// * - possible values: { TRUE, FALSE }
-// * - default: FALSE
-// * </pre>
-// * @see #TRUE
-// * @see #FALSE
-// */
-// public final static String FORMATTER_COMMENT_FORMAT_HEADER = IDEPlugin.PLUGIN_ID + ".formatter.comment.format_header"; //$NON-NLS-1$
-//
-// /**
-// * <pre>
-// * FORMATTER / Option to control whether code snippets are formatted in comments
-// * - option id: "org.eclipse.cdt.core.formatter.comment.format_source_code"
-// * - possible values: { TRUE, FALSE }
-// * - default: TRUE
-// * </pre>
-// * @see #TRUE
-// * @see #FALSE
-// */
-// public final static String FORMATTER_COMMENT_FORMAT_SOURCE = IDEPlugin.PLUGIN_ID + ".formatter.comment.format_source_code"; //$NON-NLS-1$
-//
-// /**
-// * <pre>
-// * FORMATTER / Option to specify the line length for comments.
-// * - option id: "org.eclipse.cdt.core.formatter.comment.line_length"
-// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
-// * - default: "80"
-// * </pre>
-// */
-// public final static String FORMATTER_COMMENT_LINE_LENGTH = IDEPlugin.PLUGIN_ID + ".formatter.comment.line_length"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to specify the minimum distance between code and line comment.
@@ -527,7 +343,7 @@ public class STPDefaultCodeFormatterConstants {
* - default: "1"
* </pre>
* @since 5.3
- */
+ */
public final static String FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT = IDEPlugin.PLUGIN_ID + ".formatter.comment.min_distance_between_code_and_line_comment"; //$NON-NLS-1$
/**
@@ -545,7 +361,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* <pre>
- * FORMATTER / Option to control whether comments starting from the beginning of line should stay that way and never be indented.
+ * FORMATTER / Option to control whether comments starting from the beginning of line should stay that way and never be indented.
* - option id: "org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column"
* - possible values: { TRUE, FALSE }
* - default: TRUE
@@ -662,7 +478,7 @@ public class STPDefaultCodeFormatterConstants {
* @see #TRUE
* @see #FALSE
*/
- public static final String FORMATTER_INDENT_EMPTY_LINES = IDEPlugin.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$
+ public static final String FORMATTER_INDENT_EMPTY_LINES = IDEPlugin.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to indent inside line comments at column 0
@@ -673,7 +489,7 @@ public class STPDefaultCodeFormatterConstants {
* @see #TRUE
* @see #FALSE
*/
- public static final String FORMATTER_INDENT_INSIDE_LINE_COMMENTS = IDEPlugin.PLUGIN_ID + ".formatter.indent_inside_line_comments"; //$NON-NLS-1$
+ public static final String FORMATTER_INDENT_INSIDE_LINE_COMMENTS = IDEPlugin.PLUGIN_ID + ".formatter.indent_inside_line_comments"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to indent statements inside a block
@@ -720,7 +536,7 @@ public class STPDefaultCodeFormatterConstants {
public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = IDEPlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_switch"; //$NON-NLS-1$
/**
* <pre>
- * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation
* - option id: "org.eclipse.cdt.core.formatter.indentation.size"
* - possible values: "&lt;n&gt;", where n is zero or a positive integer
* - default: "4"
@@ -841,39 +657,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = IDEPlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a new line in an empty enum declaration
-// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_declaration"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_declaration"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a new line in an empty method body
-// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_method_body"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = IDEPlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_method_body"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a new line in an empty type declaration
-// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_type_declaration"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = IDEPlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_type_declaration"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space after an assignment operator
@@ -1006,28 +789,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_declarations"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space after the comma in the increments of a for statement
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_increments"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_increments"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space after the comma in the initializations of a for statement
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_inits"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_inits"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space after the comma in the parameters of a method declaration
@@ -1116,17 +877,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_template_parameters"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space after ellipsis
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_ellipsis"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_after_ellipsis"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space after the opening angle bracket in template arguments
@@ -1569,17 +1319,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_labeled_statement"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space before comma in an allocation expression
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_allocation_expression"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: DO_NOT_INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_allocation_expression"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space before comma in an initializer list
@@ -1602,28 +1341,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_declarations"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space before comma in the increments of a for statement
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_increments"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: DO_NOT_INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_increments"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space before comma in the initializations of a for statement
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_inits"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: DO_NOT_INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_inits"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space before comma in the parameters of a method declaration
@@ -1712,17 +1429,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_template_parameters"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space before ellipsis
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_ellipsis"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: DO_NOT_INSERT
-// * </pre>
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_ellipsis"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space before the opening angle bracket in template arguments
@@ -1922,18 +1628,6 @@ public class STPDefaultCodeFormatterConstants {
* @see IDEPlugin#DO_NOT_INSERT
*/
public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_while"; //$NON-NLS-1$
-// /**
-// * <pre>
-// * FORMATTER / Option to insert a space before parenthesized expression in return statement
-// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
-// * - possible values: { INSERT, DO_NOT_INSERT }
-// * - default: INSERT
-// * </pre>
-// *
-// * @see IDEPlugin#INSERT
-// * @see IDEPlugin#DO_NOT_INSERT
-// */
-// public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN = IDEPlugin.PLUGIN_ID + ".formatter.insert_space_before_parenthesized_expression_in_return"; //$NON-NLS-1$
/**
* <pre>
* FORMATTER / Option to insert a space before a postfix operator
@@ -2159,7 +1853,7 @@ public class STPDefaultCodeFormatterConstants {
* - default: TAB
* </pre>
* More values may be added in the future.
- *
+ *
* @see IDEPlugin#TAB
* @see IDEPlugin#SPACE
* @see #MIXED
@@ -2167,7 +1861,7 @@ public class STPDefaultCodeFormatterConstants {
public static final String FORMATTER_TAB_CHAR = IDEPlugin.PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$
/**
* <pre>
- * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation
* - option id: "org.eclipse.cdt.core.formatter.tabulation.size"
* - possible values: "&lt;n&gt;", where n is zero or a positive integer
* - default: "4"
@@ -2177,7 +1871,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* <pre>
- * FORMATTER / Option to use tabulations only for leading indentations
+ * FORMATTER / Option to use tabulations only for leading indentations
* - option id: "org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations"
* - possible values: { TRUE, FALSE }
* - default: FALSE
@@ -2193,7 +1887,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
*/
public static final int INDENT_BY_ONE= 2;
-
+
/**
* <pre>
* FORMATTER / The wrapping is done by using the current indentation.
@@ -2206,7 +1900,7 @@ public class STPDefaultCodeFormatterConstants {
* </pre>
*/
public static final int INDENT_ON_COLUMN = 1;
-
+
/**
* <pre>
* FORMATTER / Possible value for the option FORMATTER_TAB_CHAR
@@ -2307,15 +2001,15 @@ public class STPDefaultCodeFormatterConstants {
/**
* Create a new alignment value according to the given values. This must be used to set up
* the alignment options.
- *
+ *
* @param forceSplit the given force value
* @param wrapStyle the given wrapping style
* @param indentStyle the given indent style
- *
+ *
* @return the new alignment value
*/
public static String createAlignmentValue(boolean forceSplit, int wrapStyle, int indentStyle) {
- int alignmentValue = 0;
+ int alignmentValue = 0;
switch (wrapStyle) {
case WRAP_COMPACT:
alignmentValue |= STPAlignment.M_COMPACT_SPLIT;
@@ -2332,7 +2026,7 @@ public class STPDefaultCodeFormatterConstants {
case WRAP_ONE_PER_LINE:
alignmentValue |= STPAlignment.M_ONE_PER_LINE_SPLIT;
break;
- }
+ }
if (forceSplit) {
alignmentValue |= STPAlignment.M_FORCE;
}
@@ -2348,7 +2042,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* Returns the default formatter settings
- *
+ *
* @return the default settings
*/
public static Map<String,String> getDefaultSettings() {
@@ -2357,7 +2051,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* Returns the K&R formatter settings
- *
+ *
* @return the K&R settings
*/
public static Map<String,String> getKandRSettings() {
@@ -2366,7 +2060,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* Returns the Allman formatter settings
- *
+ *
* @return the Allman settings
*/
public static Map<String,String> getAllmanSettings() {
@@ -2375,7 +2069,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* Returns the GNU formatter settings
- *
+ *
* @return the GNU settings
*/
public static Map<String,String> getGNUSettings() {
@@ -2384,7 +2078,7 @@ public class STPDefaultCodeFormatterConstants {
/**
* Returns the Whitesmiths formatter settings
- *
+ *
* @return the Whitesmiths settings
*/
public static Map<String,String> getWhitesmithsSettings() {
@@ -2400,7 +2094,7 @@ public class STPDefaultCodeFormatterConstants {
* @param value the given alignment value
* @return the force value of the given alignment value
* @see #createAlignmentValue(boolean, int, int)
- * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
* doesn't have a valid format.
*/
public static boolean getForceWrapping(String value) {
@@ -2414,7 +2108,7 @@ public class STPDefaultCodeFormatterConstants {
throw WRONG_ARGUMENT;
}
}
-
+
/**
* <p>Return the indentation style of the given alignment value.
* The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
@@ -2424,7 +2118,7 @@ public class STPDefaultCodeFormatterConstants {
* @param value the given alignment value
* @return the indentation style of the given alignment value
* @see #createAlignmentValue(boolean, int, int)
- * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
* doesn't have a valid format.
*/
public static int getIndentStyle(String value) {
@@ -2454,7 +2148,7 @@ public class STPDefaultCodeFormatterConstants {
* @param value the given alignment value
* @return the wrapping style of the given alignment value
* @see #createAlignmentValue(boolean, int, int)
- * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
* doesn't have a valid format.
*/
public static int getWrappingStyle(String value) {
@@ -2491,7 +2185,7 @@ public class STPDefaultCodeFormatterConstants {
* @param force the given force value
* @return the new alignment value
* @see #createAlignmentValue(boolean, int, int)
- * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
* doesn't have a valid format.
*/
public static String setForceWrapping(String value, boolean force) {
@@ -2508,9 +2202,9 @@ public class STPDefaultCodeFormatterConstants {
return String.valueOf(existingValue);
} catch (NumberFormatException e) {
throw WRONG_ARGUMENT;
- }
+ }
}
-
+
/**
* <p>Set the indentation style of the given alignment value and return the new value.
* The given value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
index 745a95e..2120bf0 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
@@ -20,7 +20,7 @@ import org.eclipse.linuxtools.internal.systemtap.ui.ide.IDEPlugin;
/**
* Code formatter options.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @since 5.4
*/
@@ -76,37 +76,18 @@ public class STPDefaultCodeFormatterOptions {
public int alignment_for_throws_clause_in_method_declaration;
public int alignment_for_constructor_initializer_list;
-// public boolean align_type_members_on_columns;
-
public String brace_position_for_block;
public String brace_position_for_block_in_case;
-// public String brace_position_for_enum_declaration;
public String brace_position_for_initializer_list;
public String brace_position_for_method_declaration;
public String brace_position_for_namespace_declaration;
public String brace_position_for_switch;
public String brace_position_for_type_declaration;
-// public int blank_lines_after_includes;
-// public int blank_lines_at_beginning_of_method_body;
-// public int blank_lines_before_field;
-// public int blank_lines_before_first_class_body_declaration;
-// public int blank_lines_before_includes;
-// public int blank_lines_before_member_type;
-// public int blank_lines_before_method;
-// public int blank_lines_before_new_chunk;
-// public int blank_lines_between_type_declarations;
-
-// public boolean comment_clear_blank_lines;
-// public boolean comment_format;
-// public boolean comment_format_header;
-// public boolean comment_format_html;
-// public boolean comment_format_source;
-// public int comment_line_length;
public int comment_min_distance_between_code_and_line_comment;
public boolean comment_preserve_white_space_between_code_and_line_comment;
public boolean never_indent_line_comments_on_first_column;
-
+
public int continuation_indentation;
public int continuation_indentation_for_initializer_list;
@@ -133,8 +114,6 @@ public class STPDefaultCodeFormatterOptions {
public boolean insert_new_line_before_while_in_do_statement;
public boolean insert_new_line_before_identifier_in_function_declaration;
public boolean insert_new_line_in_empty_block;
-// public boolean insert_new_line_in_empty_method_body;
-// public boolean insert_new_line_in_empty_type_declaration;
public boolean insert_space_after_assignment_operator;
public boolean insert_space_after_binary_operator;
public boolean insert_space_after_closing_angle_bracket_in_template_arguments;
@@ -145,11 +124,8 @@ public class STPDefaultCodeFormatterOptions {
public boolean insert_space_after_colon_in_case;
public boolean insert_space_after_colon_in_conditional;
public boolean insert_space_after_colon_in_labeled_statement;
-// public boolean insert_space_after_comma_in_allocation_expression;
public boolean insert_space_after_comma_in_initializer_list;
public boolean insert_space_after_comma_in_enum_declarations;
-// public boolean insert_space_after_comma_in_for_increments;
-// public boolean insert_space_after_comma_in_for_inits;
public boolean insert_space_after_comma_in_method_invocation_arguments;
public boolean insert_space_after_comma_in_method_declaration_parameters;
public boolean insert_space_after_comma_in_method_declaration_throws;
@@ -158,7 +134,6 @@ public class STPDefaultCodeFormatterOptions {
public boolean insert_space_after_comma_in_base_types;
public boolean insert_space_after_comma_in_template_arguments;
public boolean insert_space_after_comma_in_template_parameters;
-// public boolean insert_space_after_ellipsis;
public boolean insert_space_after_opening_angle_bracket_in_template_arguments;
public boolean insert_space_after_opening_angle_bracket_in_template_parameters;
public boolean insert_space_after_opening_bracket;
@@ -199,11 +174,8 @@ public class STPDefaultCodeFormatterOptions {
public boolean insert_space_before_colon_in_conditional;
public boolean insert_space_before_colon_in_default;
public boolean insert_space_before_colon_in_labeled_statement;
-// public boolean insert_space_before_comma_in_allocation_expression;
public boolean insert_space_before_comma_in_initializer_list;
public boolean insert_space_before_comma_in_enum_declarations;
-// public boolean insert_space_before_comma_in_for_increments;
-// public boolean insert_space_before_comma_in_for_inits;
public boolean insert_space_before_comma_in_method_invocation_arguments;
public boolean insert_space_before_comma_in_method_declaration_parameters;
public boolean insert_space_before_comma_in_method_declaration_throws;
@@ -212,8 +184,6 @@ public class STPDefaultCodeFormatterOptions {
public boolean insert_space_before_comma_in_base_types;
public boolean insert_space_before_comma_in_template_arguments;
public boolean insert_space_before_comma_in_template_parameters;
-// public boolean insert_space_before_ellipsis;
-// public boolean insert_space_before_parenthesized_expression_in_return;
public boolean insert_space_before_opening_angle_bracket_in_template_arguments;
public boolean insert_space_before_opening_angle_bracket_in_template_parameters;
public boolean insert_space_before_opening_brace_in_initializer_list;
@@ -258,7 +228,7 @@ public class STPDefaultCodeFormatterOptions {
public boolean use_tabs_only_for_leading_indentations;
public int initial_indentation_level;
public String line_separator;
-
+
private STPDefaultCodeFormatterOptions() {
// cannot be instantiated
}
@@ -275,7 +245,6 @@ public class STPDefaultCodeFormatterOptions {
public Map<String, String> getMap() {
Map<String, String> options = new HashMap<String, String>();
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_allocation_expression));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_arguments_in_method_invocation));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT, getAlignment(this.alignment_for_assignment));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, getAlignment(this.alignment_for_binary_expression));
@@ -289,34 +258,17 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MEMBER_ACCESS, getAlignment(this.alignment_for_member_access));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN, getAlignment(this.alignment_for_overloaded_left_shift_chain));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_parameters_in_method_declaration));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_selector_in_method_invocation));
+
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BASE_CLAUSE_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_base_clause_in_type_declaration));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONSTRUCTOR_INITIALIZER_LIST, getAlignment(this.alignment_for_constructor_initializer_list));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_method_declaration));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS, this.align_type_members_on_columns ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_includes));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS, Integer.toString(this.blank_lines_before_includes));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE, Integer.toString(this.blank_lines_before_member_type));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, Integer.toString(this.blank_lines_before_method));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK, Integer.toString(this.blank_lines_before_new_chunk));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS, Integer.toString(this.blank_lines_between_type_declarations));
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST, this.brace_position_for_initializer_list);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, this.brace_position_for_block);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, this.brace_position_for_block_in_case);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION, this.brace_position_for_enum_declaration);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, this.brace_position_for_method_declaration);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, this.brace_position_for_type_declaration);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, this.brace_position_for_switch);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_NAMESPACE_DECLARATION, this.brace_position_for_namespace_declaration);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, this.comment_clear_blank_lines ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT, this.comment_format ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, this.comment_format_header ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML, this.comment_format_html ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, Integer.toString(this.comment_min_distance_between_code_and_line_comment));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, this.comment_preserve_white_space_between_code_and_line_comment ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, this.never_indent_line_comments_on_first_column ? STPDefaultCodeFormatterConstants.TRUE : STPDefaultCodeFormatterConstants.FALSE);
@@ -344,8 +296,6 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_IDENTIFIER_IN_FUNCTION_DECLARATION, this.insert_new_line_before_identifier_in_function_declaration? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION, this.insert_new_line_in_empty_type_declaration? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, this.insert_space_after_assignment_operator? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, this.insert_space_after_binary_operator? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_closing_angle_bracket_in_template_arguments ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -356,11 +306,8 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, this.insert_space_after_colon_in_case ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, this.insert_space_after_colon_in_conditional ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST, this.insert_space_after_comma_in_initializer_list? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_after_comma_in_enum_declarations ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, this.insert_space_after_comma_in_for_increments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, this.insert_space_after_comma_in_for_inits? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_after_comma_in_method_invocation_arguments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_method_declaration_parameters? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_after_comma_in_method_declaration_throws? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -369,7 +316,6 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES, this.insert_space_after_comma_in_base_types? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_comma_in_template_arguments ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS, this.insert_space_after_comma_in_template_parameters ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, this.insert_space_after_ellipsis ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_template_arguments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_template_parameters? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET, this.insert_space_after_opening_bracket? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -410,11 +356,8 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, this.insert_space_before_colon_in_conditional? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, this.insert_space_before_colon_in_default? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST, this.insert_space_before_comma_in_initializer_list? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_before_comma_in_enum_declarations? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, this.insert_space_before_comma_in_for_increments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, this.insert_space_before_comma_in_for_inits? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_before_comma_in_method_invocation_arguments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_method_declaration_parameters? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_before_comma_in_method_declaration_throws? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -423,7 +366,6 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES, this.insert_space_before_comma_in_base_types? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS, this.insert_space_before_comma_in_template_arguments ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS, this.insert_space_before_comma_in_template_parameters? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, this.insert_space_before_ellipsis ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_template_arguments? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_template_parameters? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST, this.insert_space_before_opening_brace_in_initializer_list? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -442,7 +384,6 @@ public class STPDefaultCodeFormatterOptions {
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, this.insert_space_before_opening_brace_in_switch? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_opening_paren_in_parenthesized_expression? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, this.insert_space_before_opening_paren_in_while? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
-// options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, this.insert_space_before_parenthesized_expression_in_return ? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, this.insert_space_before_postfix_operator? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, this.insert_space_before_prefix_operator? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
options.put(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, this.insert_space_before_question_in_conditional? IDEPlugin.INSERT : IDEPlugin.DO_NOT_INSERT);
@@ -481,16 +422,6 @@ public class STPDefaultCodeFormatterOptions {
}
public void set(Map<String, String> settings) {
-// final Object alignmentForArgumentsInAllocationExpressionOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION);
-// if (alignmentForArgumentsInAllocationExpressionOption != null) {
-// try {
-// this.alignment_for_arguments_in_allocation_expression = Integer.parseInt((String) alignmentForArgumentsInAllocationExpressionOption);
-// } catch (NumberFormatException e) {
-// this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
-// } catch (ClassCastException e) {
-// this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
-// }
-// }
final Object alignmentForArgumentsInMethodInvocationOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
if (alignmentForArgumentsInMethodInvocationOption != null) {
try {
@@ -651,100 +582,6 @@ public class STPDefaultCodeFormatterOptions {
this.alignment_for_throws_clause_in_method_declaration = STPAlignment.M_COMPACT_SPLIT;
}
}
-// final Object alignTypeMembersOnColumnsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS);
-// if (alignTypeMembersOnColumnsOption != null) {
-// this.align_type_members_on_columns = STPDefaultCodeFormatterConstants.TRUE.equals(alignTypeMembersOnColumnsOption);
-// }
-// final Object blankLinesAfterIncludesOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS);
-// if (blankLinesAfterIncludesOption != null) {
-// try {
-// this.blank_lines_after_includes = Integer.parseInt((String) blankLinesAfterIncludesOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_after_includes = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_after_includes = 0;
-// }
-// }
-// final Object blankLinesBeforeFieldOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD);
-// if (blankLinesBeforeFieldOption != null) {
-// try {
-// this.blank_lines_before_field = Integer.parseInt((String) blankLinesBeforeFieldOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_field = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_field = 0;
-// }
-// }
-// final Object blankLinesBeforeFirstClassBodyDeclarationOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION);
-// if (blankLinesBeforeFirstClassBodyDeclarationOption != null) {
-// try {
-// this.blank_lines_before_first_class_body_declaration = Integer.parseInt((String) blankLinesBeforeFirstClassBodyDeclarationOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_first_class_body_declaration = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_first_class_body_declaration = 0;
-// }
-// }
-// final Object blankLinesBeforeIncludesOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS);
-// if (blankLinesBeforeIncludesOption != null) {
-// try {
-// this.blank_lines_before_includes = Integer.parseInt((String) blankLinesBeforeIncludesOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_includes = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_includes = 0;
-// }
-// }
-// final Object blankLinesBeforeMemberTypeOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE);
-// if (blankLinesBeforeMemberTypeOption != null) {
-// try {
-// this.blank_lines_before_member_type = Integer.parseInt((String) blankLinesBeforeMemberTypeOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_member_type = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_member_type = 0;
-// }
-// }
-// final Object blankLinesBeforeMethodOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD);
-// if (blankLinesBeforeMethodOption != null) {
-// try {
-// this.blank_lines_before_method = Integer.parseInt((String) blankLinesBeforeMethodOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_method = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_method = 0;
-// }
-// }
-// final Object blankLinesBeforeNewChunkOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK);
-// if (blankLinesBeforeNewChunkOption != null) {
-// try {
-// this.blank_lines_before_new_chunk = Integer.parseInt((String) blankLinesBeforeNewChunkOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_before_new_chunk = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_before_new_chunk = 0;
-// }
-// }
-// final Object blankLinesBetweenTypeDeclarationsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS);
-// if (blankLinesBetweenTypeDeclarationsOption != null) {
-// try {
-// this.blank_lines_between_type_declarations = Integer.parseInt((String) blankLinesBetweenTypeDeclarationsOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_between_type_declarations = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_between_type_declarations = 0;
-// }
-// }
-// final Object blankLinesAtBeginningOfMethodBodyOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY);
-// if (blankLinesAtBeginningOfMethodBodyOption != null) {
-// try {
-// this.blank_lines_at_beginning_of_method_body = Integer.parseInt((String) blankLinesAtBeginningOfMethodBodyOption);
-// } catch (NumberFormatException e) {
-// this.blank_lines_at_beginning_of_method_body = 0;
-// } catch (ClassCastException e) {
-// this.blank_lines_at_beginning_of_method_body = 0;
-// }
-// }
final Object bracePositionForInitializerListOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST);
if (bracePositionForInitializerListOption != null) {
try {
@@ -769,14 +606,6 @@ public class STPDefaultCodeFormatterOptions {
this.brace_position_for_block_in_case = STPDefaultCodeFormatterConstants.END_OF_LINE;
}
}
-// final Object bracePositionForEnumDeclarationOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION);
-// if (bracePositionForEnumDeclarationOption != null) {
-// try {
-// this.brace_position_for_enum_declaration = (String) bracePositionForEnumDeclarationOption;
-// } catch (ClassCastException e) {
-// this.brace_position_for_enum_declaration = STPDefaultCodeFormatterConstants.END_OF_LINE;
-// }
-// }
final Object bracePositionForMethodDeclarationOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION);
if (bracePositionForMethodDeclarationOption != null) {
try {
@@ -809,36 +638,6 @@ public class STPDefaultCodeFormatterOptions {
this.brace_position_for_namespace_declaration = STPDefaultCodeFormatterConstants.END_OF_LINE;
}
}
-// final Object commentClearBlankLinesOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES);
-// if (commentClearBlankLinesOption != null) {
-// this.comment_clear_blank_lines = STPDefaultCodeFormatterConstants.TRUE.equals(commentClearBlankLinesOption);
-// }
-// final Object commentFormatOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT);
-// if (commentFormatOption != null) {
-// this.comment_format = STPDefaultCodeFormatterConstants.TRUE.equals(commentFormatOption);
-// }
-// final Object commentFormatHeaderOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER);
-// if (commentFormatHeaderOption != null) {
-// this.comment_format_header = STPDefaultCodeFormatterConstants.TRUE.equals(commentFormatHeaderOption);
-// }
-// final Object commentFormatHtmlOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML);
-// if (commentFormatHtmlOption != null) {
-// this.comment_format_html = STPDefaultCodeFormatterConstants.TRUE.equals(commentFormatHtmlOption);
-// }
-// final Object commentFormatSourceOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE);
-// if (commentFormatSourceOption != null) {
-// this.comment_format_source = STPDefaultCodeFormatterConstants.TRUE.equals(commentFormatSourceOption);
-// }
-// final Object commentLineLengthOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH);
-// if (commentLineLengthOption != null) {
-// try {
-// this.comment_line_length = Integer.parseInt((String) commentLineLengthOption);
-// } catch (NumberFormatException e) {
-// this.comment_line_length = 80;
-// } catch (ClassCastException e) {
-// this.comment_line_length = 80;
-// }
-// }
final Object commentMinDistanceBetweenCodeAndLineCommentOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT);
if (commentMinDistanceBetweenCodeAndLineCommentOption != null) {
try {
@@ -977,14 +776,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertNewLineInEmptyBlockOption != null) {
this.insert_new_line_in_empty_block = IDEPlugin.INSERT.equals(insertNewLineInEmptyBlockOption);
}
-// final Object insertNewLineInEmptyMethodBodyOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY);
-// if (insertNewLineInEmptyMethodBodyOption != null) {
-// this.insert_new_line_in_empty_method_body = IDEPlugin.INSERT.equals(insertNewLineInEmptyMethodBodyOption);
-// }
-// final Object insertNewLineInEmptyTypeDeclarationOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION);
-// if (insertNewLineInEmptyTypeDeclarationOption != null) {
-// this.insert_new_line_in_empty_type_declaration = IDEPlugin.INSERT.equals(insertNewLineInEmptyTypeDeclarationOption);
-// }
final Object insertSpaceAfterAssignmentOperatorOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR);
if (insertSpaceAfterAssignmentOperatorOption != null) {
this.insert_space_after_assignment_operator = IDEPlugin.INSERT.equals(insertSpaceAfterAssignmentOperatorOption);
@@ -1025,10 +816,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceAfterColonInLabeledStatementOption != null) {
this.insert_space_after_colon_in_labeled_statement = IDEPlugin.INSERT.equals(insertSpaceAfterColonInLabeledStatementOption);
}
-// final Object insertSpaceAfterCommaInAllocationExpressionOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION);
-// if (insertSpaceAfterCommaInAllocationExpressionOption != null) {
-// this.insert_space_after_comma_in_allocation_expression = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInAllocationExpressionOption);
-// }
final Object insertSpaceAfterCommaInInitializerListOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST);
if (insertSpaceAfterCommaInInitializerListOption != null) {
this.insert_space_after_comma_in_initializer_list = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInInitializerListOption);
@@ -1037,14 +824,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceAfterCommaInEnumDeclarationsOption != null) {
this.insert_space_after_comma_in_enum_declarations = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInEnumDeclarationsOption);
}
-// final Object insertSpaceAfterCommaInForInitsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS);
-// if (insertSpaceAfterCommaInForInitsOption != null) {
-// this.insert_space_after_comma_in_for_inits = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInForInitsOption);
-// }
-// final Object insertSpaceAfterCommaInForIncrementsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS);
-// if (insertSpaceAfterCommaInForIncrementsOption != null) {
-// this.insert_space_after_comma_in_for_increments = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInForIncrementsOption);
-// }
final Object insertSpaceAfterCommaInMethodInvocationArgumentsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
if (insertSpaceAfterCommaInMethodInvocationArgumentsOption != null) {
this.insert_space_after_comma_in_method_invocation_arguments = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInMethodInvocationArgumentsOption);
@@ -1077,14 +856,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceAfterCommaInTemplateParametersOption != null) {
this.insert_space_after_comma_in_template_parameters = IDEPlugin.INSERT.equals(insertSpaceAfterCommaInTemplateParametersOption);
}
-// final Object insertSpaceAfterEllipsisOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS);
-// if (insertSpaceAfterEllipsisOption != null) {
-// this.insert_space_after_ellipsis = IDEPlugin.INSERT.equals(insertSpaceAfterEllipsisOption);
-// }
-// final Object insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
-// if (insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null) {
-// this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = IDEPlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption);
-// }
final Object insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS);
if (insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption != null) {
this.insert_space_after_opening_angle_bracket_in_template_arguments = IDEPlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption);
@@ -1245,10 +1016,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceBeforeColonInLabeledStatementOption != null) {
this.insert_space_before_colon_in_labeled_statement = IDEPlugin.INSERT.equals(insertSpaceBeforeColonInLabeledStatementOption);
}
-// final Object insertSpaceBeforeCommaInAllocationExpressionOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION);
-// if (insertSpaceBeforeCommaInAllocationExpressionOption != null) {
-// this.insert_space_before_comma_in_allocation_expression = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInAllocationExpressionOption);
-// }
final Object insertSpaceBeforeCommaInInitializerListOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST);
if (insertSpaceBeforeCommaInInitializerListOption != null) {
this.insert_space_before_comma_in_initializer_list = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInInitializerListOption);
@@ -1257,14 +1024,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceBeforeCommaInEnumDeclarationsOption != null) {
this.insert_space_before_comma_in_enum_declarations = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInEnumDeclarationsOption);
}
-// final Object insertSpaceBeforeCommaInForInitsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS);
-// if (insertSpaceBeforeCommaInForInitsOption != null) {
-// this.insert_space_before_comma_in_for_inits = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInForInitsOption);
-// }
-// final Object insertSpaceBeforeCommaInForIncrementsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS);
-// if (insertSpaceBeforeCommaInForIncrementsOption != null) {
-// this.insert_space_before_comma_in_for_increments = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInForIncrementsOption);
-// }
final Object insertSpaceBeforeCommaInMethodInvocationArgumentsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
if (insertSpaceBeforeCommaInMethodInvocationArgumentsOption != null) {
this.insert_space_before_comma_in_method_invocation_arguments = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInMethodInvocationArgumentsOption);
@@ -1297,10 +1056,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceBeforeCommaInTemplateParametersOption != null) {
this.insert_space_before_comma_in_template_parameters = IDEPlugin.INSERT.equals(insertSpaceBeforeCommaInTemplateParametersOption);
}
-// final Object insertSpaceBeforeEllipsisOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS);
-// if (insertSpaceBeforeEllipsisOption != null) {
-// this.insert_space_before_ellipsis = IDEPlugin.INSERT.equals(insertSpaceBeforeEllipsisOption);
-// }
final Object insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS);
if (insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption != null) {
this.insert_space_before_opening_angle_bracket_in_template_arguments = IDEPlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption);
@@ -1373,10 +1128,6 @@ public class STPDefaultCodeFormatterOptions {
if (insertSpaceBeforeOpeningParenInWhileOption != null) {
this.insert_space_before_opening_paren_in_while = IDEPlugin.INSERT.equals(insertSpaceBeforeOpeningParenInWhileOption);
}
-// final Object insertSpaceBeforeParenthesizedExpressionInReturnOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN);
-// if (insertSpaceBeforeParenthesizedExpressionInReturnOption != null) {
-// this.insert_space_before_parenthesized_expression_in_return = IDEPlugin.INSERT.equals(insertSpaceBeforeParenthesizedExpressionInReturnOption);
-// }
final Object insertSpaceBeforePostfixOperatorOption = settings.get(STPDefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR);
if (insertSpaceBeforePostfixOperatorOption != null) {
this.insert_space_before_postfix_operator = IDEPlugin.INSERT.equals(insertSpaceBeforePostfixOperatorOption);
@@ -1500,7 +1251,6 @@ public class STPDefaultCodeFormatterOptions {
}
public void setDefaultSettings() {
-// this.alignment_for_arguments_in_allocation_expression = STPAlignment.M_COMPACT_SPLIT;
this.alignment_for_arguments_in_method_invocation = STPAlignment.M_COMPACT_SPLIT;
this.alignment_for_assignment = STPAlignment.M_COMPACT_SPLIT;
this.alignment_for_base_clause_in_type_declaration = STPAlignment.M_NEXT_PER_LINE_SPLIT;
@@ -1514,21 +1264,9 @@ public class STPDefaultCodeFormatterOptions {
this.alignment_for_member_access = STPAlignment.M_NO_ALIGNMENT;
this.alignment_for_overloaded_left_shift_chain = STPAlignment.M_COMPACT_SPLIT;
this.alignment_for_parameters_in_method_declaration = STPAlignment.M_COMPACT_SPLIT;
-// this.alignment_for_selector_in_method_invocation = STPAlignment.M_COMPACT_SPLIT;
this.alignment_for_throws_clause_in_method_declaration = STPAlignment.M_COMPACT_SPLIT;
-// this.align_type_members_on_columns = false;
-// this.blank_lines_after_includes = 1;
-// this.blank_lines_before_field = 1;
-// this.blank_lines_before_first_class_body_declaration = 0;
-// this.blank_lines_before_includes = 1;
-// this.blank_lines_before_member_type = 1;
-// this.blank_lines_before_method = 1;
-// this.blank_lines_before_new_chunk = 1;
-// this.blank_lines_between_type_declarations = 1;
-// this.blank_lines_at_beginning_of_method_body = 0;
this.brace_position_for_block = STPDefaultCodeFormatterConstants.END_OF_LINE;
this.brace_position_for_block_in_case = STPDefaultCodeFormatterConstants.END_OF_LINE;
-// this.brace_position_for_enum_declaration = STPDefaultCodeFormatterConstants.END_OF_LINE;
this.brace_position_for_initializer_list = STPDefaultCodeFormatterConstants.END_OF_LINE;
this.brace_position_for_method_declaration = STPDefaultCodeFormatterConstants.END_OF_LINE;
this.brace_position_for_namespace_declaration = STPDefaultCodeFormatterConstants.END_OF_LINE;
@@ -1537,22 +1275,11 @@ public class STPDefaultCodeFormatterOptions {
this.comment_min_distance_between_code_and_line_comment = 1;
this.comment_preserve_white_space_between_code_and_line_comment = true;
this.never_indent_line_comments_on_first_column = true;
-// this.comment_clear_blank_lines = false;
-// this.comment_format = true;
-// this.comment_format_header = false;
-// this.comment_format_html = true;
-// this.comment_format_source = true;
-// this.comment_indent_parameter_description = true;
-// this.comment_indent_root_tags = true;
-// this.comment_insert_empty_line_before_root_tags = true;
-// this.comment_insert_new_line_for_parameter = true;
-// this.comment_line_length = 80;
this.continuation_indentation = 2;
this.continuation_indentation_for_initializer_list = 2;
this.indent_statements_compare_to_block = true;
this.indent_statements_compare_to_body = true;
this.indent_body_declarations_compare_to_namespace_header = false;
-// this.indent_body_declarations_compare_to_enum_declaration_header = true;
this.indent_body_declarations_compare_to_access_specifier = true;
this.indent_breaks_compare_to_cases = true;
this.indent_empty_lines = false;
@@ -1567,8 +1294,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_new_line_before_while_in_do_statement = false;
this.insert_new_line_before_identifier_in_function_declaration = false;
this.insert_new_line_in_empty_block = true;
-// this.insert_new_line_in_empty_method_body = true;
-// this.insert_new_line_in_empty_type_declaration = true;
this.insert_space_after_assignment_operator = true;
this.insert_space_after_binary_operator = true;
this.insert_space_after_closing_angle_bracket_in_template_arguments = true;
@@ -1579,7 +1304,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_space_after_colon_in_case = true;
this.insert_space_after_colon_in_conditional = true;
this.insert_space_after_colon_in_labeled_statement = true;
-// this.insert_space_after_comma_in_allocation_expression = true;
this.insert_space_after_comma_in_initializer_list = true;
this.insert_space_after_comma_in_enum_declarations = true;
this.insert_space_after_comma_in_method_invocation_arguments = true;
@@ -1590,8 +1314,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_space_after_comma_in_base_types = true;
this.insert_space_after_comma_in_template_arguments = true;
this.insert_space_after_comma_in_template_parameters = true;
-// this.insert_space_after_ellipsis = true;
-// this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false;
this.insert_space_after_opening_angle_bracket_in_template_arguments = false;
this.insert_space_after_opening_angle_bracket_in_template_parameters = false;
this.insert_space_after_opening_bracket = false;
@@ -1630,11 +1352,8 @@ public class STPDefaultCodeFormatterOptions {
this.insert_space_before_colon_in_conditional = true;
this.insert_space_before_colon_in_default = false;
this.insert_space_before_colon_in_labeled_statement = false;
-// this.insert_space_before_comma_in_allocation_expression = false;
this.insert_space_before_comma_in_initializer_list = false;
this.insert_space_before_comma_in_enum_declarations = false;
-// this.insert_space_before_comma_in_for_increments = false;
-// this.insert_space_before_comma_in_for_inits = false;
this.insert_space_before_comma_in_method_invocation_arguments = false;
this.insert_space_before_comma_in_method_declaration_parameters = false;
this.insert_space_before_comma_in_method_declaration_throws = false;
@@ -1643,8 +1362,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_space_before_comma_in_base_types = false;
this.insert_space_before_comma_in_template_arguments = false;
this.insert_space_before_comma_in_template_parameters = false;
-// this.insert_space_before_ellipsis = false;
-// this.insert_space_before_parenthesized_expression_in_return = true;
this.insert_space_before_opening_angle_bracket_in_template_arguments = false;
this.insert_space_before_opening_angle_bracket_in_template_parameters = false;
this.insert_space_before_opening_brace_in_initializer_list = true;
@@ -1688,7 +1405,7 @@ public class STPDefaultCodeFormatterOptions {
this.tab_char = TAB;
this.use_tabs_only_for_leading_indentations = false;
}
-
+
/**
* Configure K&R style.
* <p>Example:</p>
@@ -1708,7 +1425,7 @@ public class STPDefaultCodeFormatterOptions {
public void setKandRSettings() {
setDefaultSettings();
}
-
+
/**
* Configure BSD/Allman style.
* <p>Example:</p>
@@ -1734,7 +1451,6 @@ public class STPDefaultCodeFormatterOptions {
this.brace_position_for_initializer_list = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_block = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_block_in_case = STPDefaultCodeFormatterConstants.NEXT_LINE;
-// this.brace_position_for_enum_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_method_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_type_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_namespace_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
@@ -1743,7 +1459,6 @@ public class STPDefaultCodeFormatterOptions {
this.indent_statements_compare_to_block = true;
this.indent_statements_compare_to_body = true;
this.indent_body_declarations_compare_to_namespace_header = false;
-// this.indent_body_declarations_compare_to_enum_declaration_header = true;
this.indent_breaks_compare_to_cases = true;
this.indent_empty_lines = false;
this.indent_switchstatements_compare_to_cases = true;
@@ -1755,9 +1470,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_new_line_before_closing_brace_in_initializer_list = false;
this.insert_new_line_before_else_in_if_statement = true;
this.insert_new_line_in_empty_block = true;
-// this.insert_new_line_in_empty_enum_declaration = true;
-// this.insert_new_line_in_empty_method_body = true;
-// this.insert_new_line_in_empty_type_declaration = true;
this.compact_else_if = true;
this.keep_guardian_clause_on_one_line = false;
@@ -1799,7 +1511,6 @@ public class STPDefaultCodeFormatterOptions {
this.brace_position_for_initializer_list = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
this.brace_position_for_block = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
this.brace_position_for_block_in_case = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
-// this.brace_position_for_enum_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
this.brace_position_for_method_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_type_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
this.brace_position_for_namespace_declaration = STPDefaultCodeFormatterConstants.NEXT_LINE;
@@ -1808,7 +1519,6 @@ public class STPDefaultCodeFormatterOptions {
this.indent_statements_compare_to_block = true;
this.indent_statements_compare_to_body = true;
this.indent_body_declarations_compare_to_namespace_header = true;
-// this.indent_body_declarations_compare_to_enum_declaration_header = true;
this.indent_declaration_compare_to_template_header = true;
this.indent_breaks_compare_to_cases = true;
this.indent_empty_lines = false;
@@ -1825,9 +1535,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_new_line_before_identifier_in_function_declaration = true;
this.insert_new_line_before_while_in_do_statement = true;
this.insert_new_line_in_empty_block = true;
-// this.insert_new_line_in_empty_enum_declaration = false;
-// this.insert_new_line_in_empty_method_body = false;
-// this.insert_new_line_in_empty_type_declaration = false;
this.insert_space_before_colon_in_base_clause = true;
@@ -1868,7 +1575,7 @@ public class STPDefaultCodeFormatterOptions {
setDefaultSettings();
this.alignment_for_expressions_in_initializer_list = STPAlignment.M_ONE_PER_LINE_SPLIT;
this.alignment_for_enumerator_list = STPAlignment.M_ONE_PER_LINE_SPLIT | STPAlignment.M_FORCE;
-
+
this.brace_position_for_initializer_list = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
this.brace_position_for_block = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
this.brace_position_for_block_in_case = STPDefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
@@ -1893,9 +1600,6 @@ public class STPDefaultCodeFormatterOptions {
this.insert_new_line_before_else_in_if_statement = true;
this.insert_new_line_before_while_in_do_statement = true;
this.insert_new_line_in_empty_block = true;
-// this.insert_new_line_in_empty_enum_declaration = true;
-// this.insert_new_line_in_empty_method_body = true;
-// this.insert_new_line_in_empty_type_declaration = true;
this.compact_else_if = true;
this.keep_guardian_clause_on_one_line = false;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPHeuristicScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPHeuristicScanner.java
index e717d32..11ce201 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPHeuristicScanner.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPHeuristicScanner.java
@@ -940,7 +940,6 @@ public final class STPHeuristicScanner implements STPSymbols {
public boolean isDefaultPartition(int position) {
String type = getPartition(position).getType();
return fPartition.equals(type);
-// || STPPartitionScanner.STP_PROBE.equals(type);
}
/**
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPIndenter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPIndenter.java
index da4e522..9f1e94e 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPIndenter.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPIndenter.java
@@ -79,7 +79,7 @@ public final class STPIndenter {
final int prefContinuationIndent;
final boolean prefHasTemplates;
final String prefTabChar;
-
+
private final IPreferencesService preferenceService;
private final IScopeContext[] preferenceContexts;
private final IProject fProject;
@@ -144,7 +144,7 @@ public final class STPIndenter {
prefHasTemplates= hasTemplates();
prefTabChar= getCoreFormatterOption(STPDefaultCodeFormatterConstants.FORMATTER_TAB_CHAR);
}
-
+
private boolean prefUseTabs() {
return !IDEPlugin.SPACE.equals(getCoreFormatterOption(STPDefaultCodeFormatterConstants.FORMATTER_TAB_CHAR));
}
@@ -293,14 +293,6 @@ public final class STPIndenter {
}
private boolean prefParenthesisDeepIndent() {
- // don't do parenthesis deep indentation
-// String option= getCoreFormatterOption(STPDefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
-// try {
-// return STPDefaultCodeFormatterConstants.getIndentStyle(option) == STPDefaultCodeFormatterConstants.INDENT_ON_COLUMN;
-// } catch (IllegalArgumentException e) {
-// // ignore and return default
-// }
-
return false;
}
@@ -330,7 +322,7 @@ public final class STPIndenter {
return 1; // sensible default
}
-
+
private int prefAccessSpecifierIndent() {
if (STPDefaultCodeFormatterConstants.TRUE.equals(getCoreFormatterOption(STPDefaultCodeFormatterConstants.FORMATTER_INDENT_ACCESS_SPECIFIER_COMPARE_TO_TYPE_HEADER)))
return 1;
@@ -374,7 +366,7 @@ public final class STPIndenter {
return 2; // sensible default
}
-
+
private boolean hasTemplates() {
return true;
}
@@ -531,7 +523,7 @@ public final class STPIndenter {
// Add additional indent
return createReusingIndent(reference, fPrefs.prefContinuationIndent, 0);
}
-
+
/**
* Computes the length of a <code>CharacterSequence</code>, counting
* a tab character as the size until the next tab stop and every other
@@ -819,20 +811,20 @@ public final class STPIndenter {
case STPSymbols.TokenELSE:
danglingElse= true;
break;
-
+
case STPSymbols.TokenCASE:
case STPSymbols.TokenDEFAULT:
if (isFirstTokenOnLine)
matchMode = MatchMode.MATCH_CASE;
break;
-
+
case STPSymbols.TokenPUBLIC:
case STPSymbols.TokenPROTECTED:
case STPSymbols.TokenPRIVATE:
if (isFirstTokenOnLine && peekSecondToken(offset) != STPSymbols.TokenIDENT)
matchMode = MatchMode.MATCH_ACCESS_SPECIFIER;
break;
-
+
case STPSymbols.TokenLBRACE: // for opening-brace-on-new-line style
if (bracelessBlockStart) {
extraIndent= fPrefs.prefIndentBracesForBlocks ? 0 : -1;
@@ -855,12 +847,12 @@ public final class STPIndenter {
fPosition = pos;
}
break;
-
+
case STPSymbols.TokenRBRACE: // closing braces get unindented
if (isFirstTokenOnLine || prevToken != STPSymbols.TokenLBRACE)
matchMode = MatchMode.MATCH_BRACE;
break;
-
+
case STPSymbols.TokenRPAREN:
if (isFirstTokenOnLine)
matchMode = MatchMode.MATCH_PAREN;
@@ -899,7 +891,7 @@ public final class STPIndenter {
MATCH_BRACE,
/**
* The position of the matching parenthesis should be returned instead of doing code
- * analysis.
+ * analysis.
*/
MATCH_PAREN,
/**
@@ -1167,7 +1159,7 @@ public final class STPIndenter {
return skipToPreviousListItemOrListStart();
// Otherwise, fall-through
default:
- // Inside whatever we don't know about:
+ // Inside whatever we don't know about:
// C would treat this as a list, but in SystemTap we might just have a line that doesn't
// end in a semi-colon. We want to indent to the same level as the statement.
return skipToStatementStart(danglingElse, false);
@@ -1213,7 +1205,7 @@ public final class STPIndenter {
/**
* Test whether the colon at the current position marks a case statement
- *
+ *
* @return <code>true</code> if this looks like a case statement
*/
private boolean looksLikeCaseStatement() {
@@ -1248,7 +1240,7 @@ public final class STPIndenter {
/**
* Test whether the colon at the current position marks a type inheritance decl.
- *
+ *
* @return <code>true</code> if this looks like a type inheritance decl.
*/
private boolean looksLikeTypeInheritanceDecl() {
@@ -1272,7 +1264,7 @@ public final class STPIndenter {
/**
* Test whether the colon at the current position marks a constructor initializer list.
- *
+ *
* @return <code>true</code> if this looks like a constructor initializer list.
*/
private boolean looksLikeConstructorInitializer() {
@@ -1309,7 +1301,7 @@ public final class STPIndenter {
return true;
}
return false;
-
+
case STPSymbols.TokenLBRACE: // class A { A() :
case STPSymbols.TokenRBRACE:
case STPSymbols.TokenSEMICOLON:
@@ -1320,7 +1312,7 @@ public final class STPIndenter {
/**
* Test whether the left brace at the current position marks an enum decl.
- *
+ *
* @return <code>true</code> if this looks like an enum decl.
*/
private boolean looksLikeEnumDeclaration() {
@@ -1343,7 +1335,7 @@ public final class STPIndenter {
/**
* Test whether the colon at the current position marks an access specifier.
- *
+ *
* @return <code>true</code> if current position marks an access specifier
*/
private boolean isAccessSpecifier() {
@@ -1562,10 +1554,10 @@ public final class STPIndenter {
case STPSymbols.TokenMINUS:
case STPSymbols.TokenPLUS:
continue;
-
+
case STPSymbols.TokenQUESTIONMARK:
return true;
-
+
case STPSymbols.TokenSEMICOLON:
case STPSymbols.TokenLBRACE:
case STPSymbols.TokenRBRACE:
@@ -1603,12 +1595,12 @@ public final class STPIndenter {
case STPSymbols.TokenLBRACKET:
case STPSymbols.TokenEOF:
return fPosition;
-
+
case STPSymbols.TokenSWITCH:
// start of switch statement
fIndent= fPrefs.prefCaseIndent;
return fPosition;
-
+
case STPSymbols.TokenCASE:
case STPSymbols.TokenDEFAULT:
// align with previous label
@@ -1648,7 +1640,7 @@ public final class STPIndenter {
case STPSymbols.TokenLBRACKET:
case STPSymbols.TokenEOF:
return fPosition;
-
+
case STPSymbols.TokenLBRACE:
// opening brace of class body
int pos= fPosition;
@@ -1712,7 +1704,7 @@ public final class STPIndenter {
fIndent = fPrefs.prefContinuationIndent;
} else {
fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, bound);
- // If the reference line starts with a colon, skip the colon.
+ // If the reference line starts with a colon, skip the colon.
if (peekToken(fAlign) == STPSymbols.TokenCOLON) {
fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(fAlign + 1, bound);
}
@@ -1957,7 +1949,7 @@ public final class STPIndenter {
try {
IRegion lineRegion = fDocument.getLineInformationOfOffset(scopeIntroducerOffset);
if (fAlign > lineRegion.getOffset() + lineRegion.getLength()) {
- fAlign= firstPossible;
+ fAlign= firstPossible;
}
} catch (BadLocationException e) {
// Ignore.
@@ -2136,7 +2128,7 @@ public final class STPIndenter {
/**
* Skips scope qualifiers of identifiers.
- *
+ *
* @return <code>true</code> if a qualifier was encountered, the last token
* will be an IDENT.
*/
@@ -2311,7 +2303,7 @@ public final class STPIndenter {
* header (i.e. a type name (potentially qualified) and a new keyword). The heuristic calls
* <code>nextToken</code> and expects a possibly qualified identifier (type name) and a new
* keyword
- *
+ *
* @return <code>true</code> if the current position looks like a anonymous type declaration
* header.
*/
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPScribe.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPScribe.java
index 992c7cb..cf7668d 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPScribe.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPScribe.java
@@ -25,7 +25,7 @@ import org.eclipse.text.edits.TextEdit;
/**
* This class is responsible for dumping formatted source.
- *
+ *
* @since 4.0
*/
public class STPScribe {
@@ -44,7 +44,7 @@ public class STPScribe {
public STPAlignment currentAlignment;
public STPAlignment memberAlignment;
public AlignmentException currentAlignmentException;
-
+
/** @see Alignment#tailFormatter */
private Runnable tailFormatter;
@@ -221,7 +221,7 @@ public class STPScribe {
/**
* Trims redundant prefix from a replacement edit and, if there is anything left, appends
- * the replacement edit to the edits array.
+ * the replacement edit to the edits array.
*/
private void appendOptimizedReplaceEdit(int offset, int length, CharSequence replacement) {
int replacementLength = replacement.length();
@@ -546,10 +546,10 @@ public class STPScribe {
if (currentAlignment != null && !formatBrace) {
indentationLevel = currentAlignment.breakIndentationLevel;
}
-
+
// Set the flag to indicate that a specific indentation is currently in used
preserveLineBreakIndentation = true;
-
+
// Print the computed indentation in the buffer
printIndentationIfNecessary(tempBuffer);
@@ -1057,7 +1057,7 @@ public class STPScribe {
/**
* Prints comment at the current position.
- *
+ *
* @return {@code true} if a writespace character was encountered preceding the next token,
*/
public boolean printComment(int trailing) {
@@ -1172,7 +1172,7 @@ public class STPScribe {
}
scanner.resetTo(currentTokenStartPosition, scannerEndPosition);
return hasWhitespace;
- }
+ }
// If one or several new lines are consumed, following comments
// cannot be considered as trailing ones.
if (lines >= 1) {
@@ -1261,12 +1261,8 @@ public class STPScribe {
case Token.tPREPROCESSOR_INCLUDE:
if (column != 1)
printNewLine(scanner.getCurrentTokenStartPosition());
- if (lines >= 1) {
- if (lines > 1) {
- preserveEmptyLines(lines - 1, scanner.getCurrentTokenStartPosition());
- } else if (lines == 1) {
- // printNewLine(scanner.getCurrentTokenStartPosition());
- }
+ if (lines > 1) {
+ preserveEmptyLines(lines - 1, scanner.getCurrentTokenStartPosition());
}
whiteSpaces= CharArrayUtils.EMPTY_CHAR_ARRAY;
hasWhitespace= false;
@@ -1349,7 +1345,7 @@ public class STPScribe {
}
}
}
-
+
// Prepare white space before the comment.
StringBuilder whitespace = null;
if (!lastLineComment.contiguous && commentIndentationLevel != indentationLevel &&
@@ -1386,12 +1382,12 @@ public class STPScribe {
lastLineComment.indentation = commentIndent;
int previousStart = currentTokenStartPosition;
-
+
int indent = commentIndent;
loop: while (nextCharacterStart <= currentTokenEndPosition &&
(currentCharacter = scanner.getNextChar()) != -1) {
nextCharacterStart = scanner.getCurrentPosition();
-
+
switch (currentCharacter) {
case '\r':
case '\n':
@@ -1592,7 +1588,7 @@ public class STPScribe {
// Ensure that the scribe is at the beginning of a new line
// only if no specific indentation has been previously set.
if (!preserveLineBreakIndentation) {
- column = 1;
+ column = 1;
}
preserveLineBreakIndentation = false;
return;
@@ -1912,7 +1908,7 @@ public class STPScribe {
* Skips to the next occurrence of the given token type.
* If successful, the next token will be the expected token,
* otherwise the scanner position is left unchanged.
- *
+ *
* @param expectedTokenType
* @return <code>true</code> if a matching token was skipped to
*/
@@ -1935,7 +1931,7 @@ public class STPScribe {
* Searches for the next occurrence of the given token type.
* If successful, returns the offset of the found token, otherwise -1.
* The scanner position is left unchanged.
- *
+ *
* @param tokenType type of the token to look for
* @return the position of the matching token, if found, otherwise -1.
*/
@@ -1947,7 +1943,7 @@ public class STPScribe {
* Searches for the next occurrence of the given token type.
* If successful, returns the offset of the found token, otherwise -1.
* The scanner position is left unchanged.
- *
+ *
* @param tokenType type of the token to look for
* @param endPosition end position limiting the search
* @return the position of the matching token, if found, otherwise -1.
@@ -2017,7 +2013,7 @@ public class STPScribe {
* Searches for the next occurrence of the given token type.
* If successful, returns the offset of the found token, otherwise -1.
* The scanner position is left unchanged.
- *
+ *
* @param tokenType type of the token to look for
* @param startPosition position where to start the search
* @param endPosition end position limiting the search
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/Scanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/Scanner.java
index da23aeb..bf06737 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/Scanner.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/Scanner.java
@@ -38,7 +38,7 @@ public class Scanner extends SimpleScanner {
/**
* Set the source text as character array.
- *
+ *
* @param source the source text
*/
public void setSource(char[] source) {
@@ -111,7 +111,7 @@ public class Scanner extends SimpleScanner {
/**
* Move to next character iff it is equal to the given expected character.
* If the characters do not match, the scanner does not move forward.
- *
+ *
* @param c the expected character
* @return <code>true</code> if the next character was the expected character
*/
@@ -134,7 +134,7 @@ public class Scanner extends SimpleScanner {
/**
* Set current scanner offset to given offset.
- *
+ *
* @param nextCharacterStart the desired scanner offset
*/
public void setCurrentPosition(int nextCharacterStart) {
@@ -149,14 +149,14 @@ public class Scanner extends SimpleScanner {
// no-op
} else if (diff > fTokenBuffer.length()) {
resetTo(nextCharacterStart, source.length);
- } else /* if (diff <= fTokenBuffer.length()) */ {
+ } else {
while (diff > 0) {
if (fTokenBuffer.length() > 0) {
ungetChar(fTokenBuffer.charAt(fTokenBuffer.length() - 1));
}
--diff;
}
- }
+ }
}
/**
@@ -169,7 +169,7 @@ public class Scanner extends SimpleScanner {
/**
* Get the next token as token type constant.
- *
+ *
* @return the next token type
*/
public int getNextToken() {
@@ -198,27 +198,27 @@ public class Scanner extends SimpleScanner {
if (middleLength > -1) {
middle = new char[middleLength];
System.arraycopy(
- this.source,
- this.startPosition,
- middle,
- 0,
+ this.source,
+ this.startPosition,
+ middle,
+ 0,
middleLength);
} else {
middle = new char[0];
}
-
+
char end[] = new char[this.source.length - (this.getCurrentPosition() - 1)];
System.arraycopy(
- this.source,
- (this.getCurrentPosition() - 1) + 1,
- end,
- 0,
+ this.source,
+ (this.getCurrentPosition() - 1) + 1,
+ end,
+ 0,
this.source.length - (this.getCurrentPosition() - 1) - 1);
-
+
return new String(front)
+ "\n===============================\nStarts here -->" //$NON-NLS-1$
+ new String(middle)
+ "<-- Ends here\n===============================\n" //$NON-NLS-1$
- + new String(end);
+ + new String(end);
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
index ffe3214..c1868be 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
@@ -122,7 +122,7 @@ public class SimpleScanner {
private int getChar(boolean insideString) {
int c = EOFCHAR;
-
+
if (fContext.undoStackSize() != 0) {
c = fContext.popUndo();
} else {
@@ -132,9 +132,9 @@ public class SimpleScanner {
c = EOFCHAR;
}
}
-
+
fTokenBuffer.append((char) c);
-
+
if (!insideString && c == '\\') {
c = getChar(false);
if (c == '\r') {
@@ -153,7 +153,7 @@ public class SimpleScanner {
c = '\\';
}
}
-
+
return c;
}
@@ -221,10 +221,10 @@ public class SimpleScanner {
public Token nextToken() {
fTokenBuffer.setLength(0);
-
+
boolean madeMistake = false;
int c = getChar();
-
+
while (c != EOFCHAR) {
if (fPreprocessorToken != 0) {
Token token= continuePPDirective(c);
@@ -232,7 +232,7 @@ public class SimpleScanner {
return token;
}
}
-
+
if ((c == ' ') || (c == '\r') || (c == '\t') || (c == '\n')) {
do {
c = getChar();
@@ -252,7 +252,7 @@ public class SimpleScanner {
madeMistake = true;
continue;
}
-
+
matchStringLiteral();
return newToken(Token.tLSTRING);
} else if (c == 'R' && !madeMistake) {
@@ -265,14 +265,14 @@ public class SimpleScanner {
madeMistake = true;
continue;
}
-
+
matchRawStringLiteral();
return newToken(Token.tRSTRING);
} else if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || (c == '_') || (c > 255 && Character.isUnicodeIdentifierStart(c))) {
madeMistake = false;
-
+
c = getChar();
-
+
while (((c >= 'a') && (c <= 'z'))
|| ((c >= 'A') && (c <= 'Z'))
|| ((c >= '0') && (c <= '9'))
@@ -280,34 +280,34 @@ public class SimpleScanner {
|| (c > 255 && Character.isUnicodeIdentifierPart(c))) {
c = getChar();
}
-
+
ungetChar(c);
-
+
String ident = fTokenBuffer.toString();
-
+
Object tokenTypeObject;
-
+
tokenTypeObject = fgKeywords.get(ident);
-
+
int tokenType = Token.tIDENTIFIER;
if (tokenTypeObject != null)
tokenType = ((Integer)tokenTypeObject).intValue();
-
+
return newToken(tokenType);
} else if ((c >= '0') && (c <= '9') || c == '.') {
boolean hex = false;
boolean floatingPoint = c == '.';
boolean firstCharZero = c == '0';
-
+
c = getChar();
-
+
if (firstCharZero && c == 'x') {
hex = true;
c = getChar();
}
-
+
int digits= 0;
-
+
while ((c >= '0' && c <= '9') || (hex && ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')))) {
++digits;
c = getChar();
@@ -376,17 +376,17 @@ public class SimpleScanner {
c = getChar();
}
}
-
+
ungetChar(c);
-
+
int tokenType;
String result = fTokenBuffer.toString();
-
+
if (floatingPoint && result.equals(".")) //$NON-NLS-1$
tokenType = Token.tDOT;
else
tokenType = floatingPoint ? Token.tFLOATINGPT : Token.tINTEGER;
-
+
return newToken(tokenType);
} else if (c == '#') {
return matchPPDirective();
@@ -395,7 +395,7 @@ public class SimpleScanner {
case '\'':
matchCharLiteral();
return newToken(Token.tCHAR);
-
+
case ':':
c = getChar();
if (c == ':') {
@@ -601,7 +601,7 @@ public class SimpleScanner {
// throw EOF;
}
}
-
+
// we're done
// throw EOF;
return null;
@@ -634,7 +634,7 @@ public class SimpleScanner {
// string
boolean escaped= false;
int c = getChar(true);
-
+
LOOP: for (;;) {
if (c == EOFCHAR)
break;
@@ -699,7 +699,7 @@ public class SimpleScanner {
/**
* Matches a preprocessor directive.
- *
+ *
* @return a preprocessor token
*/
private Token matchPPDirective() {
@@ -724,7 +724,7 @@ public class SimpleScanner {
}
matchCharLiteral();
return newToken(Token.tCHAR);
-
+
case '"':
if (fTokenBuffer.length() > 1) {
if (fPreprocessorToken==0) {
@@ -846,7 +846,7 @@ public class SimpleScanner {
while (state != 2 && c != EOFCHAR) {
if (c == '\n')
encounteredNewline = true;
-
+
switch (state) {
case 0 :
if (c == '*')