Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve nomenclature.

  • Loading branch information...
commit 02efb8517842e4648a2a79389b0a9cb72e8512a4 1 parent 21fee8c
@threedaymonk threedaymonk authored
Showing with 5 additions and 12 deletions.
  1. +3 −9 lib/sibyl/{unit.rb → nodes.rb}
  2. +2 −3 lib/sibyl/ruby_transform.rb
View
12 lib/sibyl/unit.rb → lib/sibyl/nodes.rb
@@ -1,8 +1,8 @@
require "sibyl/errors"
module Sibyl
- module Unit
- class Element
+ module Nodes
+ class Node
class << self
def construct_with(*fields)
class_eval <<-END
@@ -36,19 +36,13 @@ def def_false(*names)
def_false :metadata, :option, :statement, :step, :sink, :branch
end
- class Declaration < Element
- end
-
- class Node < Element
- end
-
module Evaluable
def evaluate(context)
context.instance_eval(expression)
end
end
- class Metadata < Declaration
+ class Metadata < Node
construct_with :key, :value
def_true :metadata
end
View
5 lib/sibyl/ruby_transform.rb
@@ -1,9 +1,9 @@
require "parslet"
-require "sibyl/unit"
+require "sibyl/nodes"
module Sibyl
class RubyTransform < Parslet::Transform
- include Unit
+ include Nodes
rule(text: simple(:x)) { x.to_s }
rule(numeric: simple(:x)) { x.to_i }
@@ -47,4 +47,3 @@ class RubyTransform < Parslet::Transform
}
end
end
-
Please sign in to comment.
Something went wrong with that request. Please try again.