mulang-ruby 5.0.0 → 6.0.0
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 +4 -4
- data/.github/workflows/test_and_deploy.yml +31 -0
- data/lib/mulang/ruby/ast_processor.rb +22 -20
- data/lib/mulang/ruby/sexp.rb +5 -47
- data/lib/mulang/ruby/version.rb +1 -1
- data/mulang-ruby.gemspec +1 -1
- metadata +6 -7
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bffbfe0515ffc42d5a7cc62ac0c219f01efed7ca0a09867e081f87db7d60e17e
|
4
|
+
data.tar.gz: b4b58bb43f77bf21979922180af6a1dbcd2b99b9400e6a67b41cea7d618e8428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0259e8d0bd2b6ae8782381eb98fa3025d461b0e7f5735547575af614bad2900b187b4dca409fa78d95554300fa2500513bbfcbf448501231008915aae7eb2b62'
|
7
|
+
data.tar.gz: 3c3c1cf74dee097855440376b97a934e273523545a82a38ad1fc47778b3b8c4ed2e39333e39d2b51945fa748cb31b91c778d7f2d8d7d0e42a5c50c3ab5f3a877
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Test and deploy
|
2
|
+
|
3
|
+
on:
|
4
|
+
- push
|
5
|
+
- workflow_dispatch
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test_and_deploy:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
- name: Set up Ruby
|
13
|
+
uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.3
|
16
|
+
- name: Install dependencies
|
17
|
+
run: bundle install
|
18
|
+
- name: Run tests
|
19
|
+
run: bundle exec rake
|
20
|
+
- name: Deploy
|
21
|
+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
22
|
+
run: |
|
23
|
+
mkdir -p $HOME/.gem
|
24
|
+
touch $HOME/.gem/credentials
|
25
|
+
chmod 0600 $HOME/.gem/credentials
|
26
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
27
|
+
gem build *.gemspec
|
28
|
+
gem push *.gem
|
29
|
+
env:
|
30
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
31
|
+
|
@@ -28,13 +28,13 @@ module Mulang::Ruby
|
|
28
28
|
|
29
29
|
def on_rescue(node)
|
30
30
|
try, *catch, _ = *node
|
31
|
-
ms :Try, process(try), process_all(catch),
|
31
|
+
ms :Try, process(try), process_all(catch), none
|
32
32
|
end
|
33
33
|
|
34
34
|
def on_resbody(node)
|
35
35
|
patterns, variable, block = *node
|
36
36
|
|
37
|
-
[to_mulang_pattern(patterns, variable), process(block) ||
|
37
|
+
[to_mulang_pattern(patterns, variable), process(block) || none]
|
38
38
|
end
|
39
39
|
|
40
40
|
def _
|
@@ -120,9 +120,9 @@ module Mulang::Ruby
|
|
120
120
|
|
121
121
|
case id
|
122
122
|
when :equal?, :eql?, :==
|
123
|
-
|
123
|
+
primitive_method :Equal, process_all(args), process(body)
|
124
124
|
when :hash
|
125
|
-
|
125
|
+
primitive_method :Hash, process_all(args), process(body)
|
126
126
|
else
|
127
127
|
simple_method id, process_all(args), process(body)
|
128
128
|
end
|
@@ -130,7 +130,7 @@ module Mulang::Ruby
|
|
130
130
|
|
131
131
|
def on_block(node)
|
132
132
|
send, parameters, body = *node
|
133
|
-
lambda = ms(:Lambda, process_all(parameters), process(body) ||
|
133
|
+
lambda = ms(:Lambda, process_all(parameters), process(body) || none)
|
134
134
|
handle_send_with_args send, [lambda]
|
135
135
|
end
|
136
136
|
|
@@ -155,7 +155,7 @@ module Mulang::Ruby
|
|
155
155
|
variable, list, block = *node
|
156
156
|
|
157
157
|
pattern = ms(:VariablePattern, variable.children.first)
|
158
|
-
ms(:For, [ms(:Generator, pattern, process(list))], process(block) ||
|
158
|
+
ms(:For, [ms(:Generator, pattern, process(list))], process(block) || none)
|
159
159
|
end
|
160
160
|
|
161
161
|
def on_optarg(node)
|
@@ -279,20 +279,22 @@ module Mulang::Ruby
|
|
279
279
|
|
280
280
|
def message_reference(message)
|
281
281
|
case message
|
282
|
-
when :==
|
283
|
-
when :!=
|
284
|
-
when :!
|
285
|
-
when :'&&'
|
286
|
-
when :'||'
|
287
|
-
when :hash
|
288
|
-
when :>=
|
289
|
-
when :>
|
290
|
-
when :<=
|
291
|
-
when :<
|
292
|
-
when :+
|
293
|
-
when :-
|
294
|
-
when :*
|
295
|
-
when :/
|
282
|
+
when :== then primitive :Equal
|
283
|
+
when :!= then primitive :NotEqual
|
284
|
+
when :! then primitive :Negation
|
285
|
+
when :'&&' then primitive :And
|
286
|
+
when :'||' then primitive :Or
|
287
|
+
when :hash then primitive :Hash
|
288
|
+
when :>= then primitive :GreatherOrEqualThan
|
289
|
+
when :> then primitive :GreatherThan
|
290
|
+
when :<= then primitive :LessOrEqualThan
|
291
|
+
when :< then primitive :LessThan
|
292
|
+
when :+ then primitive :Plus
|
293
|
+
when :- then primitive :Minus
|
294
|
+
when :* then primitive :Multiply
|
295
|
+
when :/ then primitive :Divide
|
296
|
+
when :length then primitive :Size
|
297
|
+
when :size then primitive :Size
|
296
298
|
else ms :Reference, message
|
297
299
|
end
|
298
300
|
end
|
data/lib/mulang/ruby/sexp.rb
CHANGED
@@ -1,53 +1,11 @@
|
|
1
|
+
require "mulang"
|
2
|
+
|
1
3
|
module Mulang::Ruby
|
2
4
|
module Sexp
|
3
|
-
|
4
|
-
if contents.empty?
|
5
|
-
ms(:MuNil)
|
6
|
-
elsif contents.size == 1
|
7
|
-
contents[0]
|
8
|
-
else
|
9
|
-
ms(:Sequence, *contents)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def ms(tag, *contents)
|
14
|
-
if contents.empty?
|
15
|
-
{tag: tag}
|
16
|
-
elsif contents.size == 1
|
17
|
-
{tag: tag, contents: contents.first}
|
18
|
-
else
|
19
|
-
{tag: tag, contents: contents}
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def simple_method(name, args, body)
|
24
|
-
{
|
25
|
-
tag: :Method,
|
26
|
-
contents: [
|
27
|
-
name,
|
28
|
-
[
|
29
|
-
[ args, {tag: :UnguardedBody, contents: body }]
|
30
|
-
]
|
31
|
-
]
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def mu_primitive_method(type, args, body)
|
36
|
-
{
|
37
|
-
tag: :PrimitiveMethod,
|
38
|
-
contents: [
|
39
|
-
type,
|
40
|
-
[ args, {tag: :UnguardedBody, contents: body }]
|
41
|
-
]
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
def simple_send(sender, message, args)
|
46
|
-
ms(:Send, sender, ms(:Reference, message), args)
|
47
|
-
end
|
5
|
+
include Mulang::Sexp
|
48
6
|
|
49
|
-
def
|
50
|
-
ms(:
|
7
|
+
def none
|
8
|
+
ms(:MuNil)
|
51
9
|
end
|
52
10
|
end
|
53
11
|
end
|
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:
|
4
|
+
version: 6.0.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: 2021-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,14 +120,14 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
123
|
+
version: '6.0'
|
124
124
|
type: :runtime
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
130
|
+
version: '6.0'
|
131
131
|
description: Ruby - Mulang Parser
|
132
132
|
email:
|
133
133
|
- franco@mumuki.org
|
@@ -135,10 +135,10 @@ executables: []
|
|
135
135
|
extensions: []
|
136
136
|
extra_rdoc_files: []
|
137
137
|
files:
|
138
|
+
- ".github/workflows/test_and_deploy.yml"
|
138
139
|
- ".gitignore"
|
139
140
|
- ".rspec"
|
140
141
|
- ".ruby-version"
|
141
|
-
- ".travis.yml"
|
142
142
|
- CODE_OF_CONDUCT.md
|
143
143
|
- COPYRIGHT.txt
|
144
144
|
- Gemfile
|
@@ -173,8 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
|
177
|
-
rubygems_version: 2.7.7
|
176
|
+
rubygems_version: 3.0.3
|
178
177
|
signing_key:
|
179
178
|
specification_version: 4
|
180
179
|
summary: Ruby integration for the Mulang Language Analyzer
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.3.1
|
5
|
-
before_install:
|
6
|
-
# Extend Path
|
7
|
-
- mkdir -p ~/.local/bin
|
8
|
-
- export PATH=$HOME/.local/bin:$PATH
|
9
|
-
# Install bundler
|
10
|
-
- gem install bundler -v 1.14.6
|
11
|
-
deploy:
|
12
|
-
provider: rubygems
|
13
|
-
api_key:
|
14
|
-
secure: UReab6XV1hLEiB+qmV2z7urHDApuD8MLINMOXxjaU7X6jplHmTttgci+wuP3w8Q+oqAy1s97j270ofQszHogppOtxa+AZzmXvI9TPZ5XRJJXFNH4Bt5RguP/gIN2bZEmCESdbpsTC6w5gxvDAfSQTPSE0mO/MLY5xRUYja/RdmhxdrvQuzir+c9L+hzGT4ysoiJ7UXkaKEUsfi2ief9/XRflmzTytf+C0uNSjFbVo0JCB5StBJwxmaUAMH2F5LQTZPUBDu+/FFJJO3w/yyYcRrqsNxujqJozXQZAwsmR3myMxyKIOZFAGCeC22+6XKPDHDSBLnNsQzWFdCieUzgsd3jZJFYeorXY63Uv5cGa1F+S7tbLmdXHBlbSfN2e5g6AUse1HyFXqgzgVUUftgZ8Uv7Ttc+BN9R1uzxMTJ7ox1wGncc01rbfQ/KPD0W0XEwON18aiCYjM5XvVNb4F1W4e7mNk28tdrxIC6RNkScpKLg5E0td1xPRkRDo2ZO2KWRZGGrabzjr05TTTWrI1+YVx3Mm4N1RiirjC5HybdHy5JO7eLDYU/FIXlVRwjCN7LKnP42zUsic1Y5JCYNs1RzZdJlH5sQaC/boy0bi2pVbehh3BlAbdCQu/ckqla7RG0ab5Bbw01m4aNSO5PkdIksxAN6yuelKkFXrSrs3pXEr528=
|
15
|
-
gem: mulang-ruby
|
16
|
-
on:
|
17
|
-
tags: true
|
18
|
-
repo: mumuki/mulang-ruby
|