| Server IP : 217.160.0.244 / Your IP : 216.73.216.36 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/ruby/3.3.0/rdoc/markup/ |
Upload File : |
# frozen_string_literal: true
##
# An array of attributes which parallels the characters in a string.
class RDoc::Markup::AttrSpan
##
# Creates a new AttrSpan for +length+ characters
def initialize(length, exclusive)
@attrs = Array.new(length, 0)
@exclusive = exclusive
end
##
# Toggles +bits+ from +start+ to +length+
def set_attrs(start, length, bits)
updated = false
for i in start ... (start+length)
if (@exclusive & @attrs[i]) == 0 || (@exclusive & bits) != 0
@attrs[i] |= bits
updated = true
end
end
updated
end
##
# Accesses flags for character +n+
def [](n)
@attrs[n]
end
end