Class: WikiCloth::MathParser

Inherits:
Object
  • Object
show all
Defined in:
lib/wikicloth/math.rb

Instance Method Summary collapse

Instance Method Details

#parse(input) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/wikicloth/math.rb', line 79

def parse(input)
  @lexer = Lexer.new(input)
  
  expression_value = expression

  token = @lexer.get_next_token
  if token.kind == Token::End
    expression_value
  else
    raise 'End expected'
  end
end