Skip to content

Commit 0dfad5b

Browse files
authored
Some typo fixes (#326)
1 parent 35aa4e2 commit 0dfad5b

31 files changed

+78
-86
lines changed

src/checkstyle/Checker.hx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import checkstyle.token.TokenTree;
1515
import checkstyle.token.TokenTreeBuilder;
1616

1717
using checkstyle.utils.ArrayUtils;
18-
using StringTools;
1918

2019
class Checker {
2120

src/checkstyle/checks/block/ConditionalCompilationCheck.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ConditionalCompilationCheck extends Check {
3333
function checkSingleLine(tok:TokenTree, line:Int):Bool {
3434
var endTok:TokenTree = null;
3535

36-
for (child in tok.childs) {
36+
for (child in tok.children) {
3737
switch (child.tok) {
3838
case Sharp("end"):
3939
endTok = child;
@@ -67,7 +67,7 @@ class ConditionalCompilationCheck extends Check {
6767
case ALIGNED:
6868
if (checkIndentation(tok, linePos)) return;
6969
}
70-
for (childTok in tok.childs) {
70+
for (childTok in tok.children) {
7171
switch (childTok.tok) {
7272
case Sharp("else"), Sharp("elseif"), Sharp("end"):
7373
var childLinePos:LinePos = checker.getLinePos(childTok.pos.min);
@@ -106,7 +106,7 @@ class ConditionalCompilationCheck extends Check {
106106
var nextLen:Int = -1;
107107

108108
var lineIndex:Int = linePos.line - 1;
109-
while (lineIndex >= 0) {
109+
while (lineIndex >= 0) {
110110
var line:String = checker.lines[lineIndex];
111111
prevLen = getIndentLength(line);
112112
if (prevLen >= 0) break;

src/checkstyle/checks/block/EmptyBlockCheck.hx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ class EmptyBlockCheck extends Check {
8383
}
8484

8585
function checkForText(brOpen:TokenTree) {
86-
if (brOpen.childs.length == 1) {
86+
if (brOpen.children.length == 1) {
8787
logPos("Empty block should contain a comment or a statement", brOpen.pos);
8888
return;
8989
}
9090
}
9191

9292
function checkForStatement(brOpen:TokenTree) {
93-
if (brOpen.childs.length == 1) {
93+
if (brOpen.children.length == 1) {
9494
logPos("Empty block should contain a statement", brOpen.pos);
9595
return;
9696
}
9797
var onlyComments:Bool = true;
98-
for (child in brOpen.childs) {
98+
for (child in brOpen.children) {
9999
switch (child.tok) {
100100
case Comment(_), CommentLine(_):
101101
case BrClose:
@@ -108,8 +108,8 @@ class EmptyBlockCheck extends Check {
108108
}
109109

110110
function checkForEmpty(brOpen:TokenTree) {
111-
if (brOpen.childs.length > 1) return;
112-
var brClose:TokenTree = brOpen.childs[0];
111+
if (brOpen.children.length > 1) return;
112+
var brClose:TokenTree = brOpen.children[0];
113113
if (brOpen.pos.max != brClose.pos.min) logPos('Empty block should be written as "{}"', brOpen.pos);
114114
}
115115
}

src/checkstyle/checks/block/LeftCurlyCheck.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ class LeftCurlyCheck extends Check {
178178
try {
179179
if (curlyAtEOL) {
180180
logErrorIf((option == NL), "Left curly should be on new line (only whitespace before curly)", pos);
181-
logErrorIf((option == NLOW) && wrapped, "Left curly should be on new line (previous expression is split over muliple lines)", pos);
181+
logErrorIf((option == NLOW) && wrapped, "Left curly should be on new line (previous expression is split over multiple lines)", pos);
182182
logErrorIf((option != EOL) && (option != NLOW), "Left curly unknown option ${option}", pos);
183183
return;
184184
}
185-
logErrorIf((option == EOL), "Left curly should be at EOL (only linebreak or comment after curly)", pos);
185+
logErrorIf((option == EOL), "Left curly should be at EOL (only line break or comment after curly)", pos);
186186
logErrorIf((!curlyOnNL), "Left curly should be on new line (only whitespace before curly)", pos);
187-
logErrorIf((option == NLOW) && !wrapped, "Left curly should be at EOL (previous expression is not split over muliple lines)", pos);
187+
logErrorIf((option == NLOW) && !wrapped, "Left curly should be at EOL (previous expression is not split over multiple lines)", pos);
188188
logErrorIf((option != NL) && (option != NLOW), "Left curly unknown option ${option}", pos);
189189
}
190190
catch (e:String) {

src/checkstyle/checks/block/NeedBracesCheck.hx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class NeedBracesCheck extends Check {
6363
}
6464

6565
function checkIfChild(token:TokenTree) {
66-
if (token == null || !token.hasChilds()) return;
66+
if (token == null || !token.hasChildren()) return;
6767

6868
var lastChild:TokenTree = token.getLastChild();
6969
if (Type.enumEq(lastChild.tok, Kwd(KwdElse))) {
@@ -78,12 +78,12 @@ class NeedBracesCheck extends Check {
7878
}
7979

8080
function checkFunctionChild(token:TokenTree) {
81-
if (token == null || !token.hasChilds()) return;
81+
if (token == null || !token.hasChildren()) return;
8282

8383
var lastChild:TokenTree = token.getLastChild();
8484
switch (lastChild.tok) {
8585
case Const(CIdent(_)), Kwd(KwdNew):
86-
if (!lastChild.hasChilds()) return;
86+
if (!lastChild.hasChildren()) return;
8787
lastChild = lastChild.getLastChild();
8888
default:
8989
}
@@ -98,7 +98,7 @@ class NeedBracesCheck extends Check {
9898
}
9999

100100
function checkDoWhileChild(token:TokenTree) {
101-
if (token == null || !token.hasChilds()) return;
101+
if (token == null || !token.hasChildren()) return;
102102

103103
var lastChild:TokenTree = token.getLastChild();
104104
var expr:TokenTree = lastChild.previousSibling;
@@ -111,7 +111,7 @@ class NeedBracesCheck extends Check {
111111
}
112112

113113
function checkWhileChild(token:TokenTree) {
114-
if (token == null || !token.hasChilds() || Type.enumEq(token.parent.tok, Kwd(KwdDo))) return;
114+
if (token == null || !token.hasChildren() || Type.enumEq(token.parent.tok, Kwd(KwdDo))) return;
115115
var lastChild:TokenTree = token.getLastChild();
116116
switch (lastChild.tok) {
117117
case BrOpen:
@@ -122,7 +122,7 @@ class NeedBracesCheck extends Check {
122122
}
123123

124124
function checkLastChild(token:TokenTree) {
125-
if (token == null || !token.hasChilds()) return;
125+
if (token == null || !token.hasChildren()) return;
126126

127127
var lastChild:TokenTree = token.getLastChild();
128128
switch (lastChild.tok) {

src/checkstyle/checks/coding/HiddenFieldCheck.hx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class HiddenFieldCheck extends Check {
4242
}
4343

4444
function checkMethod(method:TokenTree, memberNames:Array<String>, ignoreFormatRE:EReg) {
45-
if (!method.hasChilds()) throw "function has invalid structure!";
45+
if (!method.hasChildren()) throw "function has invalid structure!";
4646

4747
// handle constructor and setters
48-
var methodName:TokenTree = method.childs[0];
48+
var methodName:TokenTree = method.children[0];
4949
if (methodName.is(Kwd(KwdNew)) && ignoreConstructorParameter) return;
5050
if (ignoreSetter && isSetterFunction(methodName, memberNames)) return;
5151
switch (methodName.tok) {
@@ -81,15 +81,15 @@ class HiddenFieldCheck extends Check {
8181
if ((paramDef == null) || (paramDef.length != 1)) {
8282
throw "function parameters have invalid structure!";
8383
}
84-
var paramList:Array<TokenTree> = paramDef[0].childs;
84+
var paramList:Array<TokenTree> = paramDef[0].children;
8585
for (param in paramList) checkName(param, memberNames, "Parameter definition");
8686
}
8787

8888
function checkVars(method:TokenTree, memberNames:Array<String>) {
8989
var vars:Array<TokenTree> = method.filter([Kwd(KwdVar)], ALL);
9090
for (v in vars) {
91-
if (!v.hasChilds()) throw "var has invalid structure!";
92-
checkName(v.childs[0], memberNames, "Variable definition");
91+
if (!v.hasChildren()) throw "var has invalid structure!";
92+
checkName(v.children[0], memberNames, "Variable definition");
9393
}
9494
}
9595

@@ -99,8 +99,8 @@ class HiddenFieldCheck extends Check {
9999
var popens:Array<TokenTree> = f.filter([POpen], FIRST, 2);
100100
if (popens.length <= 0) continue;
101101
var pOpen:TokenTree = popens[0];
102-
if (!pOpen.hasChilds()) continue;
103-
checkName(pOpen.childs[0], memberNames, "For loop definition");
102+
if (!pOpen.hasChildren()) continue;
103+
checkName(pOpen.children[0], memberNames, "For loop definition");
104104
}
105105
}
106106

@@ -124,8 +124,8 @@ class HiddenFieldCheck extends Check {
124124
// |- Kwd(KwdFunction)
125125
var varFields:Array<TokenTree> = clazz.filter([Kwd(KwdVar)], FIRST, MAX_FIELD_LEVEL);
126126
for (member in varFields) {
127-
if (!member.hasChilds()) continue;
128-
switch (member.childs[0].tok) {
127+
if (!member.hasChildren()) continue;
128+
switch (member.children[0].tok) {
129129
case Const(CIdent(name)): memberNames.push(name);
130130
default:
131131
}

src/checkstyle/checks/coding/InnerAssignmentCheck.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class InnerAssignmentCheck extends Check {
9090
var parent:TokenTree;
9191
if (Type.enumEq(token.parent.tok, BrOpen)) {
9292
var brOpen:TokenTree = token.parent;
93-
// parent is a block and has more than two childs
94-
if (brOpen.childs.length > 2) return true;
93+
// parent is a block and has more than two children
94+
if (brOpen.children.length > 2) return true;
9595
parent = brOpen.parent;
9696
}
9797
else {

src/checkstyle/checks/coding/MultipleVariableDeclarationsCheck.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MultipleVariableDeclarationsCheck extends Check {
2222
if (lastVarLineNo > 0 && lastVarLineNo == curVarLineNo) logPos("Only one variable definition per line allowed", v.pos);
2323
lastVarLineNo = curVarLineNo;
2424
var count = 0;
25-
for (c in v.childs) {
25+
for (c in v.children) {
2626
switch (c.tok) {
2727
case Const(CIdent(name)):
2828
count++;

src/checkstyle/checks/coding/ReturnCountCheck.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ReturnCountCheck extends Check {
2828
default:
2929
}
3030
if (isPosSuppressed(fn.pos)) continue;
31-
if (!fn.hasChilds()) throw "function has invalid structure!";
31+
if (!fn.hasChildren()) throw "function has invalid structure!";
3232
var returns = fn.filterCallback(filterReturns);
3333
if (returns.length > max) {
3434
logPos('Return count is ${returns.length} (max allowed is ${max})', fn.pos);

src/checkstyle/checks/coding/SimplifyBooleanReturnCheck.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SimplifyBooleanReturnCheck extends Check {
2121
if (elseLiteral == null) continue;
2222

2323
var elseStatement = elseLiteral.getFirstChild();
24-
var thenStatement = token.childs[1];
24+
var thenStatement = token.children[1];
2525

2626
if (canReturnOnlyBooleanLiteral(thenStatement) && canReturnOnlyBooleanLiteral(elseStatement)) {
2727
logPos("Conditional logic can be removed", token.pos);

0 commit comments

Comments
 (0)