summaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java')
-rw-r--r--theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java b/theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java
index 39a5d17b48..52329c1b14 100644
--- a/theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java
+++ b/theme-compiler/src/com/vaadin/sass/tree/SimpleNode.java
@@ -1,5 +1,7 @@
package com.vaadin.sass.tree;
+import java.util.ArrayList;
+
/**
* A simple BlockNode where input text equals output. <b>Note : </b> ignores any
* possible children so only use it when you are sure no child nodes will be
@@ -8,9 +10,9 @@ package com.vaadin.sass.tree;
* @author Sebastian Nyholm @ Vaadin Ltd
*
*/
-public class SimpleNode extends Node {
+public class SimpleNode extends Node implements IVariableNode {
- private final String text;
+ private String text;
public SimpleNode(String text) {
this.text = text;
@@ -21,4 +23,14 @@ public class SimpleNode extends Node {
public String toString() {
return text;
}
+
+ @Override
+ public void replaceVariables(ArrayList<VariableNode> variables) {
+ for (final VariableNode node : variables) {
+ if (text.contains(node.getName())) {
+ text = text.replaceAll(node.getName(), node.getExpr()
+ .toString());
+ }
+ }
+ }
}