Sha256: 303507deae769523a435b7a490aa2ef78b1c418a296018d1fde60235c422bde8

Contents?: true

Size: 750 Bytes

Versions: 2

Compression:

Stored size: 750 Bytes

Contents

require 'forwardable'
require 'treetop'

require 'ceml/casting'
require 'ceml/instructions'
require 'ceml/script'
require 'ceml/tt/lexer'
require 'ceml/tt/casting'
require 'ceml/tt/instructions'
require 'ceml/tt/scripts'

require 'ceml/engine'

module CEML
  def parse(what, string)
    result = nil
    string.gsub!(/\n +/, ' ')
    string << "\n"
    p = ScriptsParser.new
    p.root = what
    result = p.parse(string)
    raise "parse failed: \n#{p.failure_reason}" unless result
    case what
    when :scripts
      raise "no scripts found" unless result.elements and !result.elements.empty?
      result = result.elements
      result.each{ |s| s.validate! }
    when :script
      result.validate!
    end
    result
  end

  extend self
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ceml-0.2.1 lib/ceml.rb
ceml-0.2.0 lib/ceml.rb