@@ -19,8 +19,8 @@ public class Directive extends AbstractNode<Directive> implements NamedNode<Dire
1919 private final List <Argument > arguments = new ArrayList <>();
2020
2121 @ Internal
22- protected Directive (String name , List <Argument > arguments , SourceLocation sourceLocation , List <Comment > comments ) {
23- super (sourceLocation , comments );
22+ protected Directive (String name , List <Argument > arguments , SourceLocation sourceLocation , List <Comment > comments , IgnoredChars ignoredChars ) {
23+ super (sourceLocation , comments , ignoredChars );
2424 this .name = name ;
2525 this .arguments .addAll (arguments );
2626 }
@@ -32,7 +32,7 @@ protected Directive(String name, List<Argument> arguments, SourceLocation source
3232 * @param arguments of the directive
3333 */
3434 public Directive (String name , List <Argument > arguments ) {
35- this (name , arguments , null , new ArrayList <>());
35+ this (name , arguments , null , new ArrayList <>(), IgnoredChars . EMPTY );
3636 }
3737
3838
@@ -42,7 +42,7 @@ public Directive(String name, List<Argument> arguments) {
4242 * @param name of the directive
4343 */
4444 public Directive (String name ) {
45- this (name , new ArrayList <>(), null , new ArrayList <>());
45+ this (name , new ArrayList <>(), null , new ArrayList <>(), IgnoredChars . EMPTY );
4646 }
4747
4848 public List <Argument > getArguments () {
@@ -71,8 +71,12 @@ public List<Node> getChildren() {
7171
7272 @ Override
7373 public boolean isEqualTo (Node o ) {
74- if (this == o ) return true ;
75- if (o == null || getClass () != o .getClass ()) return false ;
74+ if (this == o ) {
75+ return true ;
76+ }
77+ if (o == null || getClass () != o .getClass ()) {
78+ return false ;
79+ }
7680
7781 Directive that = (Directive ) o ;
7882
@@ -82,7 +86,7 @@ public boolean isEqualTo(Node o) {
8286
8387 @ Override
8488 public Directive deepCopy () {
85- return new Directive (name , deepCopy (arguments ), getSourceLocation (), getComments ());
89+ return new Directive (name , deepCopy (arguments ), getSourceLocation (), getComments (), getIgnoredChars () );
8690 }
8791
8892 @ Override
@@ -113,6 +117,7 @@ public static final class Builder implements NodeBuilder {
113117 private List <Comment > comments = new ArrayList <>();
114118 private String name ;
115119 private List <Argument > arguments = new ArrayList <>();
120+ private IgnoredChars ignoredChars = IgnoredChars .EMPTY ;
116121
117122 private Builder () {
118123 }
@@ -122,6 +127,7 @@ private Builder(Directive existing) {
122127 this .comments = existing .getComments ();
123128 this .name = existing .getName ();
124129 this .arguments = existing .getArguments ();
130+ this .ignoredChars = existing .getIgnoredChars ();
125131 }
126132
127133
@@ -145,8 +151,13 @@ public Builder arguments(List<Argument> arguments) {
145151 return this ;
146152 }
147153
154+ public Builder ignoredChars (IgnoredChars ignoredChars ) {
155+ this .ignoredChars = ignoredChars ;
156+ return this ;
157+ }
158+
148159 public Directive build () {
149- Directive directive = new Directive (name , arguments , sourceLocation , comments );
160+ Directive directive = new Directive (name , arguments , sourceLocation , comments , ignoredChars );
150161 return directive ;
151162 }
152163 }
0 commit comments