Permalink
Browse files

Rename name to value. All nodes should take a String value as 1st cto…

…r arg. Ref #39.
  • Loading branch information...
1 parent 1fd5f8c commit ea1b7a02f799ac08f3bfd8ee82995eb2cdc6160a @aslakhellesoy aslakhellesoy committed Mar 18, 2013
View
2 java/src/main/java/bool/Evaluator.java
@@ -5,7 +5,7 @@
public class Evaluator implements Visitor<Boolean, List<String>> {
@Override
public Boolean visit(Var var, List<String> vars) {
- return vars.contains(var.name);
+ return vars.contains(var.value);
}
@Override
View
2 java/src/main/java/bool/Renderer.java
@@ -6,7 +6,7 @@
@Override
public String visit(Var var, List<String> notused) {
- return var.name;
+ return var.value;
}
@Override
View
6 java/src/main/java/bool/Var.java
@@ -1,10 +1,10 @@
package bool;
public class Var implements Expr {
- public final String name;
+ public final String value;
- public Var(String name) {
- this.name = name;
+ public Var(String value) {
+ this.value = value;
}
@Override
View
6 ruby/lib/bool/ast.rb
@@ -3,10 +3,10 @@ module Bool
# AST classes defined in bool_ext.jar
else
class Var
- attr_reader :name
+ attr_reader :value
- def initialize(name)
- @name = name
+ def initialize(value)
+ @value = value
end
def accept(visitor, arg)
View
2 ruby/lib/bool/evaluator.rb
@@ -9,7 +9,7 @@ def self.new
else
def visit_var(node, vars)
- !!vars.index(node.name)
+ !!vars.index(node.value)
end
def visit_and(node, vars)
View
2 ruby/lib/bool/renderer.rb
@@ -9,7 +9,7 @@ def self.new
else
def visit_var(node, vars)
- node.name
+ node.value
end
def visit_and(node, vars)

0 comments on commit ea1b7a0

Please sign in to comment.