class Regexgen::Ast::Repetition

Represents a repetition (e.g. `a*` or `a?`)

Attributes

expr[R]
precedence[R]
type[R]

Public Class Methods

new(expr, type) click to toggle source
# File lib/regexgen/ast.rb, line 128
def initialize(expr, type)
  @precedence = 3
  @expr = expr
  @type = type
end

Public Instance Methods

length() click to toggle source
# File lib/regexgen/ast.rb, line 134
def length
  @expr.length
end
to_s() click to toggle source
# File lib/regexgen/ast.rb, line 138
def to_s
  Ast.parens(@expr, self) + @type
end