Sha256: bfbeb69fd1c88ce1cc6f29491f9c1d85bd0dcd7f697b8f5c73bff87798146db9
Contents?: true
Size: 1014 Bytes
Versions: 4
Compression:
Stored size: 1014 Bytes
Contents
class Fancy AST { class Script : Node { read_slots: ['file, 'line, 'body] @@stack = [] def push_script { @@stack push(self) } def pop_script { @@stack pop() } def self current { @@stack last() } def initialize: @line file: @file body: @body { } def bytecode: g { pos(g) try { push_script # docs, code = body.expressions.partition do |s| # s.kind_of?(Rubinius::AST::StringLiteral) # end # if code.empty? # # only literal string found, we have to evaluate to it, not # # use as documentation. # docs, code = [], docs # end # code.each { |c| c.bytecode(g) } @body bytecode: g # the docs array has top-level expressions that are # simply string literals, we can use them for file-level # documentation. # TODO: implement file documentation here. } finally { pop_script } } } }
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
fancy-0.7.0 | lib/compiler/ast/script.fy |
fancy-0.6.0 | lib/compiler/ast/script.fy |
fancy-0.5.0 | lib/compiler/ast/script.fy |
fancy-0.4.0 | lib/compiler/ast/script.fy |