Sha256: d29f5e77e3eac53144538245e5b780f5c68d98af1d0bc094d42d08a99be56d01

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

require_relative 'YASP/command'
require_relative 'YASP/yasp_tree'

class Yasp

	def self.yell(&block)
		puts stringify(&block)
	end

	#outputs to file
	def self.file(filename, &block)
		file = File.open(filename,"w+")
		file.write(stringify(&block))
		file.close
	end

	#compiles all symbols into their text representation in the correct order
	def self.stringify(&block)
		parse(block).to_scad
	end

	private

	#interprets the code into symbols -- commands, because Symbol is already a class
	def self.parse(block)
		YaspTree.new(block)
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yasp-2.0.2 lib/yasp.rb
yasp-2.0.0 lib/yasp.rb