浏览代码

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

master
Dylan Baker 5 年前
父节点
当前提交
2924a9b9dc
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      lib/chervil/ast/identifier.rb

+ 5
- 1
lib/chervil/ast/identifier.rb 查看文件

@@ -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

正在加载...
取消
保存