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 +4 -4
- data/.github/workflows/test_and_deploy.yml +2 -2
- data/lib/mulang/ruby/ast_processor.rb +36 -4
- data/lib/mulang/ruby/version.rb +1 -1
- data/mulang-ruby.gemspec +1 -1
- metadata +4 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00df60c46038a6626d1e3de934030c8ab3900c7b349c02d75e8be6c4baa64938
|
4
|
+
data.tar.gz: c12bb657bbb5553ec708ec38fa919a2d3bad2c33828e9242c56ae37996bc3337
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
17
|
-
|
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
|
-
|
139
|
+
target, id, args, body = *node
|
140
|
+
|
141
|
+
result = simple_method id, process_all(args), process(body)
|
118
142
|
|
119
|
-
|
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 :
|
295
|
-
when :> then primitive :
|
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
|
data/lib/mulang/ruby/version.rb
CHANGED
data/mulang-ruby.gemspec
CHANGED
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.
|
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:
|
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.
|
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.
|
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
|