Skip to content

Commit

Permalink
Prefixes, indentation, #512
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkravin committed Jan 19, 2015
1 parent 8b43ebd commit d84869b
Show file tree
Hide file tree
Showing 31 changed files with 601 additions and 601 deletions.
Expand Up @@ -30,16 +30,16 @@ public class ArrayInitHandler extends BlockParentHandler
{ {
/** /**
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * astract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aAst the abstract syntax tree * @param ast the astract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public ArrayInitHandler(IndentationCheck aIndentCheck, public ArrayInitHandler(IndentationCheck indentCheck,
DetailAST aAst, ExpressionHandler aParent) DetailAST ast, ExpressionHandler parent)
{ {
super(aIndentCheck, "array initialization", aAst, aParent); super(indentCheck, "array initialization", ast, parent);
} }


@Override @Override
Expand Down Expand Up @@ -124,25 +124,25 @@ protected IndentLevel getChildrenExpectedLevel()
} }


/** /**
* @param aLineNo number of line on which we search * @param lineNo number of line on which we search
* @param aColumnNo number of column after which we search * @param columnNo number of column after which we search
* *
* @return column number of first non-blank char after * @return column number of first non-blank char after
* specified column on specified line or -1 if * specified column on specified line or -1 if
* such char doesn't exist. * such char doesn't exist.
*/ */
private int getNextFirstNonblankOnLineAfter(int aLineNo, int aColumnNo) private int getNextFirstNonblankOnLineAfter(int lineNo, int columnNo)
{ {
int columnNo = aColumnNo + 1; int realColumnNo = columnNo + 1;
final String line = getIndentCheck().getLines()[aLineNo - 1]; final String line = getIndentCheck().getLines()[lineNo - 1];
final int lineLength = line.length(); final int lineLength = line.length();
while ((columnNo < lineLength) while ((realColumnNo < lineLength)
&& Character.isWhitespace(line.charAt(columnNo))) && Character.isWhitespace(line.charAt(realColumnNo)))
{ {
columnNo++; realColumnNo++;
} }


return (columnNo == lineLength) ? -1 : columnNo; return (realColumnNo == lineLength) ? -1 : realColumnNo;
} }


/** /**
Expand Down
Expand Up @@ -68,15 +68,15 @@ protected int[] getCheckedChildren()
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* name, abstract syntax tree, and parent handler. * name, abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aName the name of the handler * @param name the name of the handler
* @param aAst the abstract syntax tree * @param ast the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public BlockParentHandler(IndentationCheck aIndentCheck, public BlockParentHandler(IndentationCheck indentCheck,
String aName, DetailAST aAst, ExpressionHandler aParent) String name, DetailAST ast, ExpressionHandler parent)
{ {
super(aIndentCheck, aName, aAst, aParent); super(indentCheck, name, ast, parent);
} }


/** /**
Expand Down Expand Up @@ -339,7 +339,7 @@ else if (startsLine(getRCurly())) {
} }


@Override @Override
public IndentLevel suggestedChildLevel(ExpressionHandler aChild) public IndentLevel suggestedChildLevel(ExpressionHandler child)
{ {
return getChildrenExpectedLevel(); return getChildrenExpectedLevel();
} }
Expand Down
Expand Up @@ -40,14 +40,14 @@ public class CaseHandler extends ExpressionHandler
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aExpr the abstract syntax tree * @param expr the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public CaseHandler(IndentationCheck aIndentCheck, public CaseHandler(IndentationCheck indentCheck,
DetailAST aExpr, ExpressionHandler aParent) DetailAST expr, ExpressionHandler parent)
{ {
super(aIndentCheck, "case", aExpr, aParent); super(indentCheck, "case", expr, parent);
} }


@Override @Override
Expand All @@ -66,7 +66,7 @@ private void checkCase()
} }


@Override @Override
public IndentLevel suggestedChildLevel(ExpressionHandler aChild) public IndentLevel suggestedChildLevel(ExpressionHandler child)
{ {
return getLevel(); return getLevel();
} }
Expand Down
Expand Up @@ -32,14 +32,14 @@ public class CatchHandler extends BlockParentHandler
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aAst the abstract syntax tree * @param ast the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public CatchHandler(IndentationCheck aIndentCheck, public CatchHandler(IndentationCheck indentCheck,
DetailAST aAst, ExpressionHandler aParent) DetailAST ast, ExpressionHandler parent)
{ {
super(aIndentCheck, "catch", aAst, aParent); super(indentCheck, "catch", ast, parent);
} }


@Override @Override
Expand Down
Expand Up @@ -32,19 +32,19 @@ public class ClassDefHandler extends BlockParentHandler
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aAst the abstract syntax tree * @param ast the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public ClassDefHandler(IndentationCheck aIndentCheck, public ClassDefHandler(IndentationCheck indentCheck,
DetailAST aAst, DetailAST ast,
ExpressionHandler aParent) ExpressionHandler parent)
{ {
super(aIndentCheck, super(indentCheck,
(aAst.getType() == TokenTypes.CLASS_DEF) (ast.getType() == TokenTypes.CLASS_DEF)
? "class def" : ((aAst.getType() == TokenTypes.ENUM_DEF) ? "class def" : ((ast.getType() == TokenTypes.ENUM_DEF)
? "enum def" : "interface def"), ? "enum def" : "interface def"),
aAst, aParent); ast, parent);
} }


@Override @Override
Expand Down Expand Up @@ -93,9 +93,9 @@ public void checkIndentation()
final LineWrappingHandler lineWrap = final LineWrappingHandler lineWrap =
new LineWrappingHandler(getIndentCheck(), getMainAst()) { new LineWrappingHandler(getIndentCheck(), getMainAst()) {
@Override @Override
public DetailAST findLastNode(DetailAST aFirstNode) public DetailAST findLastNode(DetailAST firstNode)
{ {
return aFirstNode.getLastChild(); return firstNode.getLastChild();
} }
}; };
lineWrap.checkIndentation(); lineWrap.checkIndentation();
Expand Down
Expand Up @@ -32,14 +32,14 @@ public class DoWhileHandler extends BlockParentHandler
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aAst the abstract syntax tree * @param ast the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public DoWhileHandler(IndentationCheck aIndentCheck, public DoWhileHandler(IndentationCheck indentCheck,
DetailAST aAst, ExpressionHandler aParent) DetailAST ast, ExpressionHandler parent)
{ {
super(aIndentCheck, "do..while", aAst, aParent); super(indentCheck, "do..while", ast, parent);
} }


/** /**
Expand Down
Expand Up @@ -32,14 +32,14 @@ public class ElseHandler extends BlockParentHandler
* Construct an instance of this handler with the given indentation check, * Construct an instance of this handler with the given indentation check,
* abstract syntax tree, and parent handler. * abstract syntax tree, and parent handler.
* *
* @param aIndentCheck the indentation check * @param indentCheck the indentation check
* @param aAst the abstract syntax tree * @param ast the abstract syntax tree
* @param aParent the parent handler * @param parent the parent handler
*/ */
public ElseHandler(IndentationCheck aIndentCheck, public ElseHandler(IndentationCheck indentCheck,
DetailAST aAst, ExpressionHandler aParent) DetailAST ast, ExpressionHandler parent)
{ {
super(aIndentCheck, "else", aAst, aParent); super(indentCheck, "else", ast, parent);
} }


@Override @Override
Expand Down

0 comments on commit d84869b

Please sign in to comment.