interscript 2.1.0rc4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -6
- data/Rakefile +1 -9
- data/bin/console +8 -4
- data/interscript.gemspec +1 -2
- data/lib/interscript/compiler/javascript.rb +1 -6
- data/lib/interscript/compiler/ruby.rb +0 -5
- data/lib/interscript/dsl/document.rb +1 -2
- data/lib/interscript/dsl/group/parallel.rb +2 -2
- data/lib/interscript/dsl/group.rb +6 -7
- data/lib/interscript/dsl/tests.rb +2 -2
- data/lib/interscript/dsl.rb +2 -35
- data/lib/interscript/interpreter.rb +1 -5
- data/lib/interscript/node/alias_def.rb +0 -6
- data/lib/interscript/node/dependency.rb +0 -16
- data/lib/interscript/node/document.rb +0 -34
- data/lib/interscript/node/group.rb +2 -13
- data/lib/interscript/node/item/alias.rb +0 -12
- data/lib/interscript/node/item/any.rb +0 -7
- data/lib/interscript/node/item/capture.rb +0 -11
- data/lib/interscript/node/item/group.rb +1 -29
- data/lib/interscript/node/item/repeat.rb +0 -4
- data/lib/interscript/node/item/stage.rb +0 -4
- data/lib/interscript/node/item/string.rb +0 -7
- data/lib/interscript/node/item.rb +0 -4
- data/lib/interscript/node/metadata.rb +0 -10
- data/lib/interscript/node/rule/funcall.rb +2 -12
- data/lib/interscript/node/rule/run.rb +3 -16
- data/lib/interscript/node/rule/sub.rb +4 -165
- data/lib/interscript/node/rule.rb +0 -3
- data/lib/interscript/node/stage.rb +4 -30
- data/lib/interscript/node/tests.rb +0 -10
- data/lib/interscript/node.rb +0 -4
- data/lib/interscript/stdlib.rb +3 -45
- data/lib/interscript/version.rb +1 -1
- data/lib/interscript/visualize/json.rb +4 -12
- data/lib/interscript.rb +0 -78
- metadata +3 -19
- data/lib/interscript/detector.rb +0 -60
- data/lib/interscript/utils/helpers.rb +0 -39
@@ -1,39 +0,0 @@
|
|
1
|
-
module Interscript::Utils
|
2
|
-
module Helpers
|
3
|
-
def document name=nil, &block
|
4
|
-
$example_id ||= 0
|
5
|
-
$example_id += 1
|
6
|
-
name ||= "example-#{$example_id}"
|
7
|
-
|
8
|
-
Interscript::DSL::Document.new(name, &block).node.tap do |i|
|
9
|
-
$documents ||= {}
|
10
|
-
$documents[name] = i
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def stage &block
|
15
|
-
document {
|
16
|
-
stage(&block)
|
17
|
-
}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class Interscript::Node::Document
|
23
|
-
def call(str, stage=:main, compiler=$compiler || Interscript::Interpreter, **kwargs)
|
24
|
-
compiler.(self).(str, stage, **kwargs)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
module Interscript::DSL
|
29
|
-
class << self
|
30
|
-
alias original_parse parse
|
31
|
-
def parse(map_name, **kwargs)
|
32
|
-
if $documents && $documents[map_name]
|
33
|
-
$documents[map_name]
|
34
|
-
else
|
35
|
-
original_parse(map_name, **kwargs)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|