rename string to word
This commit is contained in:
parent
bf5576f805
commit
baca6eb4c6
@ -4,7 +4,7 @@ require "parfait/module"
|
|||||||
require "parfait/class"
|
require "parfait/class"
|
||||||
require "parfait/dictionary"
|
require "parfait/dictionary"
|
||||||
require "parfait/list"
|
require "parfait/list"
|
||||||
require "parfait/string"
|
require "parfait/word"
|
||||||
require "parfait/message"
|
require "parfait/message"
|
||||||
require "parfait/frame"
|
require "parfait/frame"
|
||||||
require "parfait/space"
|
require "parfait/space"
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
module Parfait
|
|
||||||
class String < Object
|
|
||||||
end
|
|
||||||
end
|
|
12
lib/parfait/word.rb
Normal file
12
lib/parfait/word.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
module Parfait
|
||||||
|
# A word is a a short sequence of characters
|
||||||
|
# Characters are not modeled as objects but as (small) integers
|
||||||
|
# The small means two of them have to fit into a machine word, iw utf16 or similar
|
||||||
|
#
|
||||||
|
# Words are constant, maybe like js strings, ruby symbols
|
||||||
|
# Words are short, but may have spaces
|
||||||
|
class Word < Object
|
||||||
|
end
|
||||||
|
end
|
@ -7,7 +7,8 @@ module Positioned
|
|||||||
@position
|
@position
|
||||||
end
|
end
|
||||||
def set_position pos
|
def set_position pos
|
||||||
# resetting of position used to be error, but since relink and dynamic instruction size it is ok. in measures
|
# resetting of position used to be error, but since relink and dynamic instruction size it is ok.
|
||||||
|
# in measures (of 32)
|
||||||
if @position != nil and ((@position - pos).abs > 32)
|
if @position != nil and ((@position - pos).abs > 32)
|
||||||
raise "position set again #{pos}!=#{@position} for #{self}"
|
raise "position set again #{pos}!=#{@position} for #{self}"
|
||||||
end
|
end
|
||||||
@ -125,7 +126,7 @@ end
|
|||||||
Virtual::Object.new.padded_words(length())
|
Virtual::Object.new.padded_words(length())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
::Parfait::String.class_eval do
|
::Parfait::Word.class_eval do
|
||||||
include Positioned
|
include Positioned
|
||||||
def layout
|
def layout
|
||||||
Virtual::Object.layout
|
Virtual::Object.layout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user