rename method

This commit is contained in:
Torsten Ruger
2014-07-16 19:24:41 +03:00
parent 55cb6bd2d6
commit 1ff7ae2b0a
13 changed files with 45 additions and 45 deletions

View File

@ -7,7 +7,7 @@ module Crystal
# As we write before we recurse (save a push) we write the number backwards
# arguments: string address , integer
def self.utoa context
utoa_function = Virtual::Method.new(:utoa , [ Virtual::Integer ] , Virtual::Integer ,Virtual::Integer )
utoa_function = Virtual::MethodDefinition.new(:utoa , [ Virtual::Integer ] , Virtual::Integer ,Virtual::Integer )
return utoa_function
str_addr = utoa_function.receiver
number = utoa_function.args.first
@ -25,7 +25,7 @@ module Crystal
end
def self.putint context
putint_function = Virtual::Method.new(:putint , [] , Virtual::Integer ,Virtual::Integer )
putint_function = Virtual::MethodDefinition.new(:putint , [] , Virtual::Integer ,Virtual::Integer )
return putint_function
buffer = Virtual::StringConstant.new(" ") # create a buffer
context.object_space.add_object buffer # and save it (function local variable: a no no)
@ -52,7 +52,7 @@ module Crystal
# a hand coded version of the fibonachi numbers
# not my hand off course, found in the net http://www.peter-cockerell.net/aalp/html/ch-5.html
def self.fibo context
fibo_function = Virtual::Method.new(:fibo , [] , Virtual::Integer ,Virtual::Integer )
fibo_function = Virtual::MethodDefinition.new(:fibo , [] , Virtual::Integer ,Virtual::Integer )
return fibo_function
result = fibo_function.return_type
int = fibo_function.receiver

View File

@ -1,7 +1,7 @@
module Crystal
module Kernel
def self.putstring context
function = Virtual::Method.new(:putstring , [] )
function = Virtual::MethodDefinition.new(:putstring , [] )
return function
ret = Virtual::RegisterMachine.instance.write_stdout(function)
function.set_return ret

View File

@ -1,7 +1,7 @@
module Crystal
module Kernel
def self.exit context
function = Virtual::Method.new(:exit , [] , Virtual::Integer)
function = Virtual::MethodDefinition.new(:exit , [] , Virtual::Integer)
return function
ret = Virtual::RegisterMachine.instance.exit(function)
function.set_return ret