mulang-ruby 6.1.0 → 6.3.0

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
  SHA256:
3
- metadata.gz: 534bc3c5a44381a2ba606c51162b1ccc664a20cdfe20470e3cd1c328fd43285b
4
- data.tar.gz: abddef43c33abb13f13ae185ba94e310d384e0257fb7a62a1192b18e8b0bd6b9
3
+ metadata.gz: 00df60c46038a6626d1e3de934030c8ab3900c7b349c02d75e8be6c4baa64938
4
+ data.tar.gz: c12bb657bbb5553ec708ec38fa919a2d3bad2c33828e9242c56ae37996bc3337
5
5
  SHA512:
6
- metadata.gz: 523da2d9961e079ddc1061988dfee999ae73f753ac386588066f8942676eb01e66725af10777da41a31f5ecc2037841e5574a7c11ceb2387bec245a99ee40973
7
- data.tar.gz: 6eba9d4083da3c9e63932c491c7b90d4b8b95ebe7e50fbb7c9bd99206e7ee56d41c938920ece70cdefc0baa72d6413f882991332e4efd0c5fe6485fa7e1331f8
6
+ metadata.gz: 2f9409458260fe11969bfa1d01299798ceed7ee3790dce990e6be93eafe31382b220f76112403956253b0ce241a65e266f652a1ce952e4d13f8285ae18d980d4
7
+ data.tar.gz: 723c85b715112318f1e5c3e3a5e4430e50bc1ab6be0793eed80c6e04a101b353c49576725706e6a68d49f7078450ff5e93e093bd996a60e7f1bcf33b4f7d189c
@@ -13,8 +13,8 @@ jobs:
13
13
  uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
14
14
  with:
15
15
  ruby-version: 2.6.3
16
- - name: Install dependencies
17
- run: bundle install
16
+ bundler: 2.1.4
17
+ bundler-cache: true
18
18
  - name: Run tests
19
19
  run: bundle exec rake
20
20
  - name: Deploy
@@ -3,25 +3,47 @@ module Mulang::Ruby
3
3
  include AST::Sexp
4
4
  include Mulang::Ruby::Sexp
5
5
 
6
+ def initialize
7
+ @contexts = []
8
+ end
9
+
6
10
  def process(node)
7
11
  node.nil? ? none : super
8
12
  end
9
13
 
10
14
  def on_class(node)
15
+ @contexts.push :class
16
+
11
17
  name, superclass, body = *node
12
18
 
13
19
  _, class_name = *name
14
20
  _, superclass_name = *superclass
15
21
 
16
22
  ms :Class, class_name, superclass_name, process(body)
23
+ ensure
24
+ @contexts.pop
25
+ end
26
+
27
+ def on_sclass(node)
28
+ @contexts.push :sclass
29
+
30
+ target, body = *node
31
+
32
+ ms :EigenClass, process(target), process(body)
33
+ ensure
34
+ @contexts.pop
17
35
  end
18
36
 
19
37
  def on_module(node)
38
+ @contexts.push :module
39
+
20
40
  name, body = *node
21
41
 
22
42
  _, module_name = *name
23
43
 
24
44
  ms :Object, module_name, process(body)
45
+ ensure
46
+ @contexts.pop
25
47
  end
26
48
 
27
49
  def on_begin(node)
@@ -114,9 +136,19 @@ module Mulang::Ruby
114
136
  end
115
137
 
116
138
  def on_defs(node)
117
- _target, id, args, body = *node
139
+ target, id, args, body = *node
140
+
141
+ result = simple_method id, process_all(args), process(body)
118
142
 
119
- simple_method id, process_all(args), process(body)
143
+ if target.type == :self
144
+ if @contexts.last == :module
145
+ result
146
+ else
147
+ ms(:Decorator, [ms(:Classy)], result)
148
+ end
149
+ else
150
+ ms(:EigenClass, process(target), result)
151
+ end
120
152
  end
121
153
 
122
154
  def on_def(node)
@@ -291,8 +323,8 @@ module Mulang::Ruby
291
323
  when :'&&' then primitive :And
292
324
  when :'||' then primitive :Or
293
325
  when :hash then primitive :Hash
294
- when :>= then primitive :GreatherOrEqualThan
295
- when :> then primitive :GreatherThan
326
+ when :>= then primitive :GreaterOrEqualThan
327
+ when :> then primitive :GreaterThan
296
328
  when :<= then primitive :LessOrEqualThan
297
329
  when :< then primitive :LessThan
298
330
  when :+ then primitive :Plus
@@ -1,5 +1,5 @@
1
1
  module Mulang
2
2
  module Ruby
3
- VERSION = "6.1.0"
3
+ VERSION = '6.3.0'
4
4
  end
5
5
  end
data/mulang-ruby.gemspec CHANGED
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "parser", "~> 2.6"
30
30
  spec.add_dependency "ast", "~> 2.4"
31
31
  spec.add_dependency "mumukit-core", "~> 1.0"
32
- spec.add_dependency "mulang", '~> 6.0', '>= 6.0.3'
32
+ spec.add_dependency "mulang", "~> 6.10"
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mulang-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,20 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '6.0'
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 6.0.3
123
+ version: '6.10'
127
124
  type: :runtime
128
125
  prerelease: false
129
126
  version_requirements: !ruby/object:Gem::Requirement
130
127
  requirements:
131
128
  - - "~>"
132
129
  - !ruby/object:Gem::Version
133
- version: '6.0'
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 6.0.3
130
+ version: '6.10'
137
131
  description: Ruby - Mulang Parser
138
132
  email:
139
133
  - franco@mumuki.org