moving string to parfait

using parfait::word
also rename builtins string to word
This commit is contained in:
Torsten Ruger
2015-05-13 16:17:10 +03:00
parent baca6eb4c6
commit 9d711e7766
16 changed files with 50 additions and 60 deletions

View File

@ -8,5 +8,28 @@ module Parfait
# Words are constant, maybe like js strings, ruby symbols
# Words are short, but may have spaces
class Word < Object
def initialize str
@string = str
end
attr_reader :string
def result= value
raise "called"
class_for(MoveInstruction).new(value , self , :opcode => :mov)
end
def clazz
Space.space.get_or_create_class(:Word)
end
def layout
Virtual::Object.layout
end
def mem_length
padded(1 + string.length)
end
def position
return @position if @position
return @string.position if @string.position
super
end
end
end