teepee 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfbe38c9d41e1090be4155258a0c692d19b2211e
4
- data.tar.gz: 4104b6609251e0e161cedc53238458c7a99ad7ac
3
+ metadata.gz: 754aaf39d5ff99b769f1b9c64b6abee836f69dfc
4
+ data.tar.gz: d19c6e892b09eb5cf9c042994d87b8e5ffb247f3
5
5
  SHA512:
6
- metadata.gz: bb999c5d27222263724daf030892b9811a64f339adecdaa4b9ffa22a1b18d61cf89c1809d81dfbaeb9b01dd22d06c0b0da9a3a6f4f757f057d50f570c187c6d0
7
- data.tar.gz: 14fc26a02e2192279e319a3c9aef0161566921cf49bebf319b90be57323c29dc0d7c12a1b82648f00e02899bad1a9513ceb12391b625270e74f0392c11897cfb
6
+ metadata.gz: 42fdc58d2d21794b6034bd82a2ae9eea3f04e7f33045531761bdcda3846e7baeb2fdd534972b987bfdf0ddaef3e7f7d37f7ee3b5ef80256218d64b1f31bd2ebc
7
+ data.tar.gz: 26ad3ccd200515e92ea52feb98cf7b35b908f2a46bea92255dbe5b3e8639627f07ea0062c61cafe20fea1de6a91447d06e744cad5e58512b58d394b5fdac9e68
@@ -62,6 +62,12 @@ module Teepee
62
62
  @expressions = expressions
63
63
  end
64
64
 
65
+ def use_scope scope
66
+ @scope = scope
67
+ expressions.map {|node| node.use_scope scope}
68
+ self
69
+ end
70
+
65
71
  def command_error(message)
66
72
  %{<span style="color: red">[#{message}]</span>}
67
73
  end
@@ -159,19 +159,15 @@ module Teepee
159
159
  update_variable k, old_value + 1
160
160
  end
161
161
 
162
- def update_scope body
163
- body.map do |clause|
164
- if clause.kind_of? CommandParser
165
- clause.scope = scope
166
- end
167
- end
162
+ def update_scopes body
163
+ body.map {|node| node.use_scope scope}
168
164
  body
169
165
  end
170
166
 
171
167
  def let1 expressions
172
168
  variable, _, value, _, *body = expressions
173
169
  scope[variable.to_html] = value.to_html
174
- update_scope(body).map(&:to_html)
170
+ update_scopes(body).map(&:to_html)
175
171
  end
176
172
 
177
173
  def not_equal numbers
@@ -40,5 +40,9 @@ module Teepee
40
40
  def to_html
41
41
  "" # You probably want to override this.
42
42
  end
43
+
44
+ def use_scope scope
45
+ self # Some nodes will need to care about lexical scope.
46
+ end
43
47
  end
44
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teepee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Mark Gore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-13 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Teepee is a markup language, loosely based on Lisp and TeX, for ThinkingBicycle.com.
42
56
  email: cgore@cgore.com
43
57
  executables: []