goodguide-gibbon 0.12.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/goodguide/gibbon.rb +147 -67
 - data/vendor/gibbon/gibbon.browser.dev.js +464 -1
 - data/vendor/gibbon/gibbon.browser.js +464 -1
 - data/vendor/gibbon/package.json +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 94e167f036800da8152def1c3b2495b95f1781ef
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1746c2c2070bcf91c4e1df017c6f9cb9af7c4d94
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 238529f54e900f1e87a17bec31246d3cbb0fba7b61340f69d66dfc932274e33f3368237f4444fc77dcf084f9885f5c05f310bf42c547236d00782c00b2f7f374
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d2fcff687cbe7a9f6d2d0e81ceb44226d61c5d0950f92ae1743c7f8b74504c8a8b53e4fab75abd244a76630e55e2aabca45d0d6da054f1c86fedd8ba7a10a3e2
         
     | 
    
        data/lib/goodguide/gibbon.rb
    CHANGED
    
    | 
         @@ -188,43 +188,26 @@ module GoodGuide 
     | 
|
| 
       188 
188 
     | 
    
         
             
                class RuntimeError < GibbonError
         
     | 
| 
       189 
189 
     | 
    
         
             
                end
         
     | 
| 
       190 
190 
     | 
    
         | 
| 
       191 
     | 
    
         
            -
                class  
     | 
| 
       192 
     | 
    
         
            -
                   
     | 
| 
       193 
     | 
    
         
            -
                  attr_accessor :annotations
         
     | 
| 
       194 
     | 
    
         
            -
                  def initialize(type, id, annotations)
         
     | 
| 
       195 
     | 
    
         
            -
                    @query_type, @id, @annotations = type, id, annotations
         
     | 
| 
       196 
     | 
    
         
            -
                  end
         
     | 
| 
       197 
     | 
    
         
            -
             
     | 
| 
       198 
     | 
    
         
            -
                  def to_js(gibbon)
         
     | 
| 
       199 
     | 
    
         
            -
                    gibbon['Failure'].query(@id, @annotations)
         
     | 
| 
       200 
     | 
    
         
            -
                  end
         
     | 
| 
      
 191 
     | 
    
         
            +
                class Runner < BasicObject
         
     | 
| 
      
 192 
     | 
    
         
            +
                  E = ::GoodGuide::Gibbon::RuntimeError
         
     | 
| 
       201 
193 
     | 
    
         | 
| 
       202 
     | 
    
         
            -
                   
     | 
| 
       203 
     | 
    
         
            -
             
     | 
| 
       204 
     | 
    
         
            -
                      'status' => 'missing_data',
         
     | 
| 
       205 
     | 
    
         
            -
                      'query_type' => query_type,
         
     | 
| 
       206 
     | 
    
         
            -
                      'entity_id' => id,
         
     | 
| 
       207 
     | 
    
         
            -
                      'annotations' => annotations,
         
     | 
| 
       208 
     | 
    
         
            -
                    }
         
     | 
| 
       209 
     | 
    
         
            -
                  end
         
     | 
| 
       210 
     | 
    
         
            -
                end
         
     | 
| 
      
 194 
     | 
    
         
            +
                  # expose Kernel::raise
         
     | 
| 
      
 195 
     | 
    
         
            +
                  define_method(:raise, &::Kernel.method(:raise))
         
     | 
| 
       211 
196 
     | 
    
         | 
| 
       212 
     | 
    
         
            -
             
     | 
| 
       213 
     | 
    
         
            -
                   
     | 
| 
       214 
     | 
    
         
            -
             
     | 
| 
       215 
     | 
    
         
            -
                    @message = message
         
     | 
| 
       216 
     | 
    
         
            -
                  end
         
     | 
| 
      
 197 
     | 
    
         
            +
                  attr_reader :source
         
     | 
| 
      
 198 
     | 
    
         
            +
                  def initialize(source)
         
     | 
| 
      
 199 
     | 
    
         
            +
                    @source = source
         
     | 
| 
       217 
200 
     | 
    
         | 
| 
       218 
     | 
    
         
            -
             
     | 
| 
       219 
     | 
    
         
            -
             
     | 
| 
      
 201 
     | 
    
         
            +
                    (class << self; self; end).class_eval <<-RUBY, __FILE__, __LINE__ + 1
         
     | 
| 
      
 202 
     | 
    
         
            +
                      private
         
     | 
| 
      
 203 
     | 
    
         
            +
                      def __compiled_run!(__client, __global)
         
     | 
| 
      
 204 
     | 
    
         
            +
                        #{source}
         
     | 
| 
      
 205 
     | 
    
         
            +
                      end
         
     | 
| 
      
 206 
     | 
    
         
            +
                    RUBY
         
     | 
| 
       220 
207 
     | 
    
         
             
                  end
         
     | 
| 
       221 
208 
     | 
    
         | 
| 
       222 
     | 
    
         
            -
                  def  
     | 
| 
       223 
     | 
    
         
            -
                     
     | 
| 
       224 
     | 
    
         
            -
                      'status' => 'failure',
         
     | 
| 
       225 
     | 
    
         
            -
                      'message' => message,
         
     | 
| 
       226 
     | 
    
         
            -
                      'annotations' => annotations
         
     | 
| 
       227 
     | 
    
         
            -
                    }
         
     | 
| 
      
 209 
     | 
    
         
            +
                  def run!(client, global_id)
         
     | 
| 
      
 210 
     | 
    
         
            +
                    __compiled_run!(client, global_id)
         
     | 
| 
       228 
211 
     | 
    
         
             
                  end
         
     | 
| 
       229 
212 
     | 
    
         
             
                end
         
     | 
| 
       230 
213 
     | 
    
         | 
| 
         @@ -240,46 +223,68 @@ module GoodGuide 
     | 
|
| 
       240 
223 
     | 
    
         | 
| 
       241 
224 
     | 
    
         
             
                    raise SemanticError.new(errors, context) if errors
         
     | 
| 
       242 
225 
     | 
    
         | 
| 
       243 
     | 
    
         
            -
                     
     | 
| 
      
 226 
     | 
    
         
            +
                    ruby_code = context.compile_ruby(semantics)
         
     | 
| 
       244 
227 
     | 
    
         | 
| 
       245 
228 
     | 
    
         
             
                    Program.new(
         
     | 
| 
       246 
     | 
    
         
            -
                      : 
     | 
| 
       247 
     | 
    
         
            -
                      : 
     | 
| 
       248 
     | 
    
         
            -
                      : 
     | 
| 
      
 229 
     | 
    
         
            +
                      syntax: syntax,
         
     | 
| 
      
 230 
     | 
    
         
            +
                      semantics: semantics,
         
     | 
| 
      
 231 
     | 
    
         
            +
                      ruby: ruby_code
         
     | 
| 
       249 
232 
     | 
    
         
             
                    )
         
     | 
| 
       250 
233 
     | 
    
         
             
                  end
         
     | 
| 
       251 
234 
     | 
    
         | 
| 
       252 
     | 
    
         
            -
                  attr_reader :syntax, : 
     | 
| 
       253 
     | 
    
         
            -
                  def semantics
         
     | 
| 
       254 
     | 
    
         
            -
                    as_json['compiled']['semantics']
         
     | 
| 
       255 
     | 
    
         
            -
                  end
         
     | 
| 
      
 235 
     | 
    
         
            +
                  attr_reader :syntax, :semantics, :ruby_code
         
     | 
| 
       256 
236 
     | 
    
         | 
| 
       257 
     | 
    
         
            -
                  def initialize(info 
     | 
| 
      
 237 
     | 
    
         
            +
                  def initialize(info)
         
     | 
| 
       258 
238 
     | 
    
         
             
                    @syntax = info[:syntax] or raise 'please pass syntax'
         
     | 
| 
       259 
     | 
    
         
            -
                    @ 
     | 
| 
       260 
     | 
    
         
            -
                    @ 
     | 
| 
      
 239 
     | 
    
         
            +
                    @semantics = info[:semantics] or raise 'please pass semantics'
         
     | 
| 
      
 240 
     | 
    
         
            +
                    @ruby_code = info[:ruby] or raise 'please pass ruby code'
         
     | 
| 
       261 
241 
     | 
    
         
             
                  end
         
     | 
| 
       262 
242 
     | 
    
         | 
| 
       263 
243 
     | 
    
         
             
                  def as_json
         
     | 
| 
       264 
244 
     | 
    
         
             
                    @as_json ||= {
         
     | 
| 
       265 
     | 
    
         
            -
                      'syntax' => @ 
     | 
| 
       266 
     | 
    
         
            -
                      ' 
     | 
| 
       267 
     | 
    
         
            -
             
     | 
| 
       268 
     | 
    
         
            -
                        'blocks' => @context.send(:obj_to_ruby, @compiled.blocks)
         
     | 
| 
       269 
     | 
    
         
            -
                      }
         
     | 
| 
      
 245 
     | 
    
         
            +
                      'syntax' => @syntax,
         
     | 
| 
      
 246 
     | 
    
         
            +
                      'semantics' => @semantics,
         
     | 
| 
      
 247 
     | 
    
         
            +
                      'ruby' => @ruby_code,
         
     | 
| 
       270 
248 
     | 
    
         
             
                    }
         
     | 
| 
       271 
249 
     | 
    
         
             
                  end
         
     | 
| 
       272 
250 
     | 
    
         | 
| 
       273 
     | 
    
         
            -
                  def self.from_json(hash 
     | 
| 
       274 
     | 
    
         
            -
                     
     | 
| 
       275 
     | 
    
         
            -
             
     | 
| 
       276 
     | 
    
         
            -
             
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
                     
     | 
| 
      
 251 
     | 
    
         
            +
                  def self.from_json(hash)
         
     | 
| 
      
 252 
     | 
    
         
            +
                    new(
         
     | 
| 
      
 253 
     | 
    
         
            +
                      :syntax => hash['syntax'],
         
     | 
| 
      
 254 
     | 
    
         
            +
                      :semantics => hash['semantics'],
         
     | 
| 
      
 255 
     | 
    
         
            +
                      :ruby => hash['ruby'],
         
     | 
| 
      
 256 
     | 
    
         
            +
                    )
         
     | 
| 
      
 257 
     | 
    
         
            +
                  end
         
     | 
| 
      
 258 
     | 
    
         
            +
             
     | 
| 
      
 259 
     | 
    
         
            +
                  def runner
         
     | 
| 
      
 260 
     | 
    
         
            +
                    @runner ||= Runner.new(ruby_code)
         
     | 
| 
       279 
261 
     | 
    
         
             
                  end
         
     | 
| 
       280 
262 
     | 
    
         | 
| 
       281 
263 
     | 
    
         
             
                  def call(runtime_client, entity_id)
         
     | 
| 
       282 
     | 
    
         
            -
                     
     | 
| 
      
 264 
     | 
    
         
            +
                    deps, results = runtime_client.with_dependencies do
         
     | 
| 
      
 265 
     | 
    
         
            +
                      runner.run!(runtime_client, entity_id)
         
     | 
| 
      
 266 
     | 
    
         
            +
                    end
         
     | 
| 
      
 267 
     | 
    
         
            +
             
     | 
| 
      
 268 
     | 
    
         
            +
                    out = {}
         
     | 
| 
      
 269 
     | 
    
         
            +
                    results.each do |key, result|
         
     | 
| 
      
 270 
     | 
    
         
            +
                      out[key] = { 'dependencies' => deps[key] || [] }
         
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
      
 272 
     | 
    
         
            +
                      case result[:status]
         
     | 
| 
      
 273 
     | 
    
         
            +
                      when :success
         
     | 
| 
      
 274 
     | 
    
         
            +
                        out[key].merge! 'status' => 'success', 'value' => result[:value]
         
     | 
| 
      
 275 
     | 
    
         
            +
                      when :failure
         
     | 
| 
      
 276 
     | 
    
         
            +
                        out[key].merge! 'status' => 'failure'
         
     | 
| 
      
 277 
     | 
    
         
            +
                      end
         
     | 
| 
      
 278 
     | 
    
         
            +
                    end
         
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
      
 280 
     | 
    
         
            +
                    out
         
     | 
| 
      
 281 
     | 
    
         
            +
                  end
         
     | 
| 
      
 282 
     | 
    
         
            +
             
     | 
| 
      
 283 
     | 
    
         
            +
                private
         
     | 
| 
      
 284 
     | 
    
         
            +
                  def stringify_keys(hash)
         
     | 
| 
      
 285 
     | 
    
         
            +
                    out = {}
         
     | 
| 
      
 286 
     | 
    
         
            +
                    hash.each { |k, v| out[k.to_s] = v }
         
     | 
| 
      
 287 
     | 
    
         
            +
                    out
         
     | 
| 
       283 
288 
     | 
    
         
             
                  end
         
     | 
| 
       284 
289 
     | 
    
         
             
                end
         
     | 
| 
       285 
290 
     | 
    
         | 
| 
         @@ -350,23 +355,100 @@ module GoodGuide 
     | 
|
| 
       350 
355 
     | 
    
         
             
                  end
         
     | 
| 
       351 
356 
     | 
    
         
             
                end
         
     | 
| 
       352 
357 
     | 
    
         | 
| 
      
 358 
     | 
    
         
            +
                class Dependency
         
     | 
| 
      
 359 
     | 
    
         
            +
                  class Missing < Dependency
         
     | 
| 
      
 360 
     | 
    
         
            +
                    attr_reader :query_type, :id, :annotations
         
     | 
| 
      
 361 
     | 
    
         
            +
                    def initialize(query_type, id, annotations)
         
     | 
| 
      
 362 
     | 
    
         
            +
                      @query_type, @id, @annotations = query_type, id, annotations
         
     | 
| 
      
 363 
     | 
    
         
            +
                    end
         
     | 
| 
      
 364 
     | 
    
         
            +
             
     | 
| 
      
 365 
     | 
    
         
            +
                    def as_json
         
     | 
| 
      
 366 
     | 
    
         
            +
                      {
         
     | 
| 
      
 367 
     | 
    
         
            +
                        '_tag' => 'missing',
         
     | 
| 
      
 368 
     | 
    
         
            +
                        'query_type' => query_type,
         
     | 
| 
      
 369 
     | 
    
         
            +
                        'id' => id,
         
     | 
| 
      
 370 
     | 
    
         
            +
                        'annotations' => annotations
         
     | 
| 
      
 371 
     | 
    
         
            +
                      }
         
     | 
| 
      
 372 
     | 
    
         
            +
                    end
         
     | 
| 
      
 373 
     | 
    
         
            +
                  end
         
     | 
| 
      
 374 
     | 
    
         
            +
             
     | 
| 
      
 375 
     | 
    
         
            +
                  class Query < Dependency
         
     | 
| 
      
 376 
     | 
    
         
            +
                    attr_reader :query_type, :annotations, :type, :id, :value
         
     | 
| 
      
 377 
     | 
    
         
            +
                    def initialize(info={})
         
     | 
| 
      
 378 
     | 
    
         
            +
                      @query_type = info.fetch(:query_type) { raise "no query type" }
         
     | 
| 
      
 379 
     | 
    
         
            +
                      @annotations = info.fetch(:annotations) { raise "no annotations" }
         
     | 
| 
      
 380 
     | 
    
         
            +
                      @type = info.fetch(:type) { raise "no type" }
         
     | 
| 
      
 381 
     | 
    
         
            +
                      @id = info.fetch(:id) { raise "no id" }
         
     | 
| 
      
 382 
     | 
    
         
            +
                      @value = info.fetch(:value) { raise "no value" }
         
     | 
| 
      
 383 
     | 
    
         
            +
                    end
         
     | 
| 
      
 384 
     | 
    
         
            +
             
     | 
| 
      
 385 
     | 
    
         
            +
                    def as_json
         
     | 
| 
      
 386 
     | 
    
         
            +
                      {
         
     | 
| 
      
 387 
     | 
    
         
            +
                        '_tag' => 'query',
         
     | 
| 
      
 388 
     | 
    
         
            +
                        'query_type' => query_type,
         
     | 
| 
      
 389 
     | 
    
         
            +
                        'annotations' => annotations,
         
     | 
| 
      
 390 
     | 
    
         
            +
                        'type' => type,
         
     | 
| 
      
 391 
     | 
    
         
            +
                        'id' => id,
         
     | 
| 
      
 392 
     | 
    
         
            +
                        'value' => value
         
     | 
| 
      
 393 
     | 
    
         
            +
                      }
         
     | 
| 
      
 394 
     | 
    
         
            +
                    end
         
     | 
| 
      
 395 
     | 
    
         
            +
                  end
         
     | 
| 
      
 396 
     | 
    
         
            +
             
     | 
| 
      
 397 
     | 
    
         
            +
                  class Local < Dependency
         
     | 
| 
      
 398 
     | 
    
         
            +
                    attr_reader :key
         
     | 
| 
      
 399 
     | 
    
         
            +
                    def initialize(key)
         
     | 
| 
      
 400 
     | 
    
         
            +
                      @key = key
         
     | 
| 
      
 401 
     | 
    
         
            +
                    end
         
     | 
| 
      
 402 
     | 
    
         
            +
             
     | 
| 
      
 403 
     | 
    
         
            +
                    def as_json
         
     | 
| 
      
 404 
     | 
    
         
            +
                      { '_tag' => 'local', 'key' => key }
         
     | 
| 
      
 405 
     | 
    
         
            +
                    end
         
     | 
| 
      
 406 
     | 
    
         
            +
                  end
         
     | 
| 
      
 407 
     | 
    
         
            +
                end
         
     | 
| 
      
 408 
     | 
    
         
            +
             
     | 
| 
       353 
409 
     | 
    
         
             
                class RuntimeClient < AbstractClient
         
     | 
| 
       354 
410 
     | 
    
         
             
                  include Util
         
     | 
| 
       355 
     | 
    
         
            -
                  def  
     | 
| 
       356 
     | 
    
         
            -
                    annotations = obj_to_ruby(annotations)
         
     | 
| 
      
 411 
     | 
    
         
            +
                  def query!(current_key, annotations, type, id)
         
     | 
| 
       357 
412 
     | 
    
         
             
                    query_type = annotations.delete('_query_type')
         
     | 
| 
       358 
413 
     | 
    
         | 
| 
       359 
414 
     | 
    
         
             
                    # stash this data in case missing_data! is called
         
     | 
| 
      
 415 
     | 
    
         
            +
                    @last_key = current_key
         
     | 
| 
       360 
416 
     | 
    
         
             
                    @last_query_type = query_type
         
     | 
| 
       361 
417 
     | 
    
         
             
                    @last_annotations = annotations
         
     | 
| 
       362 
418 
     | 
    
         
             
                    @last_id = id
         
     | 
| 
       363 
419 
     | 
    
         | 
| 
       364 
420 
     | 
    
         
             
                    query = get_query(query_type) or raise "invalid query type in compiled code: #{query_type.inspect} with annotations #{annotations.inspect}"
         
     | 
| 
       365 
     | 
    
         
            -
                    instance_exec(id, annotations, &query)
         
     | 
| 
      
 421 
     | 
    
         
            +
                    value = instance_exec(id, annotations, &query)
         
     | 
| 
      
 422 
     | 
    
         
            +
             
     | 
| 
      
 423 
     | 
    
         
            +
                    add_dependency! current_key, Dependency::Query.new(
         
     | 
| 
      
 424 
     | 
    
         
            +
                      query_type: query_type,
         
     | 
| 
      
 425 
     | 
    
         
            +
                      annotations: annotations,
         
     | 
| 
      
 426 
     | 
    
         
            +
                      type: type,
         
     | 
| 
      
 427 
     | 
    
         
            +
                      id: id,
         
     | 
| 
      
 428 
     | 
    
         
            +
                      value: value
         
     | 
| 
      
 429 
     | 
    
         
            +
                    )
         
     | 
| 
      
 430 
     | 
    
         
            +
             
     | 
| 
      
 431 
     | 
    
         
            +
                    value
         
     | 
| 
      
 432 
     | 
    
         
            +
                  end
         
     | 
| 
      
 433 
     | 
    
         
            +
             
     | 
| 
      
 434 
     | 
    
         
            +
                  def with_dependencies(&b)
         
     | 
| 
      
 435 
     | 
    
         
            +
                    @dependencies = {}
         
     | 
| 
      
 436 
     | 
    
         
            +
                    value = yield
         
     | 
| 
      
 437 
     | 
    
         
            +
                    [@dependencies, value]
         
     | 
| 
       366 
438 
     | 
    
         
             
                  end
         
     | 
| 
       367 
439 
     | 
    
         | 
| 
       368 
440 
     | 
    
         
             
                  def missing_data!
         
     | 
| 
       369 
     | 
    
         
            -
                     
     | 
| 
      
 441 
     | 
    
         
            +
                    add_dependency! @last_key, Dependency::Missing.new(@last_query_type, @last_id, @last_annotations)
         
     | 
| 
      
 442 
     | 
    
         
            +
             
     | 
| 
      
 443 
     | 
    
         
            +
                    raise RuntimeError
         
     | 
| 
      
 444 
     | 
    
         
            +
                  end
         
     | 
| 
      
 445 
     | 
    
         
            +
             
     | 
| 
      
 446 
     | 
    
         
            +
                  def local_dependency!(current_key, dependence_key)
         
     | 
| 
      
 447 
     | 
    
         
            +
                    add_dependency! current_key, Dependency::Local.new(dependence_key)
         
     | 
| 
      
 448 
     | 
    
         
            +
                  end
         
     | 
| 
      
 449 
     | 
    
         
            +
             
     | 
| 
      
 450 
     | 
    
         
            +
                  def add_dependency!(key, dep)
         
     | 
| 
      
 451 
     | 
    
         
            +
                    (@dependencies[key] ||= []) << dep
         
     | 
| 
       370 
452 
     | 
    
         
             
                  end
         
     | 
| 
       371 
453 
     | 
    
         | 
| 
       372 
454 
     | 
    
         
             
                  def to_js(gibbon)
         
     | 
| 
         @@ -403,20 +485,18 @@ module GoodGuide 
     | 
|
| 
       403 
485 
     | 
    
         
             
                    gibbon.compile(obj_to_js(semantics))
         
     | 
| 
       404 
486 
     | 
    
         
             
                  end
         
     | 
| 
       405 
487 
     | 
    
         | 
| 
      
 488 
     | 
    
         
            +
                  def compile_ruby(semantics)
         
     | 
| 
      
 489 
     | 
    
         
            +
                    obj_to_ruby(gibbon.compileRuby(obj_to_js(semantics)))
         
     | 
| 
      
 490 
     | 
    
         
            +
                  end
         
     | 
| 
      
 491 
     | 
    
         
            +
             
     | 
| 
       406 
492 
     | 
    
         
             
                  def analyze(syntax, global_table, static_client)
         
     | 
| 
       407 
493 
     | 
    
         
             
                    syntax = obj_to_js(syntax)
         
     | 
| 
       408 
494 
     | 
    
         | 
| 
       409 
     | 
    
         
            -
                    capture do |&callback|
         
     | 
| 
      
 495 
     | 
    
         
            +
                    out = capture do |&callback|
         
     | 
| 
       410 
496 
     | 
    
         
             
                      gibbon.analyze(syntax, global_table, static_client, callback)
         
     | 
| 
       411 
497 
     | 
    
         
             
                    end
         
     | 
| 
       412 
     | 
    
         
            -
                  end
         
     | 
| 
       413 
     | 
    
         
            -
             
     | 
| 
       414 
     | 
    
         
            -
                  def run_compiled(compiled, entity_id, runtime_client)
         
     | 
| 
       415 
     | 
    
         
            -
                    results, _ = capture do |&callback|
         
     | 
| 
       416 
     | 
    
         
            -
                      compiled.run(entity_id, runtime_client, callback)
         
     | 
| 
       417 
     | 
    
         
            -
                    end
         
     | 
| 
       418 
498 
     | 
    
         | 
| 
       419 
     | 
    
         
            -
                    obj_to_ruby( 
     | 
| 
      
 499 
     | 
    
         
            +
                    obj_to_ruby(out)
         
     | 
| 
       420 
500 
     | 
    
         
             
                  end
         
     | 
| 
       421 
501 
     | 
    
         | 
| 
       422 
502 
     | 
    
         
             
                private
         
     | 
| 
         @@ -469,7 +469,7 @@ Parsimmon.Parser = P(function(_, _super, Parser) { 
     | 
|
| 
       469 
469 
     | 
    
         
             
              return Parsimmon;
         
     | 
| 
       470 
470 
     | 
    
         
             
            })()
         
     | 
| 
       471 
471 
     | 
    
         
             
            // Generated by CoffeeScript 1.6.3
         
     | 
| 
       472 
     | 
    
         
            -
            var AST, CompiledCode, Core, DEBUG, Dependency, Failure, Gibbon, Hash, JS, List, Map, ObjHash, RVal, Result, Semantic, Step, Thunk, Trace, Type, TypeAST, TypeExpr, TypeLookup, Value, VarTrace, Variant, analyze, applyOp1, applyOp2, asyncMap, contIter, contMap, equalArrays, eval_, inspectNative, isArray, nameGen, parse, stdlib, uniq, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
         
     | 
| 
      
 472 
     | 
    
         
            +
            var AST, CompiledCode, Core, DEBUG, Dependency, Failure, Gibbon, Hash, JS, List, Map, ObjHash, RVal, Result, Ruby, Semantic, Step, Thunk, Trace, Type, TypeAST, TypeExpr, TypeLookup, Value, VarTrace, Variant, analyze, applyOp1, applyOp2, asyncMap, contIter, contMap, equalArrays, eval_, inspectNative, isArray, nameGen, parse, stdlib, uniq, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
         
     | 
| 
       473 
473 
     | 
    
         
             
              __slice = [].slice,
         
     | 
| 
       474 
474 
     | 
    
         
             
              __hasProp = {}.hasOwnProperty,
         
     | 
| 
       475 
475 
     | 
    
         
             
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
         
     | 
| 
         @@ -6529,6 +6529,469 @@ Gibbon.compile = function(semantics) { 
     | 
|
| 
       6529 
6529 
     | 
    
         
             
              return new CompiledCode(semantics, compiled);
         
     | 
| 
       6530 
6530 
     | 
    
         
             
            };
         
     | 
| 
       6531 
6531 
     | 
    
         | 
| 
      
 6532 
     | 
    
         
            +
            Ruby = (function(_super) {
         
     | 
| 
      
 6533 
     | 
    
         
            +
              var inspectLiteral;
         
     | 
| 
      
 6534 
     | 
    
         
            +
             
     | 
| 
      
 6535 
     | 
    
         
            +
              __extends(Ruby, _super);
         
     | 
| 
      
 6536 
     | 
    
         
            +
             
     | 
| 
      
 6537 
     | 
    
         
            +
              function Ruby() {
         
     | 
| 
      
 6538 
     | 
    
         
            +
                _ref19 = Ruby.__super__.constructor.apply(this, arguments);
         
     | 
| 
      
 6539 
     | 
    
         
            +
                return _ref19;
         
     | 
| 
      
 6540 
     | 
    
         
            +
              }
         
     | 
| 
      
 6541 
     | 
    
         
            +
             
     | 
| 
      
 6542 
     | 
    
         
            +
              Ruby.variants({
         
     | 
| 
      
 6543 
     | 
    
         
            +
                branch: ['cond', 'ifTrue', 'ifFalse'],
         
     | 
| 
      
 6544 
     | 
    
         
            +
                guard: ['cond', 'expr'],
         
     | 
| 
      
 6545 
     | 
    
         
            +
                rescue: ['expr', 'default'],
         
     | 
| 
      
 6546 
     | 
    
         
            +
                ident: ['name'],
         
     | 
| 
      
 6547 
     | 
    
         
            +
                brackets: ['expr', 'arg'],
         
     | 
| 
      
 6548 
     | 
    
         
            +
                array: ['elements'],
         
     | 
| 
      
 6549 
     | 
    
         
            +
                group: ['statements'],
         
     | 
| 
      
 6550 
     | 
    
         
            +
                op1: ['op', 'arg'],
         
     | 
| 
      
 6551 
     | 
    
         
            +
                op2: ['op', 'lhs', 'rhs'],
         
     | 
| 
      
 6552 
     | 
    
         
            +
                assign: ['lval', 'rval'],
         
     | 
| 
      
 6553 
     | 
    
         
            +
                paren: ['elements'],
         
     | 
| 
      
 6554 
     | 
    
         
            +
                literal: ['value'],
         
     | 
| 
      
 6555 
     | 
    
         
            +
                symbol: ['name'],
         
     | 
| 
      
 6556 
     | 
    
         
            +
                mcall: ['target', 'name', 'args', 'blockArgs', 'block']
         
     | 
| 
      
 6557 
     | 
    
         
            +
              });
         
     | 
| 
      
 6558 
     | 
    
         
            +
             
     | 
| 
      
 6559 
     | 
    
         
            +
              Ruby.raise = function(args) {
         
     | 
| 
      
 6560 
     | 
    
         
            +
                return this.mcall(null, 'raise', args, [], null);
         
     | 
| 
      
 6561 
     | 
    
         
            +
              };
         
     | 
| 
      
 6562 
     | 
    
         
            +
             
     | 
| 
      
 6563 
     | 
    
         
            +
              Ruby.breakUnless = function(cond) {
         
     | 
| 
      
 6564 
     | 
    
         
            +
                return cond.op2('||', this.ident('break'));
         
     | 
| 
      
 6565 
     | 
    
         
            +
              };
         
     | 
| 
      
 6566 
     | 
    
         
            +
             
     | 
| 
      
 6567 
     | 
    
         
            +
              Ruby.prototype.branch = function(t, f) {
         
     | 
| 
      
 6568 
     | 
    
         
            +
                return Ruby.branch(this, t, f);
         
     | 
| 
      
 6569 
     | 
    
         
            +
              };
         
     | 
| 
      
 6570 
     | 
    
         
            +
             
     | 
| 
      
 6571 
     | 
    
         
            +
              Ruby.prototype.rescue = function(d) {
         
     | 
| 
      
 6572 
     | 
    
         
            +
                return Ruby.rescue(this, d);
         
     | 
| 
      
 6573 
     | 
    
         
            +
              };
         
     | 
| 
      
 6574 
     | 
    
         
            +
             
     | 
| 
      
 6575 
     | 
    
         
            +
              Ruby.prototype.bracket = function(a) {
         
     | 
| 
      
 6576 
     | 
    
         
            +
                return Ruby.brackets(this, a);
         
     | 
| 
      
 6577 
     | 
    
         
            +
              };
         
     | 
| 
      
 6578 
     | 
    
         
            +
             
     | 
| 
      
 6579 
     | 
    
         
            +
              Ruby.prototype.op1 = function(o) {
         
     | 
| 
      
 6580 
     | 
    
         
            +
                return Ruby.op1(o, this);
         
     | 
| 
      
 6581 
     | 
    
         
            +
              };
         
     | 
| 
      
 6582 
     | 
    
         
            +
             
     | 
| 
      
 6583 
     | 
    
         
            +
              Ruby.prototype.op2 = function(o, e) {
         
     | 
| 
      
 6584 
     | 
    
         
            +
                return Ruby.op2(o, this, e);
         
     | 
| 
      
 6585 
     | 
    
         
            +
              };
         
     | 
| 
      
 6586 
     | 
    
         
            +
             
     | 
| 
      
 6587 
     | 
    
         
            +
              Ruby.prototype.assign = function(rval) {
         
     | 
| 
      
 6588 
     | 
    
         
            +
                return Ruby.assign(this, rval);
         
     | 
| 
      
 6589 
     | 
    
         
            +
              };
         
     | 
| 
      
 6590 
     | 
    
         
            +
             
     | 
| 
      
 6591 
     | 
    
         
            +
              Ruby.prototype.mcall = function(name, args, blockArgs, block) {
         
     | 
| 
      
 6592 
     | 
    
         
            +
                if (args == null) {
         
     | 
| 
      
 6593 
     | 
    
         
            +
                  args = [];
         
     | 
| 
      
 6594 
     | 
    
         
            +
                }
         
     | 
| 
      
 6595 
     | 
    
         
            +
                if (blockArgs == null) {
         
     | 
| 
      
 6596 
     | 
    
         
            +
                  blockArgs = [];
         
     | 
| 
      
 6597 
     | 
    
         
            +
                }
         
     | 
| 
      
 6598 
     | 
    
         
            +
                if (block == null) {
         
     | 
| 
      
 6599 
     | 
    
         
            +
                  block = null;
         
     | 
| 
      
 6600 
     | 
    
         
            +
                }
         
     | 
| 
      
 6601 
     | 
    
         
            +
                return Ruby.mcall(this, name, args, blockArgs, block);
         
     | 
| 
      
 6602 
     | 
    
         
            +
              };
         
     | 
| 
      
 6603 
     | 
    
         
            +
             
     | 
| 
      
 6604 
     | 
    
         
            +
              Ruby.prototype.guard = function(expr) {
         
     | 
| 
      
 6605 
     | 
    
         
            +
                return Ruby.branch(this, expr, null);
         
     | 
| 
      
 6606 
     | 
    
         
            +
              };
         
     | 
| 
      
 6607 
     | 
    
         
            +
             
     | 
| 
      
 6608 
     | 
    
         
            +
              inspectLiteral = function(o) {
         
     | 
| 
      
 6609 
     | 
    
         
            +
                var e, k, v;
         
     | 
| 
      
 6610 
     | 
    
         
            +
                if (isArray(o)) {
         
     | 
| 
      
 6611 
     | 
    
         
            +
                  return '[' + ((function() {
         
     | 
| 
      
 6612 
     | 
    
         
            +
                    var _i, _len, _results;
         
     | 
| 
      
 6613 
     | 
    
         
            +
                    _results = [];
         
     | 
| 
      
 6614 
     | 
    
         
            +
                    for (_i = 0, _len = o.length; _i < _len; _i++) {
         
     | 
| 
      
 6615 
     | 
    
         
            +
                      e = o[_i];
         
     | 
| 
      
 6616 
     | 
    
         
            +
                      _results.push(inspectLiteral(e));
         
     | 
| 
      
 6617 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6618 
     | 
    
         
            +
                    return _results;
         
     | 
| 
      
 6619 
     | 
    
         
            +
                  })()) + ']';
         
     | 
| 
      
 6620 
     | 
    
         
            +
                }
         
     | 
| 
      
 6621 
     | 
    
         
            +
                switch (typeof o) {
         
     | 
| 
      
 6622 
     | 
    
         
            +
                  case 'string':
         
     | 
| 
      
 6623 
     | 
    
         
            +
                    return "'" + o.replace("'", "\\\\'") + "'";
         
     | 
| 
      
 6624 
     | 
    
         
            +
                  case 'boolean':
         
     | 
| 
      
 6625 
     | 
    
         
            +
                    return "" + o;
         
     | 
| 
      
 6626 
     | 
    
         
            +
                  case 'number':
         
     | 
| 
      
 6627 
     | 
    
         
            +
                    if (isNaN(o)) {
         
     | 
| 
      
 6628 
     | 
    
         
            +
                      throw "literal NaN not supported!";
         
     | 
| 
      
 6629 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6630 
     | 
    
         
            +
                    if (o === Infinity) {
         
     | 
| 
      
 6631 
     | 
    
         
            +
                      return '(1.0/0)';
         
     | 
| 
      
 6632 
     | 
    
         
            +
                    } else if (o === -Infinity) {
         
     | 
| 
      
 6633 
     | 
    
         
            +
                      return '(-1.0/0)';
         
     | 
| 
      
 6634 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6635 
     | 
    
         
            +
                      return "" + o;
         
     | 
| 
      
 6636 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6637 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 6638 
     | 
    
         
            +
                  case 'object':
         
     | 
| 
      
 6639 
     | 
    
         
            +
                    return '{' + ((function() {
         
     | 
| 
      
 6640 
     | 
    
         
            +
                      var _results;
         
     | 
| 
      
 6641 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6642 
     | 
    
         
            +
                      for (k in o) {
         
     | 
| 
      
 6643 
     | 
    
         
            +
                        if (!__hasProp.call(o, k)) continue;
         
     | 
| 
      
 6644 
     | 
    
         
            +
                        v = o[k];
         
     | 
| 
      
 6645 
     | 
    
         
            +
                        _results.push(inspectLiteral(k) + '=>' + inspectLiteral(v));
         
     | 
| 
      
 6646 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6647 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6648 
     | 
    
         
            +
                    })()).join(',') + '}';
         
     | 
| 
      
 6649 
     | 
    
         
            +
                  default:
         
     | 
| 
      
 6650 
     | 
    
         
            +
                    throw new Error("unknown literal " + o);
         
     | 
| 
      
 6651 
     | 
    
         
            +
                }
         
     | 
| 
      
 6652 
     | 
    
         
            +
              };
         
     | 
| 
      
 6653 
     | 
    
         
            +
             
     | 
| 
      
 6654 
     | 
    
         
            +
              Ruby.prototype.toRuby = function() {
         
     | 
| 
      
 6655 
     | 
    
         
            +
                return this.cases({
         
     | 
| 
      
 6656 
     | 
    
         
            +
                  rescue: function(e, d) {
         
     | 
| 
      
 6657 
     | 
    
         
            +
                    return "begin;" + (e.toRuby()) + ";rescue E;" + (d.toRuby()) + ";end";
         
     | 
| 
      
 6658 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6659 
     | 
    
         
            +
                  ident: function(name) {
         
     | 
| 
      
 6660 
     | 
    
         
            +
                    return name;
         
     | 
| 
      
 6661 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6662 
     | 
    
         
            +
                  brackets: function(expr, arg) {
         
     | 
| 
      
 6663 
     | 
    
         
            +
                    return "" + (expr.toRuby()) + "[" + (arg.toRuby()) + "]";
         
     | 
| 
      
 6664 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6665 
     | 
    
         
            +
                  array: function(elements) {
         
     | 
| 
      
 6666 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6667 
     | 
    
         
            +
                    return "[" + (((function() {
         
     | 
| 
      
 6668 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6669 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6670 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6671 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6672 
     | 
    
         
            +
                        _results.push(e.toRuby());
         
     | 
| 
      
 6673 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6674 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6675 
     | 
    
         
            +
                    })()).join(',')) + "]";
         
     | 
| 
      
 6676 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6677 
     | 
    
         
            +
                  group: function(statements) {
         
     | 
| 
      
 6678 
     | 
    
         
            +
                    var s;
         
     | 
| 
      
 6679 
     | 
    
         
            +
                    return "(" + (((function() {
         
     | 
| 
      
 6680 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6681 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6682 
     | 
    
         
            +
                      for (_i = 0, _len = statements.length; _i < _len; _i++) {
         
     | 
| 
      
 6683 
     | 
    
         
            +
                        s = statements[_i];
         
     | 
| 
      
 6684 
     | 
    
         
            +
                        _results.push(s.toRuby());
         
     | 
| 
      
 6685 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6686 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6687 
     | 
    
         
            +
                    })()).join(';')) + ")";
         
     | 
| 
      
 6688 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6689 
     | 
    
         
            +
                  op1: function(op, arg) {
         
     | 
| 
      
 6690 
     | 
    
         
            +
                    return "(" + op + " " + (arg.toRuby()) + ")";
         
     | 
| 
      
 6691 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6692 
     | 
    
         
            +
                  op2: function(op, lhs, rhs) {
         
     | 
| 
      
 6693 
     | 
    
         
            +
                    return "(" + (lhs.toRuby()) + " " + op + " " + (rhs.toRuby()) + ")";
         
     | 
| 
      
 6694 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6695 
     | 
    
         
            +
                  assign: function(lval, rval) {
         
     | 
| 
      
 6696 
     | 
    
         
            +
                    return "(" + (lval.toRuby()) + "=" + (rval.toRuby()) + ")";
         
     | 
| 
      
 6697 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6698 
     | 
    
         
            +
                  paren: function(elements) {
         
     | 
| 
      
 6699 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6700 
     | 
    
         
            +
                    return "(" + (((function() {
         
     | 
| 
      
 6701 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6702 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6703 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6704 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6705 
     | 
    
         
            +
                        _results.push(e.toRuby());
         
     | 
| 
      
 6706 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6707 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6708 
     | 
    
         
            +
                    })()).join(',')) + ")";
         
     | 
| 
      
 6709 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6710 
     | 
    
         
            +
                  literal: function(value) {
         
     | 
| 
      
 6711 
     | 
    
         
            +
                    return inspectLiteral(value);
         
     | 
| 
      
 6712 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6713 
     | 
    
         
            +
                  symbol: function(name) {
         
     | 
| 
      
 6714 
     | 
    
         
            +
                    return ":" + name;
         
     | 
| 
      
 6715 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6716 
     | 
    
         
            +
                  branch: function(cond, ifTrue, ifFalse) {
         
     | 
| 
      
 6717 
     | 
    
         
            +
                    if (ifFalse != null) {
         
     | 
| 
      
 6718 
     | 
    
         
            +
                      return "if " + (cond.toRuby()) + " then " + (ifTrue.toRuby()) + " else " + (ifFalse.toRuby()) + " end";
         
     | 
| 
      
 6719 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6720 
     | 
    
         
            +
                      return "if " + (cond.toRuby()) + " then " + (ifTrue.toRuby()) + " end";
         
     | 
| 
      
 6721 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6722 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6723 
     | 
    
         
            +
                  mcall: function(target, name, args, blockArgs, block) {
         
     | 
| 
      
 6724 
     | 
    
         
            +
                    var a, l, out;
         
     | 
| 
      
 6725 
     | 
    
         
            +
                    out = [];
         
     | 
| 
      
 6726 
     | 
    
         
            +
                    if (target != null) {
         
     | 
| 
      
 6727 
     | 
    
         
            +
                      out.push("" + (target.toRuby()) + ".");
         
     | 
| 
      
 6728 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6729 
     | 
    
         
            +
                    out.push(name);
         
     | 
| 
      
 6730 
     | 
    
         
            +
                    if (args.length) {
         
     | 
| 
      
 6731 
     | 
    
         
            +
                      out.push("(" + (((function() {
         
     | 
| 
      
 6732 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6733 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6734 
     | 
    
         
            +
                        for (_i = 0, _len = args.length; _i < _len; _i++) {
         
     | 
| 
      
 6735 
     | 
    
         
            +
                          a = args[_i];
         
     | 
| 
      
 6736 
     | 
    
         
            +
                          _results.push(a.toRuby());
         
     | 
| 
      
 6737 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6738 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6739 
     | 
    
         
            +
                      })()).join(',')) + ")");
         
     | 
| 
      
 6740 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6741 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6742 
     | 
    
         
            +
                      out.push('{');
         
     | 
| 
      
 6743 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6744 
     | 
    
         
            +
                    if (blockArgs.length) {
         
     | 
| 
      
 6745 
     | 
    
         
            +
                      out.push("|" + (((function() {
         
     | 
| 
      
 6746 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6747 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6748 
     | 
    
         
            +
                        for (_i = 0, _len = blockArgs.length; _i < _len; _i++) {
         
     | 
| 
      
 6749 
     | 
    
         
            +
                          a = blockArgs[_i];
         
     | 
| 
      
 6750 
     | 
    
         
            +
                          _results.push(a.toRuby());
         
     | 
| 
      
 6751 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6752 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6753 
     | 
    
         
            +
                      })()).join(',')) + "|");
         
     | 
| 
      
 6754 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6755 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6756 
     | 
    
         
            +
                      out.push(((function() {
         
     | 
| 
      
 6757 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6758 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6759 
     | 
    
         
            +
                        for (_i = 0, _len = block.length; _i < _len; _i++) {
         
     | 
| 
      
 6760 
     | 
    
         
            +
                          l = block[_i];
         
     | 
| 
      
 6761 
     | 
    
         
            +
                          _results.push(l.toRuby());
         
     | 
| 
      
 6762 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6763 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6764 
     | 
    
         
            +
                      })()).join(';'));
         
     | 
| 
      
 6765 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6766 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6767 
     | 
    
         
            +
                      out.push('}');
         
     | 
| 
      
 6768 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6769 
     | 
    
         
            +
                    return out.join('');
         
     | 
| 
      
 6770 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6771 
     | 
    
         
            +
                });
         
     | 
| 
      
 6772 
     | 
    
         
            +
              };
         
     | 
| 
      
 6773 
     | 
    
         
            +
             
     | 
| 
      
 6774 
     | 
    
         
            +
              return Ruby;
         
     | 
| 
      
 6775 
     | 
    
         
            +
             
     | 
| 
      
 6776 
     | 
    
         
            +
            })(Variant);
         
     | 
| 
      
 6777 
     | 
    
         
            +
             
     | 
| 
      
 6778 
     | 
    
         
            +
            Gibbon.compileRuby = (function() {
         
     | 
| 
      
 6779 
     | 
    
         
            +
              var compileCore, id, idForLocal, lit, nextSym, nil;
         
     | 
| 
      
 6780 
     | 
    
         
            +
              id = Ruby.ident;
         
     | 
| 
      
 6781 
     | 
    
         
            +
              lit = Ruby.literal;
         
     | 
| 
      
 6782 
     | 
    
         
            +
              nextSym = Ruby.symbol('next');
         
     | 
| 
      
 6783 
     | 
    
         
            +
              nil = id('nil');
         
     | 
| 
      
 6784 
     | 
    
         
            +
              idForLocal = function(key) {
         
     | 
| 
      
 6785 
     | 
    
         
            +
                return '_local' + key.length + key.replace(/\//g, '_slash_').replace(/-/g, '_dash_');
         
     | 
| 
      
 6786 
     | 
    
         
            +
              };
         
     | 
| 
      
 6787 
     | 
    
         
            +
              compileCore = function(core, nextVar, currentKey) {
         
     | 
| 
      
 6788 
     | 
    
         
            +
                var localOrElse, r;
         
     | 
| 
      
 6789 
     | 
    
         
            +
                if (nextVar == null) {
         
     | 
| 
      
 6790 
     | 
    
         
            +
                  nextVar = null;
         
     | 
| 
      
 6791 
     | 
    
         
            +
                }
         
     | 
| 
      
 6792 
     | 
    
         
            +
                if (currentKey == null) {
         
     | 
| 
      
 6793 
     | 
    
         
            +
                  currentKey = '/';
         
     | 
| 
      
 6794 
     | 
    
         
            +
                }
         
     | 
| 
      
 6795 
     | 
    
         
            +
                r = function(c, n, k) {
         
     | 
| 
      
 6796 
     | 
    
         
            +
                  if (n == null) {
         
     | 
| 
      
 6797 
     | 
    
         
            +
                    n = nextVar;
         
     | 
| 
      
 6798 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6799 
     | 
    
         
            +
                  if (k == null) {
         
     | 
| 
      
 6800 
     | 
    
         
            +
                    k = currentKey;
         
     | 
| 
      
 6801 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6802 
     | 
    
         
            +
                  return compileCore(c, n, k);
         
     | 
| 
      
 6803 
     | 
    
         
            +
                };
         
     | 
| 
      
 6804 
     | 
    
         
            +
                localOrElse = function(key, errorCase, nonErrorFn) {
         
     | 
| 
      
 6805 
     | 
    
         
            +
                  var localId;
         
     | 
| 
      
 6806 
     | 
    
         
            +
                  localId = id(idForLocal(key));
         
     | 
| 
      
 6807 
     | 
    
         
            +
                  if (errorCase === void 0) {
         
     | 
| 
      
 6808 
     | 
    
         
            +
                    errorCase = Ruby.raise([localId.bracket(Ruby.symbol('error'))]);
         
     | 
| 
      
 6809 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6810 
     | 
    
         
            +
                  nonErrorFn || (nonErrorFn = function(val) {
         
     | 
| 
      
 6811 
     | 
    
         
            +
                    return val;
         
     | 
| 
      
 6812 
     | 
    
         
            +
                  });
         
     | 
| 
      
 6813 
     | 
    
         
            +
                  return Ruby.group([id('__client').mcall('local_dependency!', [lit(currentKey), lit(key)]), localId.bracket(Ruby.symbol('status')).op2('==', Ruby.symbol('success')).branch(nonErrorFn(localId.bracket(Ruby.symbol('value'))), errorCase)]);
         
     | 
| 
      
 6814 
     | 
    
         
            +
                };
         
     | 
| 
      
 6815 
     | 
    
         
            +
                return core.cases({
         
     | 
| 
      
 6816 
     | 
    
         
            +
                  global: function() {
         
     | 
| 
      
 6817 
     | 
    
         
            +
                    return id('__global');
         
     | 
| 
      
 6818 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6819 
     | 
    
         
            +
                  constant: function(value) {
         
     | 
| 
      
 6820 
     | 
    
         
            +
                    return lit(value);
         
     | 
| 
      
 6821 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6822 
     | 
    
         
            +
                  variable: function(name) {
         
     | 
| 
      
 6823 
     | 
    
         
            +
                    if (nextVar === name) {
         
     | 
| 
      
 6824 
     | 
    
         
            +
                      return nextSym;
         
     | 
| 
      
 6825 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6826 
     | 
    
         
            +
                      return id(name);
         
     | 
| 
      
 6827 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6828 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6829 
     | 
    
         
            +
                  branch: function(cond, t, f) {
         
     | 
| 
      
 6830 
     | 
    
         
            +
                    return r(cond).branch(r(t), r(f));
         
     | 
| 
      
 6831 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6832 
     | 
    
         
            +
                  delist: function(expr, index) {
         
     | 
| 
      
 6833 
     | 
    
         
            +
                    return r(expr).bracket(r(index));
         
     | 
| 
      
 6834 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6835 
     | 
    
         
            +
                  depair: function(expr, index) {
         
     | 
| 
      
 6836 
     | 
    
         
            +
                    index = index === 'first' ? 0 : 1;
         
     | 
| 
      
 6837 
     | 
    
         
            +
                    return r(expr).bracket(lit(index));
         
     | 
| 
      
 6838 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6839 
     | 
    
         
            +
                  pair: function(first, second) {
         
     | 
| 
      
 6840 
     | 
    
         
            +
                    return Ruby.array([r(first), r(second)]);
         
     | 
| 
      
 6841 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6842 
     | 
    
         
            +
                  list: function(elements) {
         
     | 
| 
      
 6843 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6844 
     | 
    
         
            +
                    return Ruby.array((function() {
         
     | 
| 
      
 6845 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6846 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6847 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6848 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6849 
     | 
    
         
            +
                        _results.push(r(e));
         
     | 
| 
      
 6850 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6851 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6852 
     | 
    
         
            +
                    })());
         
     | 
| 
      
 6853 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6854 
     | 
    
         
            +
                  foldList: function(list, out, arg, accumArg, idxArg, body) {
         
     | 
| 
      
 6855 
     | 
    
         
            +
                    var iterArgs, iterBody, reversed;
         
     | 
| 
      
 6856 
     | 
    
         
            +
                    if (body.containsInNonTailPosition(Core.variable(accumArg))) {
         
     | 
| 
      
 6857 
     | 
    
         
            +
                      reversed = r(list).mcall('each_with_index').mcall('to_a').mcall('reverse');
         
     | 
| 
      
 6858 
     | 
    
         
            +
                      iterArgs = [id(accumArg), Ruby.paren([id(arg), id(idxArg)])];
         
     | 
| 
      
 6859 
     | 
    
         
            +
                      iterBody = [r(body)];
         
     | 
| 
      
 6860 
     | 
    
         
            +
                      return reversed.mcall('inject', [r(out)], iterArgs, iterBody);
         
     | 
| 
      
 6861 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6862 
     | 
    
         
            +
                      body = [id(accumArg).assign(r(body, accumArg)), Ruby.breakUnless(id(accumArg).op2('==', nextSym))];
         
     | 
| 
      
 6863 
     | 
    
         
            +
                      return Ruby.group([id(accumArg).assign(nextSym), r(list).mcall('each_with_index', [], [id(arg), id(idxArg)], body), id(accumArg).op2('==', nextSym).branch(r(out), id(accumArg))]);
         
     | 
| 
      
 6864 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6865 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6866 
     | 
    
         
            +
                  mapList: function(list, arg, idxArg, body) {
         
     | 
| 
      
 6867 
     | 
    
         
            +
                    var blockArgs, target, _ref20;
         
     | 
| 
      
 6868 
     | 
    
         
            +
                    _ref20 = body.contains(Core.variable(idxArg)) ? [r(list).mcall('each_with_index'), [id(arg), id(idxArg)]] : [r(list), [id(arg)]], target = _ref20[0], blockArgs = _ref20[1];
         
     | 
| 
      
 6869 
     | 
    
         
            +
                    return target.mcall('map', [], blockArgs, [r(body)]);
         
     | 
| 
      
 6870 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6871 
     | 
    
         
            +
                  filterList: function(list, arg, body) {
         
     | 
| 
      
 6872 
     | 
    
         
            +
                    return r(list).mcall('select', [], [id(arg)], [r(body)]);
         
     | 
| 
      
 6873 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6874 
     | 
    
         
            +
                  squishList: function(list) {
         
     | 
| 
      
 6875 
     | 
    
         
            +
                    return list.cases({
         
     | 
| 
      
 6876 
     | 
    
         
            +
                      list: function(elements) {
         
     | 
| 
      
 6877 
     | 
    
         
            +
                        var e, out, statements, yielder, _i, _len;
         
     | 
| 
      
 6878 
     | 
    
         
            +
                        yielder = id(nameGen('y'));
         
     | 
| 
      
 6879 
     | 
    
         
            +
                        out = id(nameGen('out'));
         
     | 
| 
      
 6880 
     | 
    
         
            +
                        statements = [];
         
     | 
| 
      
 6881 
     | 
    
         
            +
                        statements.push(out.assign(Ruby.array([])));
         
     | 
| 
      
 6882 
     | 
    
         
            +
                        for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6883 
     | 
    
         
            +
                          e = elements[_i];
         
     | 
| 
      
 6884 
     | 
    
         
            +
                          if (e.alwaysSucceeds()) {
         
     | 
| 
      
 6885 
     | 
    
         
            +
                            statements.push(out.mcall('push', [r(e)]));
         
     | 
| 
      
 6886 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 6887 
     | 
    
         
            +
                            statements.push(e.cases({
         
     | 
| 
      
 6888 
     | 
    
         
            +
                              localQuery: function(key) {
         
     | 
| 
      
 6889 
     | 
    
         
            +
                                return localOrElse(key, null, function(value) {
         
     | 
| 
      
 6890 
     | 
    
         
            +
                                  return out.mcall('push', [value]);
         
     | 
| 
      
 6891 
     | 
    
         
            +
                                });
         
     | 
| 
      
 6892 
     | 
    
         
            +
                              },
         
     | 
| 
      
 6893 
     | 
    
         
            +
                              other: function() {
         
     | 
| 
      
 6894 
     | 
    
         
            +
                                return out.mcall('push', [r(e)]).rescue(nil);
         
     | 
| 
      
 6895 
     | 
    
         
            +
                              }
         
     | 
| 
      
 6896 
     | 
    
         
            +
                            }));
         
     | 
| 
      
 6897 
     | 
    
         
            +
                          }
         
     | 
| 
      
 6898 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6899 
     | 
    
         
            +
                        statements.push(out);
         
     | 
| 
      
 6900 
     | 
    
         
            +
                        return Ruby.group(statements);
         
     | 
| 
      
 6901 
     | 
    
         
            +
                      },
         
     | 
| 
      
 6902 
     | 
    
         
            +
                      other: function() {
         
     | 
| 
      
 6903 
     | 
    
         
            +
                        throw "can't squish a non-list node";
         
     | 
| 
      
 6904 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6905 
     | 
    
         
            +
                    });
         
     | 
| 
      
 6906 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6907 
     | 
    
         
            +
                  zipLists: function(first, second) {
         
     | 
| 
      
 6908 
     | 
    
         
            +
                    return r(first).mcall('zip', [r(second)]);
         
     | 
| 
      
 6909 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6910 
     | 
    
         
            +
                  len: function(list) {
         
     | 
| 
      
 6911 
     | 
    
         
            +
                    return r(list).mcall('size');
         
     | 
| 
      
 6912 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6913 
     | 
    
         
            +
                  block: function(name, body) {
         
     | 
| 
      
 6914 
     | 
    
         
            +
                    return Ruby.mcall(null, 'lambda', [], [id(name)], [r(body)]);
         
     | 
| 
      
 6915 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6916 
     | 
    
         
            +
                  app: function(block, arg) {
         
     | 
| 
      
 6917 
     | 
    
         
            +
                    return r(block).mcall('call', r(arg));
         
     | 
| 
      
 6918 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6919 
     | 
    
         
            +
                  query: function(expr, annotations) {
         
     | 
| 
      
 6920 
     | 
    
         
            +
                    var type, _ref20;
         
     | 
| 
      
 6921 
     | 
    
         
            +
                    _ref20 = annotations, annotations = _ref20.annotations, type = _ref20.type;
         
     | 
| 
      
 6922 
     | 
    
         
            +
                    return id('__client').mcall('query!', [lit(currentKey), lit(annotations), lit(type), r(expr)]);
         
     | 
| 
      
 6923 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6924 
     | 
    
         
            +
                  localQuery: function(key) {
         
     | 
| 
      
 6925 
     | 
    
         
            +
                    return localOrElse(key);
         
     | 
| 
      
 6926 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6927 
     | 
    
         
            +
                  fail: function(message) {
         
     | 
| 
      
 6928 
     | 
    
         
            +
                    return Ruby.raise([id('E'), lit(message)]);
         
     | 
| 
      
 6929 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6930 
     | 
    
         
            +
                  rescue: function(expr, def) {
         
     | 
| 
      
 6931 
     | 
    
         
            +
                    return expr.cases({
         
     | 
| 
      
 6932 
     | 
    
         
            +
                      local: function(key) {
         
     | 
| 
      
 6933 
     | 
    
         
            +
                        return localOrElse(key, r(def));
         
     | 
| 
      
 6934 
     | 
    
         
            +
                      },
         
     | 
| 
      
 6935 
     | 
    
         
            +
                      other: function() {
         
     | 
| 
      
 6936 
     | 
    
         
            +
                        return r(expr).rescue(r(def));
         
     | 
| 
      
 6937 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6938 
     | 
    
         
            +
                    });
         
     | 
| 
      
 6939 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6940 
     | 
    
         
            +
                  op1: function(o, expr) {
         
     | 
| 
      
 6941 
     | 
    
         
            +
                    return r(expr).op1(o);
         
     | 
| 
      
 6942 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6943 
     | 
    
         
            +
                  op2: function(o, lhs, rhs) {
         
     | 
| 
      
 6944 
     | 
    
         
            +
                    if (o === '===') {
         
     | 
| 
      
 6945 
     | 
    
         
            +
                      o = '==';
         
     | 
| 
      
 6946 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6947 
     | 
    
         
            +
                    return r(lhs).op2(o, r(rhs));
         
     | 
| 
      
 6948 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6949 
     | 
    
         
            +
                  bind: function(name, value, expr) {
         
     | 
| 
      
 6950 
     | 
    
         
            +
                    return Ruby.group([id(name).assign(r(value)), r(expr)]);
         
     | 
| 
      
 6951 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6952 
     | 
    
         
            +
                });
         
     | 
| 
      
 6953 
     | 
    
         
            +
              };
         
     | 
| 
      
 6954 
     | 
    
         
            +
              return function(semantics) {
         
     | 
| 
      
 6955 
     | 
    
         
            +
                var key, keys, optimize, out, processKey, seen, translate, _i, _len;
         
     | 
| 
      
 6956 
     | 
    
         
            +
                optimize = Gibbon.optimize, translate = Gibbon.translate;
         
     | 
| 
      
 6957 
     | 
    
         
            +
                keys = semantics.keys();
         
     | 
| 
      
 6958 
     | 
    
         
            +
                seen = new Hash;
         
     | 
| 
      
 6959 
     | 
    
         
            +
                out = [];
         
     | 
| 
      
 6960 
     | 
    
         
            +
                processKey = function(key) {
         
     | 
| 
      
 6961 
     | 
    
         
            +
                  var compiledRuby, dep, _i, _len, _ref20;
         
     | 
| 
      
 6962 
     | 
    
         
            +
                  if (seen.has(key)) {
         
     | 
| 
      
 6963 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 6964 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6965 
     | 
    
         
            +
                  seen.set(key, true);
         
     | 
| 
      
 6966 
     | 
    
         
            +
                  _ref20 = semantics.get(key).dependencies;
         
     | 
| 
      
 6967 
     | 
    
         
            +
                  for (_i = 0, _len = _ref20.length; _i < _len; _i++) {
         
     | 
| 
      
 6968 
     | 
    
         
            +
                    dep = _ref20[_i];
         
     | 
| 
      
 6969 
     | 
    
         
            +
                    if (dep._tag === 'local') {
         
     | 
| 
      
 6970 
     | 
    
         
            +
                      processKey(dep.name);
         
     | 
| 
      
 6971 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6972 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6973 
     | 
    
         
            +
                  compiledRuby = compileCore(optimize(translate(semantics.get(key))), null, key).toRuby();
         
     | 
| 
      
 6974 
     | 
    
         
            +
                  return out.push("" + (idForLocal(key)) + " = begin\n  {:status=>:success,:value=>(" + compiledRuby + ")}\nrescue E => e\n  {:status=>:failure,:error=>e}\nend");
         
     | 
| 
      
 6975 
     | 
    
         
            +
                };
         
     | 
| 
      
 6976 
     | 
    
         
            +
                for (_i = 0, _len = keys.length; _i < _len; _i++) {
         
     | 
| 
      
 6977 
     | 
    
         
            +
                  key = keys[_i];
         
     | 
| 
      
 6978 
     | 
    
         
            +
                  processKey(key);
         
     | 
| 
      
 6979 
     | 
    
         
            +
                }
         
     | 
| 
      
 6980 
     | 
    
         
            +
                out.push('{');
         
     | 
| 
      
 6981 
     | 
    
         
            +
                out.push(((function() {
         
     | 
| 
      
 6982 
     | 
    
         
            +
                  var _j, _len1, _results;
         
     | 
| 
      
 6983 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 6984 
     | 
    
         
            +
                  for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
         
     | 
| 
      
 6985 
     | 
    
         
            +
                    key = keys[_j];
         
     | 
| 
      
 6986 
     | 
    
         
            +
                    _results.push("" + (lit(key).toRuby()) + " => " + (idForLocal(key)));
         
     | 
| 
      
 6987 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6988 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 6989 
     | 
    
         
            +
                })()).join(','));
         
     | 
| 
      
 6990 
     | 
    
         
            +
                out.push('}');
         
     | 
| 
      
 6991 
     | 
    
         
            +
                return out.join("\n");
         
     | 
| 
      
 6992 
     | 
    
         
            +
              };
         
     | 
| 
      
 6993 
     | 
    
         
            +
            })();
         
     | 
| 
      
 6994 
     | 
    
         
            +
             
     | 
| 
       6532 
6995 
     | 
    
         
             
            Gibbon.jsonConsumer = (function() {
         
     | 
| 
       6533 
6996 
     | 
    
         
             
              return function(tables) {
         
     | 
| 
       6534 
6997 
     | 
    
         
             
                var analyzeList, getType, getValue, listLookup, lists;
         
     | 
| 
         @@ -469,7 +469,7 @@ Parsimmon.Parser = P(function(_, _super, Parser) { 
     | 
|
| 
       469 
469 
     | 
    
         
             
              return Parsimmon;
         
     | 
| 
       470 
470 
     | 
    
         
             
            })()
         
     | 
| 
       471 
471 
     | 
    
         
             
            // Generated by CoffeeScript 1.6.3
         
     | 
| 
       472 
     | 
    
         
            -
            var AST, CompiledCode, Core, DEBUG, Dependency, Failure, Gibbon, Hash, JS, List, Map, ObjHash, RVal, Result, Semantic, Step, Thunk, Trace, Type, TypeAST, TypeExpr, TypeLookup, Value, VarTrace, Variant, analyze, applyOp1, applyOp2, asyncMap, contIter, contMap, equalArrays, eval_, inspectNative, isArray, nameGen, parse, stdlib, uniq, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
         
     | 
| 
      
 472 
     | 
    
         
            +
            var AST, CompiledCode, Core, DEBUG, Dependency, Failure, Gibbon, Hash, JS, List, Map, ObjHash, RVal, Result, Ruby, Semantic, Step, Thunk, Trace, Type, TypeAST, TypeExpr, TypeLookup, Value, VarTrace, Variant, analyze, applyOp1, applyOp2, asyncMap, contIter, contMap, equalArrays, eval_, inspectNative, isArray, nameGen, parse, stdlib, uniq, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
         
     | 
| 
       473 
473 
     | 
    
         
             
              __slice = [].slice,
         
     | 
| 
       474 
474 
     | 
    
         
             
              __hasProp = {}.hasOwnProperty,
         
     | 
| 
       475 
475 
     | 
    
         
             
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
         
     | 
| 
         @@ -6466,6 +6466,469 @@ Gibbon.compile = function(semantics) { 
     | 
|
| 
       6466 
6466 
     | 
    
         
             
              return new CompiledCode(semantics, compiled);
         
     | 
| 
       6467 
6467 
     | 
    
         
             
            };
         
     | 
| 
       6468 
6468 
     | 
    
         | 
| 
      
 6469 
     | 
    
         
            +
            Ruby = (function(_super) {
         
     | 
| 
      
 6470 
     | 
    
         
            +
              var inspectLiteral;
         
     | 
| 
      
 6471 
     | 
    
         
            +
             
     | 
| 
      
 6472 
     | 
    
         
            +
              __extends(Ruby, _super);
         
     | 
| 
      
 6473 
     | 
    
         
            +
             
     | 
| 
      
 6474 
     | 
    
         
            +
              function Ruby() {
         
     | 
| 
      
 6475 
     | 
    
         
            +
                _ref19 = Ruby.__super__.constructor.apply(this, arguments);
         
     | 
| 
      
 6476 
     | 
    
         
            +
                return _ref19;
         
     | 
| 
      
 6477 
     | 
    
         
            +
              }
         
     | 
| 
      
 6478 
     | 
    
         
            +
             
     | 
| 
      
 6479 
     | 
    
         
            +
              Ruby.variants({
         
     | 
| 
      
 6480 
     | 
    
         
            +
                branch: ['cond', 'ifTrue', 'ifFalse'],
         
     | 
| 
      
 6481 
     | 
    
         
            +
                guard: ['cond', 'expr'],
         
     | 
| 
      
 6482 
     | 
    
         
            +
                rescue: ['expr', 'default'],
         
     | 
| 
      
 6483 
     | 
    
         
            +
                ident: ['name'],
         
     | 
| 
      
 6484 
     | 
    
         
            +
                brackets: ['expr', 'arg'],
         
     | 
| 
      
 6485 
     | 
    
         
            +
                array: ['elements'],
         
     | 
| 
      
 6486 
     | 
    
         
            +
                group: ['statements'],
         
     | 
| 
      
 6487 
     | 
    
         
            +
                op1: ['op', 'arg'],
         
     | 
| 
      
 6488 
     | 
    
         
            +
                op2: ['op', 'lhs', 'rhs'],
         
     | 
| 
      
 6489 
     | 
    
         
            +
                assign: ['lval', 'rval'],
         
     | 
| 
      
 6490 
     | 
    
         
            +
                paren: ['elements'],
         
     | 
| 
      
 6491 
     | 
    
         
            +
                literal: ['value'],
         
     | 
| 
      
 6492 
     | 
    
         
            +
                symbol: ['name'],
         
     | 
| 
      
 6493 
     | 
    
         
            +
                mcall: ['target', 'name', 'args', 'blockArgs', 'block']
         
     | 
| 
      
 6494 
     | 
    
         
            +
              });
         
     | 
| 
      
 6495 
     | 
    
         
            +
             
     | 
| 
      
 6496 
     | 
    
         
            +
              Ruby.raise = function(args) {
         
     | 
| 
      
 6497 
     | 
    
         
            +
                return this.mcall(null, 'raise', args, [], null);
         
     | 
| 
      
 6498 
     | 
    
         
            +
              };
         
     | 
| 
      
 6499 
     | 
    
         
            +
             
     | 
| 
      
 6500 
     | 
    
         
            +
              Ruby.breakUnless = function(cond) {
         
     | 
| 
      
 6501 
     | 
    
         
            +
                return cond.op2('||', this.ident('break'));
         
     | 
| 
      
 6502 
     | 
    
         
            +
              };
         
     | 
| 
      
 6503 
     | 
    
         
            +
             
     | 
| 
      
 6504 
     | 
    
         
            +
              Ruby.prototype.branch = function(t, f) {
         
     | 
| 
      
 6505 
     | 
    
         
            +
                return Ruby.branch(this, t, f);
         
     | 
| 
      
 6506 
     | 
    
         
            +
              };
         
     | 
| 
      
 6507 
     | 
    
         
            +
             
     | 
| 
      
 6508 
     | 
    
         
            +
              Ruby.prototype.rescue = function(d) {
         
     | 
| 
      
 6509 
     | 
    
         
            +
                return Ruby.rescue(this, d);
         
     | 
| 
      
 6510 
     | 
    
         
            +
              };
         
     | 
| 
      
 6511 
     | 
    
         
            +
             
     | 
| 
      
 6512 
     | 
    
         
            +
              Ruby.prototype.bracket = function(a) {
         
     | 
| 
      
 6513 
     | 
    
         
            +
                return Ruby.brackets(this, a);
         
     | 
| 
      
 6514 
     | 
    
         
            +
              };
         
     | 
| 
      
 6515 
     | 
    
         
            +
             
     | 
| 
      
 6516 
     | 
    
         
            +
              Ruby.prototype.op1 = function(o) {
         
     | 
| 
      
 6517 
     | 
    
         
            +
                return Ruby.op1(o, this);
         
     | 
| 
      
 6518 
     | 
    
         
            +
              };
         
     | 
| 
      
 6519 
     | 
    
         
            +
             
     | 
| 
      
 6520 
     | 
    
         
            +
              Ruby.prototype.op2 = function(o, e) {
         
     | 
| 
      
 6521 
     | 
    
         
            +
                return Ruby.op2(o, this, e);
         
     | 
| 
      
 6522 
     | 
    
         
            +
              };
         
     | 
| 
      
 6523 
     | 
    
         
            +
             
     | 
| 
      
 6524 
     | 
    
         
            +
              Ruby.prototype.assign = function(rval) {
         
     | 
| 
      
 6525 
     | 
    
         
            +
                return Ruby.assign(this, rval);
         
     | 
| 
      
 6526 
     | 
    
         
            +
              };
         
     | 
| 
      
 6527 
     | 
    
         
            +
             
     | 
| 
      
 6528 
     | 
    
         
            +
              Ruby.prototype.mcall = function(name, args, blockArgs, block) {
         
     | 
| 
      
 6529 
     | 
    
         
            +
                if (args == null) {
         
     | 
| 
      
 6530 
     | 
    
         
            +
                  args = [];
         
     | 
| 
      
 6531 
     | 
    
         
            +
                }
         
     | 
| 
      
 6532 
     | 
    
         
            +
                if (blockArgs == null) {
         
     | 
| 
      
 6533 
     | 
    
         
            +
                  blockArgs = [];
         
     | 
| 
      
 6534 
     | 
    
         
            +
                }
         
     | 
| 
      
 6535 
     | 
    
         
            +
                if (block == null) {
         
     | 
| 
      
 6536 
     | 
    
         
            +
                  block = null;
         
     | 
| 
      
 6537 
     | 
    
         
            +
                }
         
     | 
| 
      
 6538 
     | 
    
         
            +
                return Ruby.mcall(this, name, args, blockArgs, block);
         
     | 
| 
      
 6539 
     | 
    
         
            +
              };
         
     | 
| 
      
 6540 
     | 
    
         
            +
             
     | 
| 
      
 6541 
     | 
    
         
            +
              Ruby.prototype.guard = function(expr) {
         
     | 
| 
      
 6542 
     | 
    
         
            +
                return Ruby.branch(this, expr, null);
         
     | 
| 
      
 6543 
     | 
    
         
            +
              };
         
     | 
| 
      
 6544 
     | 
    
         
            +
             
     | 
| 
      
 6545 
     | 
    
         
            +
              inspectLiteral = function(o) {
         
     | 
| 
      
 6546 
     | 
    
         
            +
                var e, k, v;
         
     | 
| 
      
 6547 
     | 
    
         
            +
                if (isArray(o)) {
         
     | 
| 
      
 6548 
     | 
    
         
            +
                  return '[' + ((function() {
         
     | 
| 
      
 6549 
     | 
    
         
            +
                    var _i, _len, _results;
         
     | 
| 
      
 6550 
     | 
    
         
            +
                    _results = [];
         
     | 
| 
      
 6551 
     | 
    
         
            +
                    for (_i = 0, _len = o.length; _i < _len; _i++) {
         
     | 
| 
      
 6552 
     | 
    
         
            +
                      e = o[_i];
         
     | 
| 
      
 6553 
     | 
    
         
            +
                      _results.push(inspectLiteral(e));
         
     | 
| 
      
 6554 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6555 
     | 
    
         
            +
                    return _results;
         
     | 
| 
      
 6556 
     | 
    
         
            +
                  })()) + ']';
         
     | 
| 
      
 6557 
     | 
    
         
            +
                }
         
     | 
| 
      
 6558 
     | 
    
         
            +
                switch (typeof o) {
         
     | 
| 
      
 6559 
     | 
    
         
            +
                  case 'string':
         
     | 
| 
      
 6560 
     | 
    
         
            +
                    return "'" + o.replace("'", "\\\\'") + "'";
         
     | 
| 
      
 6561 
     | 
    
         
            +
                  case 'boolean':
         
     | 
| 
      
 6562 
     | 
    
         
            +
                    return "" + o;
         
     | 
| 
      
 6563 
     | 
    
         
            +
                  case 'number':
         
     | 
| 
      
 6564 
     | 
    
         
            +
                    if (isNaN(o)) {
         
     | 
| 
      
 6565 
     | 
    
         
            +
                      throw "literal NaN not supported!";
         
     | 
| 
      
 6566 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6567 
     | 
    
         
            +
                    if (o === Infinity) {
         
     | 
| 
      
 6568 
     | 
    
         
            +
                      return '(1.0/0)';
         
     | 
| 
      
 6569 
     | 
    
         
            +
                    } else if (o === -Infinity) {
         
     | 
| 
      
 6570 
     | 
    
         
            +
                      return '(-1.0/0)';
         
     | 
| 
      
 6571 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6572 
     | 
    
         
            +
                      return "" + o;
         
     | 
| 
      
 6573 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6574 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 6575 
     | 
    
         
            +
                  case 'object':
         
     | 
| 
      
 6576 
     | 
    
         
            +
                    return '{' + ((function() {
         
     | 
| 
      
 6577 
     | 
    
         
            +
                      var _results;
         
     | 
| 
      
 6578 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6579 
     | 
    
         
            +
                      for (k in o) {
         
     | 
| 
      
 6580 
     | 
    
         
            +
                        if (!__hasProp.call(o, k)) continue;
         
     | 
| 
      
 6581 
     | 
    
         
            +
                        v = o[k];
         
     | 
| 
      
 6582 
     | 
    
         
            +
                        _results.push(inspectLiteral(k) + '=>' + inspectLiteral(v));
         
     | 
| 
      
 6583 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6584 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6585 
     | 
    
         
            +
                    })()).join(',') + '}';
         
     | 
| 
      
 6586 
     | 
    
         
            +
                  default:
         
     | 
| 
      
 6587 
     | 
    
         
            +
                    throw new Error("unknown literal " + o);
         
     | 
| 
      
 6588 
     | 
    
         
            +
                }
         
     | 
| 
      
 6589 
     | 
    
         
            +
              };
         
     | 
| 
      
 6590 
     | 
    
         
            +
             
     | 
| 
      
 6591 
     | 
    
         
            +
              Ruby.prototype.toRuby = function() {
         
     | 
| 
      
 6592 
     | 
    
         
            +
                return this.cases({
         
     | 
| 
      
 6593 
     | 
    
         
            +
                  rescue: function(e, d) {
         
     | 
| 
      
 6594 
     | 
    
         
            +
                    return "begin;" + (e.toRuby()) + ";rescue E;" + (d.toRuby()) + ";end";
         
     | 
| 
      
 6595 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6596 
     | 
    
         
            +
                  ident: function(name) {
         
     | 
| 
      
 6597 
     | 
    
         
            +
                    return name;
         
     | 
| 
      
 6598 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6599 
     | 
    
         
            +
                  brackets: function(expr, arg) {
         
     | 
| 
      
 6600 
     | 
    
         
            +
                    return "" + (expr.toRuby()) + "[" + (arg.toRuby()) + "]";
         
     | 
| 
      
 6601 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6602 
     | 
    
         
            +
                  array: function(elements) {
         
     | 
| 
      
 6603 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6604 
     | 
    
         
            +
                    return "[" + (((function() {
         
     | 
| 
      
 6605 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6606 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6607 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6608 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6609 
     | 
    
         
            +
                        _results.push(e.toRuby());
         
     | 
| 
      
 6610 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6611 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6612 
     | 
    
         
            +
                    })()).join(',')) + "]";
         
     | 
| 
      
 6613 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6614 
     | 
    
         
            +
                  group: function(statements) {
         
     | 
| 
      
 6615 
     | 
    
         
            +
                    var s;
         
     | 
| 
      
 6616 
     | 
    
         
            +
                    return "(" + (((function() {
         
     | 
| 
      
 6617 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6618 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6619 
     | 
    
         
            +
                      for (_i = 0, _len = statements.length; _i < _len; _i++) {
         
     | 
| 
      
 6620 
     | 
    
         
            +
                        s = statements[_i];
         
     | 
| 
      
 6621 
     | 
    
         
            +
                        _results.push(s.toRuby());
         
     | 
| 
      
 6622 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6623 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6624 
     | 
    
         
            +
                    })()).join(';')) + ")";
         
     | 
| 
      
 6625 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6626 
     | 
    
         
            +
                  op1: function(op, arg) {
         
     | 
| 
      
 6627 
     | 
    
         
            +
                    return "(" + op + " " + (arg.toRuby()) + ")";
         
     | 
| 
      
 6628 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6629 
     | 
    
         
            +
                  op2: function(op, lhs, rhs) {
         
     | 
| 
      
 6630 
     | 
    
         
            +
                    return "(" + (lhs.toRuby()) + " " + op + " " + (rhs.toRuby()) + ")";
         
     | 
| 
      
 6631 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6632 
     | 
    
         
            +
                  assign: function(lval, rval) {
         
     | 
| 
      
 6633 
     | 
    
         
            +
                    return "(" + (lval.toRuby()) + "=" + (rval.toRuby()) + ")";
         
     | 
| 
      
 6634 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6635 
     | 
    
         
            +
                  paren: function(elements) {
         
     | 
| 
      
 6636 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6637 
     | 
    
         
            +
                    return "(" + (((function() {
         
     | 
| 
      
 6638 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6639 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6640 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6641 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6642 
     | 
    
         
            +
                        _results.push(e.toRuby());
         
     | 
| 
      
 6643 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6644 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6645 
     | 
    
         
            +
                    })()).join(',')) + ")";
         
     | 
| 
      
 6646 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6647 
     | 
    
         
            +
                  literal: function(value) {
         
     | 
| 
      
 6648 
     | 
    
         
            +
                    return inspectLiteral(value);
         
     | 
| 
      
 6649 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6650 
     | 
    
         
            +
                  symbol: function(name) {
         
     | 
| 
      
 6651 
     | 
    
         
            +
                    return ":" + name;
         
     | 
| 
      
 6652 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6653 
     | 
    
         
            +
                  branch: function(cond, ifTrue, ifFalse) {
         
     | 
| 
      
 6654 
     | 
    
         
            +
                    if (ifFalse != null) {
         
     | 
| 
      
 6655 
     | 
    
         
            +
                      return "if " + (cond.toRuby()) + " then " + (ifTrue.toRuby()) + " else " + (ifFalse.toRuby()) + " end";
         
     | 
| 
      
 6656 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6657 
     | 
    
         
            +
                      return "if " + (cond.toRuby()) + " then " + (ifTrue.toRuby()) + " end";
         
     | 
| 
      
 6658 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6659 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6660 
     | 
    
         
            +
                  mcall: function(target, name, args, blockArgs, block) {
         
     | 
| 
      
 6661 
     | 
    
         
            +
                    var a, l, out;
         
     | 
| 
      
 6662 
     | 
    
         
            +
                    out = [];
         
     | 
| 
      
 6663 
     | 
    
         
            +
                    if (target != null) {
         
     | 
| 
      
 6664 
     | 
    
         
            +
                      out.push("" + (target.toRuby()) + ".");
         
     | 
| 
      
 6665 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6666 
     | 
    
         
            +
                    out.push(name);
         
     | 
| 
      
 6667 
     | 
    
         
            +
                    if (args.length) {
         
     | 
| 
      
 6668 
     | 
    
         
            +
                      out.push("(" + (((function() {
         
     | 
| 
      
 6669 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6670 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6671 
     | 
    
         
            +
                        for (_i = 0, _len = args.length; _i < _len; _i++) {
         
     | 
| 
      
 6672 
     | 
    
         
            +
                          a = args[_i];
         
     | 
| 
      
 6673 
     | 
    
         
            +
                          _results.push(a.toRuby());
         
     | 
| 
      
 6674 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6675 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6676 
     | 
    
         
            +
                      })()).join(',')) + ")");
         
     | 
| 
      
 6677 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6678 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6679 
     | 
    
         
            +
                      out.push('{');
         
     | 
| 
      
 6680 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6681 
     | 
    
         
            +
                    if (blockArgs.length) {
         
     | 
| 
      
 6682 
     | 
    
         
            +
                      out.push("|" + (((function() {
         
     | 
| 
      
 6683 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6684 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6685 
     | 
    
         
            +
                        for (_i = 0, _len = blockArgs.length; _i < _len; _i++) {
         
     | 
| 
      
 6686 
     | 
    
         
            +
                          a = blockArgs[_i];
         
     | 
| 
      
 6687 
     | 
    
         
            +
                          _results.push(a.toRuby());
         
     | 
| 
      
 6688 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6689 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6690 
     | 
    
         
            +
                      })()).join(',')) + "|");
         
     | 
| 
      
 6691 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6692 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6693 
     | 
    
         
            +
                      out.push(((function() {
         
     | 
| 
      
 6694 
     | 
    
         
            +
                        var _i, _len, _results;
         
     | 
| 
      
 6695 
     | 
    
         
            +
                        _results = [];
         
     | 
| 
      
 6696 
     | 
    
         
            +
                        for (_i = 0, _len = block.length; _i < _len; _i++) {
         
     | 
| 
      
 6697 
     | 
    
         
            +
                          l = block[_i];
         
     | 
| 
      
 6698 
     | 
    
         
            +
                          _results.push(l.toRuby());
         
     | 
| 
      
 6699 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6700 
     | 
    
         
            +
                        return _results;
         
     | 
| 
      
 6701 
     | 
    
         
            +
                      })()).join(';'));
         
     | 
| 
      
 6702 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6703 
     | 
    
         
            +
                    if (block) {
         
     | 
| 
      
 6704 
     | 
    
         
            +
                      out.push('}');
         
     | 
| 
      
 6705 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6706 
     | 
    
         
            +
                    return out.join('');
         
     | 
| 
      
 6707 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6708 
     | 
    
         
            +
                });
         
     | 
| 
      
 6709 
     | 
    
         
            +
              };
         
     | 
| 
      
 6710 
     | 
    
         
            +
             
     | 
| 
      
 6711 
     | 
    
         
            +
              return Ruby;
         
     | 
| 
      
 6712 
     | 
    
         
            +
             
     | 
| 
      
 6713 
     | 
    
         
            +
            })(Variant);
         
     | 
| 
      
 6714 
     | 
    
         
            +
             
     | 
| 
      
 6715 
     | 
    
         
            +
            Gibbon.compileRuby = (function() {
         
     | 
| 
      
 6716 
     | 
    
         
            +
              var compileCore, id, idForLocal, lit, nextSym, nil;
         
     | 
| 
      
 6717 
     | 
    
         
            +
              id = Ruby.ident;
         
     | 
| 
      
 6718 
     | 
    
         
            +
              lit = Ruby.literal;
         
     | 
| 
      
 6719 
     | 
    
         
            +
              nextSym = Ruby.symbol('next');
         
     | 
| 
      
 6720 
     | 
    
         
            +
              nil = id('nil');
         
     | 
| 
      
 6721 
     | 
    
         
            +
              idForLocal = function(key) {
         
     | 
| 
      
 6722 
     | 
    
         
            +
                return '_local' + key.length + key.replace(/\//g, '_slash_').replace(/-/g, '_dash_');
         
     | 
| 
      
 6723 
     | 
    
         
            +
              };
         
     | 
| 
      
 6724 
     | 
    
         
            +
              compileCore = function(core, nextVar, currentKey) {
         
     | 
| 
      
 6725 
     | 
    
         
            +
                var localOrElse, r;
         
     | 
| 
      
 6726 
     | 
    
         
            +
                if (nextVar == null) {
         
     | 
| 
      
 6727 
     | 
    
         
            +
                  nextVar = null;
         
     | 
| 
      
 6728 
     | 
    
         
            +
                }
         
     | 
| 
      
 6729 
     | 
    
         
            +
                if (currentKey == null) {
         
     | 
| 
      
 6730 
     | 
    
         
            +
                  currentKey = '/';
         
     | 
| 
      
 6731 
     | 
    
         
            +
                }
         
     | 
| 
      
 6732 
     | 
    
         
            +
                r = function(c, n, k) {
         
     | 
| 
      
 6733 
     | 
    
         
            +
                  if (n == null) {
         
     | 
| 
      
 6734 
     | 
    
         
            +
                    n = nextVar;
         
     | 
| 
      
 6735 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6736 
     | 
    
         
            +
                  if (k == null) {
         
     | 
| 
      
 6737 
     | 
    
         
            +
                    k = currentKey;
         
     | 
| 
      
 6738 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6739 
     | 
    
         
            +
                  return compileCore(c, n, k);
         
     | 
| 
      
 6740 
     | 
    
         
            +
                };
         
     | 
| 
      
 6741 
     | 
    
         
            +
                localOrElse = function(key, errorCase, nonErrorFn) {
         
     | 
| 
      
 6742 
     | 
    
         
            +
                  var localId;
         
     | 
| 
      
 6743 
     | 
    
         
            +
                  localId = id(idForLocal(key));
         
     | 
| 
      
 6744 
     | 
    
         
            +
                  if (errorCase === void 0) {
         
     | 
| 
      
 6745 
     | 
    
         
            +
                    errorCase = Ruby.raise([localId.bracket(Ruby.symbol('error'))]);
         
     | 
| 
      
 6746 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6747 
     | 
    
         
            +
                  nonErrorFn || (nonErrorFn = function(val) {
         
     | 
| 
      
 6748 
     | 
    
         
            +
                    return val;
         
     | 
| 
      
 6749 
     | 
    
         
            +
                  });
         
     | 
| 
      
 6750 
     | 
    
         
            +
                  return Ruby.group([id('__client').mcall('local_dependency!', [lit(currentKey), lit(key)]), localId.bracket(Ruby.symbol('status')).op2('==', Ruby.symbol('success')).branch(nonErrorFn(localId.bracket(Ruby.symbol('value'))), errorCase)]);
         
     | 
| 
      
 6751 
     | 
    
         
            +
                };
         
     | 
| 
      
 6752 
     | 
    
         
            +
                return core.cases({
         
     | 
| 
      
 6753 
     | 
    
         
            +
                  global: function() {
         
     | 
| 
      
 6754 
     | 
    
         
            +
                    return id('__global');
         
     | 
| 
      
 6755 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6756 
     | 
    
         
            +
                  constant: function(value) {
         
     | 
| 
      
 6757 
     | 
    
         
            +
                    return lit(value);
         
     | 
| 
      
 6758 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6759 
     | 
    
         
            +
                  variable: function(name) {
         
     | 
| 
      
 6760 
     | 
    
         
            +
                    if (nextVar === name) {
         
     | 
| 
      
 6761 
     | 
    
         
            +
                      return nextSym;
         
     | 
| 
      
 6762 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6763 
     | 
    
         
            +
                      return id(name);
         
     | 
| 
      
 6764 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6765 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6766 
     | 
    
         
            +
                  branch: function(cond, t, f) {
         
     | 
| 
      
 6767 
     | 
    
         
            +
                    return r(cond).branch(r(t), r(f));
         
     | 
| 
      
 6768 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6769 
     | 
    
         
            +
                  delist: function(expr, index) {
         
     | 
| 
      
 6770 
     | 
    
         
            +
                    return r(expr).bracket(r(index));
         
     | 
| 
      
 6771 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6772 
     | 
    
         
            +
                  depair: function(expr, index) {
         
     | 
| 
      
 6773 
     | 
    
         
            +
                    index = index === 'first' ? 0 : 1;
         
     | 
| 
      
 6774 
     | 
    
         
            +
                    return r(expr).bracket(lit(index));
         
     | 
| 
      
 6775 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6776 
     | 
    
         
            +
                  pair: function(first, second) {
         
     | 
| 
      
 6777 
     | 
    
         
            +
                    return Ruby.array([r(first), r(second)]);
         
     | 
| 
      
 6778 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6779 
     | 
    
         
            +
                  list: function(elements) {
         
     | 
| 
      
 6780 
     | 
    
         
            +
                    var e;
         
     | 
| 
      
 6781 
     | 
    
         
            +
                    return Ruby.array((function() {
         
     | 
| 
      
 6782 
     | 
    
         
            +
                      var _i, _len, _results;
         
     | 
| 
      
 6783 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 6784 
     | 
    
         
            +
                      for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6785 
     | 
    
         
            +
                        e = elements[_i];
         
     | 
| 
      
 6786 
     | 
    
         
            +
                        _results.push(r(e));
         
     | 
| 
      
 6787 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6788 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 6789 
     | 
    
         
            +
                    })());
         
     | 
| 
      
 6790 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6791 
     | 
    
         
            +
                  foldList: function(list, out, arg, accumArg, idxArg, body) {
         
     | 
| 
      
 6792 
     | 
    
         
            +
                    var iterArgs, iterBody, reversed;
         
     | 
| 
      
 6793 
     | 
    
         
            +
                    if (body.containsInNonTailPosition(Core.variable(accumArg))) {
         
     | 
| 
      
 6794 
     | 
    
         
            +
                      reversed = r(list).mcall('each_with_index').mcall('to_a').mcall('reverse');
         
     | 
| 
      
 6795 
     | 
    
         
            +
                      iterArgs = [id(accumArg), Ruby.paren([id(arg), id(idxArg)])];
         
     | 
| 
      
 6796 
     | 
    
         
            +
                      iterBody = [r(body)];
         
     | 
| 
      
 6797 
     | 
    
         
            +
                      return reversed.mcall('inject', [r(out)], iterArgs, iterBody);
         
     | 
| 
      
 6798 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 6799 
     | 
    
         
            +
                      body = [id(accumArg).assign(r(body, accumArg)), Ruby.breakUnless(id(accumArg).op2('==', nextSym))];
         
     | 
| 
      
 6800 
     | 
    
         
            +
                      return Ruby.group([id(accumArg).assign(nextSym), r(list).mcall('each_with_index', [], [id(arg), id(idxArg)], body), id(accumArg).op2('==', nextSym).branch(r(out), id(accumArg))]);
         
     | 
| 
      
 6801 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6802 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6803 
     | 
    
         
            +
                  mapList: function(list, arg, idxArg, body) {
         
     | 
| 
      
 6804 
     | 
    
         
            +
                    var blockArgs, target, _ref20;
         
     | 
| 
      
 6805 
     | 
    
         
            +
                    _ref20 = body.contains(Core.variable(idxArg)) ? [r(list).mcall('each_with_index'), [id(arg), id(idxArg)]] : [r(list), [id(arg)]], target = _ref20[0], blockArgs = _ref20[1];
         
     | 
| 
      
 6806 
     | 
    
         
            +
                    return target.mcall('map', [], blockArgs, [r(body)]);
         
     | 
| 
      
 6807 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6808 
     | 
    
         
            +
                  filterList: function(list, arg, body) {
         
     | 
| 
      
 6809 
     | 
    
         
            +
                    return r(list).mcall('select', [], [id(arg)], [r(body)]);
         
     | 
| 
      
 6810 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6811 
     | 
    
         
            +
                  squishList: function(list) {
         
     | 
| 
      
 6812 
     | 
    
         
            +
                    return list.cases({
         
     | 
| 
      
 6813 
     | 
    
         
            +
                      list: function(elements) {
         
     | 
| 
      
 6814 
     | 
    
         
            +
                        var e, out, statements, yielder, _i, _len;
         
     | 
| 
      
 6815 
     | 
    
         
            +
                        yielder = id(nameGen('y'));
         
     | 
| 
      
 6816 
     | 
    
         
            +
                        out = id(nameGen('out'));
         
     | 
| 
      
 6817 
     | 
    
         
            +
                        statements = [];
         
     | 
| 
      
 6818 
     | 
    
         
            +
                        statements.push(out.assign(Ruby.array([])));
         
     | 
| 
      
 6819 
     | 
    
         
            +
                        for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 6820 
     | 
    
         
            +
                          e = elements[_i];
         
     | 
| 
      
 6821 
     | 
    
         
            +
                          if (e.alwaysSucceeds()) {
         
     | 
| 
      
 6822 
     | 
    
         
            +
                            statements.push(out.mcall('push', [r(e)]));
         
     | 
| 
      
 6823 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 6824 
     | 
    
         
            +
                            statements.push(e.cases({
         
     | 
| 
      
 6825 
     | 
    
         
            +
                              localQuery: function(key) {
         
     | 
| 
      
 6826 
     | 
    
         
            +
                                return localOrElse(key, null, function(value) {
         
     | 
| 
      
 6827 
     | 
    
         
            +
                                  return out.mcall('push', [value]);
         
     | 
| 
      
 6828 
     | 
    
         
            +
                                });
         
     | 
| 
      
 6829 
     | 
    
         
            +
                              },
         
     | 
| 
      
 6830 
     | 
    
         
            +
                              other: function() {
         
     | 
| 
      
 6831 
     | 
    
         
            +
                                return out.mcall('push', [r(e)]).rescue(nil);
         
     | 
| 
      
 6832 
     | 
    
         
            +
                              }
         
     | 
| 
      
 6833 
     | 
    
         
            +
                            }));
         
     | 
| 
      
 6834 
     | 
    
         
            +
                          }
         
     | 
| 
      
 6835 
     | 
    
         
            +
                        }
         
     | 
| 
      
 6836 
     | 
    
         
            +
                        statements.push(out);
         
     | 
| 
      
 6837 
     | 
    
         
            +
                        return Ruby.group(statements);
         
     | 
| 
      
 6838 
     | 
    
         
            +
                      },
         
     | 
| 
      
 6839 
     | 
    
         
            +
                      other: function() {
         
     | 
| 
      
 6840 
     | 
    
         
            +
                        throw "can't squish a non-list node";
         
     | 
| 
      
 6841 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6842 
     | 
    
         
            +
                    });
         
     | 
| 
      
 6843 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6844 
     | 
    
         
            +
                  zipLists: function(first, second) {
         
     | 
| 
      
 6845 
     | 
    
         
            +
                    return r(first).mcall('zip', [r(second)]);
         
     | 
| 
      
 6846 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6847 
     | 
    
         
            +
                  len: function(list) {
         
     | 
| 
      
 6848 
     | 
    
         
            +
                    return r(list).mcall('size');
         
     | 
| 
      
 6849 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6850 
     | 
    
         
            +
                  block: function(name, body) {
         
     | 
| 
      
 6851 
     | 
    
         
            +
                    return Ruby.mcall(null, 'lambda', [], [id(name)], [r(body)]);
         
     | 
| 
      
 6852 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6853 
     | 
    
         
            +
                  app: function(block, arg) {
         
     | 
| 
      
 6854 
     | 
    
         
            +
                    return r(block).mcall('call', r(arg));
         
     | 
| 
      
 6855 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6856 
     | 
    
         
            +
                  query: function(expr, annotations) {
         
     | 
| 
      
 6857 
     | 
    
         
            +
                    var type, _ref20;
         
     | 
| 
      
 6858 
     | 
    
         
            +
                    _ref20 = annotations, annotations = _ref20.annotations, type = _ref20.type;
         
     | 
| 
      
 6859 
     | 
    
         
            +
                    return id('__client').mcall('query!', [lit(currentKey), lit(annotations), lit(type), r(expr)]);
         
     | 
| 
      
 6860 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6861 
     | 
    
         
            +
                  localQuery: function(key) {
         
     | 
| 
      
 6862 
     | 
    
         
            +
                    return localOrElse(key);
         
     | 
| 
      
 6863 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6864 
     | 
    
         
            +
                  fail: function(message) {
         
     | 
| 
      
 6865 
     | 
    
         
            +
                    return Ruby.raise([id('E'), lit(message)]);
         
     | 
| 
      
 6866 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6867 
     | 
    
         
            +
                  rescue: function(expr, def) {
         
     | 
| 
      
 6868 
     | 
    
         
            +
                    return expr.cases({
         
     | 
| 
      
 6869 
     | 
    
         
            +
                      local: function(key) {
         
     | 
| 
      
 6870 
     | 
    
         
            +
                        return localOrElse(key, r(def));
         
     | 
| 
      
 6871 
     | 
    
         
            +
                      },
         
     | 
| 
      
 6872 
     | 
    
         
            +
                      other: function() {
         
     | 
| 
      
 6873 
     | 
    
         
            +
                        return r(expr).rescue(r(def));
         
     | 
| 
      
 6874 
     | 
    
         
            +
                      }
         
     | 
| 
      
 6875 
     | 
    
         
            +
                    });
         
     | 
| 
      
 6876 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6877 
     | 
    
         
            +
                  op1: function(o, expr) {
         
     | 
| 
      
 6878 
     | 
    
         
            +
                    return r(expr).op1(o);
         
     | 
| 
      
 6879 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6880 
     | 
    
         
            +
                  op2: function(o, lhs, rhs) {
         
     | 
| 
      
 6881 
     | 
    
         
            +
                    if (o === '===') {
         
     | 
| 
      
 6882 
     | 
    
         
            +
                      o = '==';
         
     | 
| 
      
 6883 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6884 
     | 
    
         
            +
                    return r(lhs).op2(o, r(rhs));
         
     | 
| 
      
 6885 
     | 
    
         
            +
                  },
         
     | 
| 
      
 6886 
     | 
    
         
            +
                  bind: function(name, value, expr) {
         
     | 
| 
      
 6887 
     | 
    
         
            +
                    return Ruby.group([id(name).assign(r(value)), r(expr)]);
         
     | 
| 
      
 6888 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6889 
     | 
    
         
            +
                });
         
     | 
| 
      
 6890 
     | 
    
         
            +
              };
         
     | 
| 
      
 6891 
     | 
    
         
            +
              return function(semantics) {
         
     | 
| 
      
 6892 
     | 
    
         
            +
                var key, keys, optimize, out, processKey, seen, translate, _i, _len;
         
     | 
| 
      
 6893 
     | 
    
         
            +
                optimize = Gibbon.optimize, translate = Gibbon.translate;
         
     | 
| 
      
 6894 
     | 
    
         
            +
                keys = semantics.keys();
         
     | 
| 
      
 6895 
     | 
    
         
            +
                seen = new Hash;
         
     | 
| 
      
 6896 
     | 
    
         
            +
                out = [];
         
     | 
| 
      
 6897 
     | 
    
         
            +
                processKey = function(key) {
         
     | 
| 
      
 6898 
     | 
    
         
            +
                  var compiledRuby, dep, _i, _len, _ref20;
         
     | 
| 
      
 6899 
     | 
    
         
            +
                  if (seen.has(key)) {
         
     | 
| 
      
 6900 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 6901 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6902 
     | 
    
         
            +
                  seen.set(key, true);
         
     | 
| 
      
 6903 
     | 
    
         
            +
                  _ref20 = semantics.get(key).dependencies;
         
     | 
| 
      
 6904 
     | 
    
         
            +
                  for (_i = 0, _len = _ref20.length; _i < _len; _i++) {
         
     | 
| 
      
 6905 
     | 
    
         
            +
                    dep = _ref20[_i];
         
     | 
| 
      
 6906 
     | 
    
         
            +
                    if (dep._tag === 'local') {
         
     | 
| 
      
 6907 
     | 
    
         
            +
                      processKey(dep.name);
         
     | 
| 
      
 6908 
     | 
    
         
            +
                    }
         
     | 
| 
      
 6909 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6910 
     | 
    
         
            +
                  compiledRuby = compileCore(optimize(translate(semantics.get(key))), null, key).toRuby();
         
     | 
| 
      
 6911 
     | 
    
         
            +
                  return out.push("" + (idForLocal(key)) + " = begin\n  {:status=>:success,:value=>(" + compiledRuby + ")}\nrescue E => e\n  {:status=>:failure,:error=>e}\nend");
         
     | 
| 
      
 6912 
     | 
    
         
            +
                };
         
     | 
| 
      
 6913 
     | 
    
         
            +
                for (_i = 0, _len = keys.length; _i < _len; _i++) {
         
     | 
| 
      
 6914 
     | 
    
         
            +
                  key = keys[_i];
         
     | 
| 
      
 6915 
     | 
    
         
            +
                  processKey(key);
         
     | 
| 
      
 6916 
     | 
    
         
            +
                }
         
     | 
| 
      
 6917 
     | 
    
         
            +
                out.push('{');
         
     | 
| 
      
 6918 
     | 
    
         
            +
                out.push(((function() {
         
     | 
| 
      
 6919 
     | 
    
         
            +
                  var _j, _len1, _results;
         
     | 
| 
      
 6920 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 6921 
     | 
    
         
            +
                  for (_j = 0, _len1 = keys.length; _j < _len1; _j++) {
         
     | 
| 
      
 6922 
     | 
    
         
            +
                    key = keys[_j];
         
     | 
| 
      
 6923 
     | 
    
         
            +
                    _results.push("" + (lit(key).toRuby()) + " => " + (idForLocal(key)));
         
     | 
| 
      
 6924 
     | 
    
         
            +
                  }
         
     | 
| 
      
 6925 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 6926 
     | 
    
         
            +
                })()).join(','));
         
     | 
| 
      
 6927 
     | 
    
         
            +
                out.push('}');
         
     | 
| 
      
 6928 
     | 
    
         
            +
                return out.join("\n");
         
     | 
| 
      
 6929 
     | 
    
         
            +
              };
         
     | 
| 
      
 6930 
     | 
    
         
            +
            })();
         
     | 
| 
      
 6931 
     | 
    
         
            +
             
     | 
| 
       6469 
6932 
     | 
    
         
             
            Gibbon.jsonConsumer = (function() {
         
     | 
| 
       6470 
6933 
     | 
    
         
             
              return function(tables) {
         
     | 
| 
       6471 
6934 
     | 
    
         
             
                var analyzeList, getType, getValue, listLookup, lists;
         
     | 
    
        data/vendor/gibbon/package.json
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: goodguide-gibbon
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.13.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jay Adkisson
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-11- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-11-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: Run and analyze gibbon code from ruby or a browser (via a ruby app).
         
     | 
| 
       14 
14 
     | 
    
         
             
            email:
         
     |