atomy 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9aceb9ef636c07aa78300caf235cc6e28d65d45
4
- data.tar.gz: 4ec7c130b15909d5cbbe526d60a710af0e5b601f
3
+ metadata.gz: 068466b3dfc8c044b62bb9f9ee89d2b26fe1ae2b
4
+ data.tar.gz: bd823b4edeca86beb03b073e6be4dae391713678
5
5
  SHA512:
6
- metadata.gz: c4a75b4f1d2077ca834d9a063f0ca915d3119ca25d67756496648cb431368973df13c9b4e29e8f5105bb01bc4dceaf6b34a6e51aeae5db6ea54340bbd2d61020
7
- data.tar.gz: c820dd093b9e6d1977a82f691c7eb4ce453cad47438943a3993560ffcc2483aa7fd7d43df677287d1240e8b9a9df88870b8dcbf6c4d0a2e797ef3f3a1a6c4f67
6
+ metadata.gz: 93862742056c9c253d3b8e8eb1d3ba3ef795e33938469e18b55c3b2de16e9335f987040122f1c174ab07fe46d26a44a280eb4c9ff8fc181f71e6c5e9463c4d21
7
+ data.tar.gz: 015bab9f5314108b9c83f5a6f7f19569872b36b06b796dabf8e5f6c674e61bfda7ea5a79342986dcbf9b2c0249edf732b83b9d7db0d00f36edbc798e951657a1
data/kernel/define.ay CHANGED
@@ -37,7 +37,7 @@ macro(def(~message): ~*body):
37
37
  structure proc-argument
38
38
  )
39
39
 
40
- -- helper for adding a module to the constant scope
40
+ -- helper for adding a module to the lexical scope
41
41
  with-module = Class new:
42
42
  def(bytecode(gen, _)):
43
43
  gen push-self
data/lib/atomy.rb CHANGED
@@ -23,15 +23,15 @@ module Atomy
23
23
  if branch.receiver
24
24
  branch.receiver.target
25
25
  else
26
- binding.constant_scope.for_method_definition
26
+ binding.lexical_scope.for_method_definition
27
27
  end
28
28
 
29
29
  method, branch = register_branch(target, name, branch)
30
30
 
31
31
  if branch.name
32
- Rubinius.add_method(branch.name, branch.as_method, target, binding.constant_scope, 0, :public)
32
+ Rubinius.add_method(branch.name, branch.as_method, target, binding.lexical_scope, 0, :public)
33
33
  end
34
34
 
35
- Rubinius.add_method(name, method.build, target, binding.constant_scope, 0, :public)
35
+ Rubinius.add_method(name, method.build, target, binding.lexical_scope, 0, :public)
36
36
  end
37
37
  end
@@ -236,7 +236,7 @@ module Atomy
236
236
  blk.push_scope
237
237
  blk.send(:module, 0)
238
238
 
239
- # add Atomy::Grammar::AST to the constant scope
239
+ # add Atomy::Grammar::AST to the lexical scope
240
240
  blk.push_cpath_top
241
241
  blk.find_const(:Atomy)
242
242
  blk.find_const(:Grammar)
@@ -13,8 +13,10 @@ module Atomy
13
13
  end
14
14
 
15
15
  def bytecode(gen, mod)
16
- if @receiver.nil? && fun = gen.state.scope.search_local(:"#{@message}:function")
17
- invoke_function(gen, mod, fun)
16
+ flocal = gen.state.scope.search_local(:"#{@message}:function")
17
+
18
+ if @receiver.nil? && flocal
19
+ invoke_function(gen, mod, flocal)
18
20
  else
19
21
  invoke_method(gen, mod)
20
22
  end
@@ -22,12 +24,12 @@ module Atomy
22
24
 
23
25
  private
24
26
 
25
- def invoke_function(gen, mod, fun)
26
- fun.get_bytecode(gen)
27
+ def invoke_function(gen, mod, flocal)
28
+ flocal.get_bytecode(gen)
27
29
 
28
30
  gen.dup
29
31
  gen.send(:block_env, 0)
30
- gen.send(:constant_scope, 0)
32
+ gen.send(:lexical_scope, 0)
31
33
  gen.send(:module, 0)
32
34
 
33
35
  gen.push_literal(@message)
@@ -156,7 +156,7 @@ module Atomy
156
156
  Rubinius.attach_method(
157
157
  :__script__,
158
158
  code,
159
- mod.compile_context.constant_scope,
159
+ mod.compile_context.lexical_scope,
160
160
  mod)
161
161
 
162
162
  res = mod.__script__
@@ -44,7 +44,7 @@ module Atomy
44
44
 
45
45
  def construct_block(code, binding)
46
46
  code = code.dup
47
- code.scope = binding.constant_scope
47
+ code.scope = binding.lexical_scope
48
48
  code.name = binding.variables.method.name
49
49
  code.scope.script =
50
50
  Rubinius::CompiledCode::Script.new(code, code.file.to_s, true)
data/lib/atomy/method.rb CHANGED
@@ -140,7 +140,7 @@ module Atomy
140
140
 
141
141
  done.set!
142
142
  end.tap do |cm|
143
- cm.scope = Rubinius::ConstantScope.new(Object)
143
+ cm.scope = Rubinius::LexicalScope.new(Object)
144
144
  end
145
145
  end
146
146
 
@@ -293,7 +293,7 @@ module Atomy
293
293
  gen.push_literal(@name)
294
294
  gen.move_down(branch_args)
295
295
 
296
- gen.push_literal(b.body.constant_scope.module)
296
+ gen.push_literal(b.body.lexical_scope.module)
297
297
  gen.move_down(branch_args)
298
298
 
299
299
  gen.push_self
data/lib/atomy/module.rb CHANGED
@@ -22,7 +22,7 @@ module Atomy
22
22
 
23
23
  @exported_modules = []
24
24
 
25
- # easy accessor for the current module via ConstantScope lookup
25
+ # easy accessor for the current module via LexicalScope lookup
26
26
  const_set(:Self, self)
27
27
 
28
28
  super
@@ -51,7 +51,7 @@ module Atomy
51
51
  Binding.setup(
52
52
  Rubinius::VariableScope.of_sender,
53
53
  Rubinius::CompiledCode.of_sender,
54
- Rubinius::ConstantScope.of_sender,
54
+ Rubinius::LexicalScope.of_sender,
55
55
  self)
56
56
 
57
57
  code = Atomy::Compiler.compile(
@@ -108,9 +108,9 @@ module Atomy
108
108
  def compile_context
109
109
  return @compile_context if @compile_context
110
110
 
111
- scope = Rubinius::ConstantScope.new(
111
+ scope = Rubinius::LexicalScope.new(
112
112
  self,
113
- Rubinius::ConstantScope.new(Object))
113
+ Rubinius::LexicalScope.new(Object))
114
114
 
115
115
  meth = proc {}.block.compiled_code
116
116
  meth.metadata = nil
data/lib/atomy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Atomy
2
- VERSION = "0.6.11"
2
+ VERSION = "0.6.12"
3
3
  end
metadata CHANGED
@@ -1,53 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Suraci
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- prerelease: false
15
- type: :runtime
16
14
  name: kpeg
17
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.0'
22
- requirement: !ruby/object:Gem::Requirement
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
- prerelease: false
29
- type: :development
30
28
  name: rake
31
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
32
30
  requirements:
33
31
  - - "~>"
34
32
  - !ruby/object:Gem::Version
35
33
  version: '10.4'
36
- requirement: !ruby/object:Gem::Requirement
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.4'
41
41
  - !ruby/object:Gem::Dependency
42
- prerelease: false
43
- type: :development
44
42
  name: rspec-its
45
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: !ruby/object:Gem::Requirement
46
44
  requirements:
47
45
  - - "~>"
48
46
  - !ruby/object:Gem::Version
49
47
  version: '1.2'
50
- requirement: !ruby/object:Gem::Requirement
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.6.2
167
+ rubygems_version: 2.5.1
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: the Atomy programming language