interscript 2.1.0rc4 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -6
  3. data/Rakefile +1 -9
  4. data/bin/console +8 -4
  5. data/interscript.gemspec +1 -2
  6. data/lib/interscript/compiler/javascript.rb +1 -6
  7. data/lib/interscript/compiler/ruby.rb +0 -5
  8. data/lib/interscript/dsl/document.rb +1 -2
  9. data/lib/interscript/dsl/group/parallel.rb +2 -2
  10. data/lib/interscript/dsl/group.rb +6 -7
  11. data/lib/interscript/dsl/tests.rb +2 -2
  12. data/lib/interscript/dsl.rb +2 -35
  13. data/lib/interscript/interpreter.rb +1 -5
  14. data/lib/interscript/node/alias_def.rb +0 -6
  15. data/lib/interscript/node/dependency.rb +0 -16
  16. data/lib/interscript/node/document.rb +0 -34
  17. data/lib/interscript/node/group.rb +2 -13
  18. data/lib/interscript/node/item/alias.rb +0 -12
  19. data/lib/interscript/node/item/any.rb +0 -7
  20. data/lib/interscript/node/item/capture.rb +0 -11
  21. data/lib/interscript/node/item/group.rb +1 -29
  22. data/lib/interscript/node/item/repeat.rb +0 -4
  23. data/lib/interscript/node/item/stage.rb +0 -4
  24. data/lib/interscript/node/item/string.rb +0 -7
  25. data/lib/interscript/node/item.rb +0 -4
  26. data/lib/interscript/node/metadata.rb +0 -10
  27. data/lib/interscript/node/rule/funcall.rb +2 -12
  28. data/lib/interscript/node/rule/run.rb +3 -16
  29. data/lib/interscript/node/rule/sub.rb +4 -165
  30. data/lib/interscript/node/rule.rb +0 -3
  31. data/lib/interscript/node/stage.rb +4 -30
  32. data/lib/interscript/node/tests.rb +0 -10
  33. data/lib/interscript/node.rb +0 -4
  34. data/lib/interscript/stdlib.rb +3 -45
  35. data/lib/interscript/version.rb +1 -1
  36. data/lib/interscript/visualize/json.rb +4 -12
  37. data/lib/interscript.rb +0 -78
  38. metadata +3 -19
  39. data/lib/interscript/detector.rb +0 -60
  40. 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