Browse Source

Sometimes we have an AST node and sometimes we have a raw value

master
Dylan Baker 5 years ago
parent
commit
2924a9b9dc
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      lib/chervil/ast/identifier.rb

+ 5
- 1
lib/chervil/ast/identifier.rb View File

@@ -15,7 +15,11 @@ module Chervil::AST
15 15
       if value.nil?
16 16
         ::Chervil::Error.new("unbound variable #{@name}")
17 17
       else
18
-        value.evaluate(env)
18
+        if value.respond_to?(:evaluate)
19
+          value.evaluate(env)
20
+        else
21
+          value
22
+        end
19 23
       end
20 24
     end
21 25
   end

Loading…
Cancel
Save