Class: RLSM::RE::Star
Overview
Instance Attribute Summary
Attributes inherited from SyntaxNode
#content
Instance Method Summary
collapse
Methods inherited from SyntaxNode
#<=>, [], #initialize, #inspect, #null?
Instance Method Details
#first ⇒ Object
345
346
347
|
# File 'lib/rlsm/regexp_parser.rb', line 345
def first
@content.first
end
|
#follow ⇒ Object
353
354
355
356
357
358
359
360
361
362
363
|
# File 'lib/rlsm/regexp_parser.rb', line 353
def follow
result = []
@content.last.each do |char1|
@content.first.each do |char2|
result << [char1,char2]
end
end
(@content.follow | result).sort
end
|
#last ⇒ Object
349
350
351
|
# File 'lib/rlsm/regexp_parser.rb', line 349
def last
@content.last
end
|
#to_s ⇒ Object
365
366
367
368
369
|
# File 'lib/rlsm/regexp_parser.rb', line 365
def to_s
string = @content.to_s
string.length > 1 ? "(#{string})*" : "#{string}*"
end
|