renamed the kernel dir/ module to Builtin (so to not confuse with ruby kernel module)

This commit is contained in:
Torsten Ruger
2014-08-28 18:27:04 +03:00
parent 8c1c72f1c3
commit b8a74f4a77
7 changed files with 22 additions and 24 deletions

28
lib/builtin/string.rb Normal file
View File

@@ -0,0 +1,28 @@
module Builtin
module Kernel
def self.putstring context
function = Virtual::CompiledMethod.new(:putstring , [] )
return function
ret = Virtual::RegisterMachine.instance.write_stdout(function)
function.set_return ret
function
end
end
class String
module ClassMethods
def get context , index = Virtual::Integer
get_function = Virtual::CompiledMethod.new(:get , [ Virtual::Integer] , Virtual::Integer , Virtual::Integer )
return get_function
end
def set context , index = Virtual::Integer , char = Virtual::Integer
set_function = Virtual::CompiledMethod.new(:set , [Virtual::Integer, Virtual::Integer] , Virtual::Integer ,Virtual::Integer )
return set_function
end
def puts context
puts_function = Virtual::CompiledMethod.new(:puts , [] )
return puts_function
end
end
extend ClassMethods
end
end