module Interscript::DSL::Items

Public Instance Methods

any(*chars) click to toggle source
# File lib/interscript/dsl/items.rb, line 14
def any(*chars)
  puts "any(#{chars.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::Any.new(*chars)
end
capture(expr) click to toggle source

(…)

# File lib/interscript/dsl/items.rb, line 36
def capture(expr)
  puts "capture(#{expr.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::CaptureGroup.new(expr)
end
map() click to toggle source

Implementation of `map.x`

# File lib/interscript/dsl/items.rb, line 48
def map; Interscript::DSL::Items::Maps; end
maybe(*chars) click to toggle source

a?

# File lib/interscript/dsl/items.rb, line 20
def maybe(*chars)
  puts "maybe(#{chars.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::Maybe.new(*chars)
end
maybe_some(*chars) click to toggle source
# File lib/interscript/dsl/items.rb, line 25
def maybe_some(*chars)
  puts "maybe_some(#{chars.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::MaybeSome.new(*chars)
end
method_missing(sym, *args, **kwargs, &block) click to toggle source
# File lib/interscript/dsl/items.rb, line 4
def method_missing sym, *args, **kwargs, &block
  super if args.length > 0
  super if kwargs.length > 0
  super if sym.to_s =~ /[?!=]\z/
  super unless sym.to_s =~ /\A[\w\d]+\z/
  super if block_given?

  Interscript::Node::Item::Alias.new(sym)
end
ref(int) click to toggle source

1

# File lib/interscript/dsl/items.rb, line 42
def ref(int)
  puts "ref(#{int.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::CaptureRef.new(int)
end
some(*chars) click to toggle source
# File lib/interscript/dsl/items.rb, line 30
def some(*chars)
  puts "some(#{chars.inspect}) from #{self.inspect}" if $DEBUG
  Interscript::Node::Item::Some.new(*chars)
end
stage() click to toggle source

Implementation of `stage.x`

# File lib/interscript/dsl/items.rb, line 51
def stage; Stages.new; end