Sha256: a1badb9419275646ca4ca093a0789a04b0af9d567c6413ecf7708eb6954b4275

Contents?: true

Size: 403 Bytes

Versions: 1

Compression:

Stored size: 403 Bytes

Contents

#!/usr/bin/ruby
# Jonathan D. Stott <jonathan.stott@gmail.com>
require 'treetop/runtime'
require 'exalted_math/math'
require 'exalted_math/ast'

module Exalted
  class MathsParser
    def ast(text)
      txt = text.dup
      txt.strip!
      txt.gsub!(/\s+/," ")
      result = parse(txt)
      if result
        [true, result.ast]
      else
        [false, failure_reason]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exalted_math-0.1.3 lib/exalted_math.rb