Skip to content

Commit 557f456

Browse files
author
meri
committed
Refactoring of selectors before I start with extend: #151
1 parent 81bb27a commit 557f456

File tree

84 files changed

+678
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+678
-151
lines changed

src/main/java/com/github/sommeri/less4j/core/ast/ASTCssNode.java

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.List;
55

66
import com.github.sommeri.less4j.LessSource;
7+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
78
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
89

910
public abstract class ASTCssNode implements Cloneable {
@@ -26,6 +27,7 @@ public ASTCssNode(HiddenTokenAwareTree underlyingStructure) {
2627
* WARNING: it is up to the programmer to keep parent and childs getters and
2728
* setters consistent. Members of this hierarchy are not responsible for that.
2829
*/
30+
@NotAstProperty
2931
public abstract List<? extends ASTCssNode> getChilds();
3032

3133
/**
@@ -52,6 +54,7 @@ public void setUnderlyingStructure(HiddenTokenAwareTree underlyingStructure) {
5254
this.underlyingStructure = underlyingStructure;
5355
}
5456

57+
@NotAstProperty
5558
public List<Comment> getTrailingComments() {
5659
return trailingComments;
5760
}
@@ -64,6 +67,7 @@ public void addTrailingComments(List<Comment> comments) {
6467
this.trailingComments.addAll(comments);
6568
}
6669

70+
@NotAstProperty
6771
public List<Comment> getOpeningComments() {
6872
return openingComments;
6973
}
@@ -76,6 +80,7 @@ public void addOpeningComments(List<Comment> openingComments) {
7680
this.openingComments.addAll(openingComments);
7781
}
7882

83+
@NotAstProperty
7984
public List<Comment> getOrphanComments() {
8085
return orphanComments;
8186
}

src/main/java/com/github/sommeri/less4j/core/ast/AbstractVariableDeclaration.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -37,6 +38,7 @@ public void setValue(Expression value) {
3738
}
3839

3940
@Override
41+
@NotAstProperty
4042
public List<? extends ASTCssNode> getChilds() {
4143
return ArraysUtils.asNonNullList(variable, value);
4244
}

src/main/java/com/github/sommeri/less4j/core/ast/AnonymousExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class AnonymousExpression extends Expression {
@@ -19,6 +20,7 @@ public String getValue() {
1920
}
2021

2122
@Override
23+
@NotAstProperty
2224
public List<? extends ASTCssNode> getChilds() {
2325
return Collections.emptyList();
2426
}

src/main/java/com/github/sommeri/less4j/core/ast/Body.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78
import com.github.sommeri.less4j.utils.ArraysUtils;
89

@@ -41,6 +42,7 @@ public void setClosingCurlyBrace(SyntaxOnlyElement closingCurlyBrace) {
4142
}
4243

4344
@Override
45+
@NotAstProperty
4446
public List<ASTCssNode> getChilds() {
4547
List<ASTCssNode> result = ArraysUtils.asNonNullList((ASTCssNode) openingCurlyBrace);
4648
result.addAll(body);

src/main/java/com/github/sommeri/less4j/core/ast/CharsetDeclaration.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class CharsetDeclaration extends ASTCssNode {
@@ -23,6 +24,7 @@ public void setCharset(String charset) {
2324
}
2425

2526
@Override
27+
@NotAstProperty
2628
public List<? extends ASTCssNode> getChilds() {
2729
return Collections.emptyList();
2830
}

src/main/java/com/github/sommeri/less4j/core/ast/ColorExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.Collections;
55
import java.util.List;
66

7+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
78
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
89
import com.github.sommeri.less4j.utils.PrintUtils;
910

@@ -90,6 +91,7 @@ protected String toHex(double color) {
9091
}
9192

9293
@Override
94+
@NotAstProperty
9395
public List<? extends ASTCssNode> getChilds() {
9496
return Collections.emptyList();
9597
}

src/main/java/com/github/sommeri/less4j/core/ast/Comment.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class Comment extends ASTCssNode {
@@ -51,6 +52,7 @@ public String toString() {
5152
}
5253

5354
@Override
55+
@NotAstProperty
5456
public List<? extends ASTCssNode> getChilds() {
5557
return Collections.emptyList();
5658
}

src/main/java/com/github/sommeri/less4j/core/ast/ComparisonExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -52,6 +53,7 @@ public ASTCssNodeType getType() {
5253
}
5354

5455
@Override
56+
@NotAstProperty
5557
public List<? extends ASTCssNode> getChilds() {
5658
return ArraysUtils.asNonNullList(left, operator, right);
5759
}

src/main/java/com/github/sommeri/less4j/core/ast/ComparisonExpressionOperator.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class ComparisonExpressionOperator extends ASTCssNode {
@@ -23,6 +24,7 @@ public void setOperator(Operator operator) {
2324
}
2425

2526
@Override
27+
@NotAstProperty
2628
public List<? extends ASTCssNode> getChilds() {
2729
return Collections.emptyList();
2830
}

src/main/java/com/github/sommeri/less4j/core/ast/ComposedExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.List;
55

66
import com.github.sommeri.less4j.core.ast.ExpressionOperator.Operator;
7+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
78
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
89
import com.github.sommeri.less4j.utils.ArraysUtils;
910

@@ -91,6 +92,7 @@ private LinkedList<Expression> splitByComma(Expression expression) {
9192
}
9293

9394
@Override
95+
@NotAstProperty
9496
public List<? extends ASTCssNode> getChilds() {
9597
return ArraysUtils.asNonNullList(left, operator, right);
9698
}

src/main/java/com/github/sommeri/less4j/core/ast/CssClass.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -38,6 +39,7 @@ public ASTCssNodeType getType() {
3839
}
3940

4041
@Override
42+
@NotAstProperty
4143
public List<? extends ASTCssNode> getChilds() {
4244
return ArraysUtils.asNonNullList(name);
4345
}

src/main/java/com/github/sommeri/less4j/core/ast/CssString.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class CssString extends Expression {
@@ -38,6 +39,7 @@ public ASTCssNodeType getType() {
3839
}
3940

4041
@Override
42+
@NotAstProperty
4143
public List<? extends ASTCssNode> getChilds() {
4244
return Collections.emptyList();
4345
}

src/main/java/com/github/sommeri/less4j/core/ast/Declaration.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -56,6 +57,7 @@ public ASTCssNodeType getType() {
5657
}
5758

5859
@Override
60+
@NotAstProperty
5961
public List<? extends ASTCssNode> getChilds() {
6062
return ArraysUtils.asNonNullList(expression);
6163
}

src/main/java/com/github/sommeri/less4j/core/ast/Document.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78
import com.github.sommeri.less4j.utils.ArraysUtils;
89

@@ -38,6 +39,7 @@ public List<FunctionExpression> getUrlMatchFunctions() {
3839
}
3940

4041
@Override
42+
@NotAstProperty
4143
public List<ASTCssNode> getChilds() {
4244
List<ASTCssNode> childs = new ArrayList<ASTCssNode>(urlMatchFunction);
4345
childs.add(body);

src/main/java/com/github/sommeri/less4j/core/ast/EmptyExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class EmptyExpression extends Expression {
@@ -12,6 +13,7 @@ public EmptyExpression(HiddenTokenAwareTree token) {
1213
}
1314

1415
@Override
16+
@NotAstProperty
1517
public List<? extends ASTCssNode> getChilds() {
1618
return Collections.emptyList();
1719
}

src/main/java/com/github/sommeri/less4j/core/ast/EscapedSelector.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67

78
public class EscapedSelector extends SelectorPart {
@@ -43,6 +44,7 @@ public EscapedSelector clone() {
4344

4445

4546
@Override
47+
@NotAstProperty
4648
public List<ASTCssNode> getChilds() {
4749
return super.getChilds();
4850
}

src/main/java/com/github/sommeri/less4j/core/ast/EscapedValue.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class EscapedValue extends Expression {
@@ -28,6 +29,7 @@ public ASTCssNodeType getType() {
2829
}
2930

3031
@Override
32+
@NotAstProperty
3133
public List<? extends ASTCssNode> getChilds() {
3234
return Collections.emptyList();
3335
}

src/main/java/com/github/sommeri/less4j/core/ast/ExpressionOperator.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class ExpressionOperator extends ASTCssNode {
@@ -27,6 +28,7 @@ public void setOperator(Operator operator) {
2728
}
2829

2930
@Override
31+
@NotAstProperty
3032
public List<? extends ASTCssNode> getChilds() {
3133
return Collections.emptyList();
3234
}

src/main/java/com/github/sommeri/less4j/core/ast/Extend.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -41,6 +42,7 @@ public void setTarget(Selector target) {
4142
}
4243

4344
@Override
45+
@NotAstProperty
4446
public List<? extends ASTCssNode> getChilds() {
4547
return ArraysUtils.asNonNullList(target);
4648
}

src/main/java/com/github/sommeri/less4j/core/ast/FaultyExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class FaultyExpression extends Expression {
@@ -16,6 +17,7 @@ public FaultyExpression(ASTCssNode cause) {
1617
}
1718

1819
@Override
20+
@NotAstProperty
1921
public List<? extends ASTCssNode> getChilds() {
2022
return Collections.emptyList();
2123
}

src/main/java/com/github/sommeri/less4j/core/ast/FaultyNode.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class FaultyNode extends ASTCssNode {
@@ -16,6 +17,7 @@ public FaultyNode(ASTCssNode cause) {
1617
}
1718

1819
@Override
20+
@NotAstProperty
1921
public List<? extends ASTCssNode> getChilds() {
2022
return Collections.emptyList();
2123
}

src/main/java/com/github/sommeri/less4j/core/ast/FixedMediaExpression.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
56
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
67
import com.github.sommeri.less4j.utils.ArraysUtils;
78

@@ -38,6 +39,7 @@ public ASTCssNodeType getType() {
3839
}
3940

4041
@Override
42+
@NotAstProperty
4143
public List<? extends ASTCssNode> getChilds() {
4244
return ArraysUtils.asNonNullList(feature, expression);
4345
}

src/main/java/com/github/sommeri/less4j/core/ast/FixedNamePart.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Collections;
44
import java.util.List;
55

6+
import com.github.sommeri.less4j.core.ast.annotations.NotAstProperty;
67
import com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree;
78

89
public class FixedNamePart extends InterpolableNamePart {
@@ -27,6 +28,7 @@ public void setName(String name) {
2728
}
2829

2930
@Override
31+
@NotAstProperty
3032
public List<? extends ASTCssNode> getChilds() {
3133
return Collections.emptyList();
3234
}

0 commit comments

Comments
 (0)