Module: SelfML

Defined in:
lib/self-ml.rb

Overview

SelfML is a simple, human writable, machine readable, configuration language. This is the ruby implementation.

Defined Under Namespace

Classes: Document, Parser, Transformer

Constant Summary collapse

VERSION =

The current version.

"0.0.1"

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object

Parse a SelfML document inputed as a string. Returns an array. That array will contain both strings an arrays, and so on.

SelfML.parse("(test awesome x)") #=> [["test", "awesome", "x"]] 

SelfML.parse("(x (1 2 3) [This is a test])") 
   #=> [[:x, [1, 2, 3], "This is a test"]]


20
21
22
# File 'lib/self-ml.rb', line 20

def parse(string)
  Transformer.new.apply(Parser.new.parse(string))
end