Sha256: 39417af6d8e5ee3acecbf3acb275e78ba4745057ad0c9cb1b3b7ffa7e8e616b6

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

# Ruby stlib
require 'kconv'
require 'mathn'
require 'matrix'
require 'singleton'
require 'yaml'

$:.unshift(File.dirname(__FILE__))
# Hilbert core
require 'hilbert/meta_info'
require 'hilbert/utils/ruby_ext'
require 'hilbert/lexer'
require 'hilbert/parser'
require 'hilbert/world'

module Hilbert
  $meta_info = MetaInfo.instance
  $world     = World::Entity

  class << self
    def compile(str)
      lexed = Lexer.execute(str)
      Kconv.tosjis(Parser.execute(lexed))
    end

    $meta_info.langs_hash.keys.each do |lang_name|
      define_method("to_#{lang_name}") do |*opts|
        $meta_info.lang = lang_name.to_sym
        $meta_info.opts = opts
        Hilbert
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hilbert-0.0.2700420 lib/hilbert.rb
hilbert-0.0.2700410 lib/hilbert.rb
hilbert-0.0.2700400 lib/hilbert.rb