Module: Yaparc::Parsable

Overview

of module Result

Constant Summary collapse

IS_LOWER =
lambda {|c| c >= 'a' and c <= 'z'}
IS_ALPHANUM =
lambda {|c| (c >= 'a' and c <= 'z') or (c >= '0' and c <= '9')}
IS_DIGIT =
lambda {|i| i >= '0' and i <= '9'}
IS_SPACE =
lambda {|i| i == ' '}
IS_WHITESPACE =
lambda {|i| i == ' ' or i == "\n" or i == "\t"}
IS_CR =
lambda {|i| i == "\n"}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#treeObject

Returns the value of attribute tree.



23
24
25
# File 'lib/yaparc.rb', line 23

def tree
  @tree
end

Instance Method Details

#parse(input) ⇒ Object

, &block)



32
33
34
35
36
37
38
39
40
# File 'lib/yaparc.rb', line 32

def parse(input) #, &block)
  result = @parser.call(input)

  if result.respond_to?(:parse)
    result.parse(input)
  else
    result
  end
end