mulang-ruby 5.0.0 → 6.0.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: beb92a73844dc910e25060e880ee2f4c7b65f99feaea4b7cf9afdeb6f5fe8b59
4
- data.tar.gz: 9d7e6cee290d77b29485b8757d3c1b1c6baee08dc09ca0060a717dfca83f5b40
3
+ metadata.gz: bffbfe0515ffc42d5a7cc62ac0c219f01efed7ca0a09867e081f87db7d60e17e
4
+ data.tar.gz: b4b58bb43f77bf21979922180af6a1dbcd2b99b9400e6a67b41cea7d618e8428
5
5
  SHA512:
6
- metadata.gz: 37317ff94e92ca730cb14523cb0d5fd4499ec0a70cd4f89af8a66050f4662fbb300c41d0ef439cb216f5e0dd01d8a1a5fbf0a8b9cf5769a16c5bdd76d6631bf6
7
- data.tar.gz: fd5a5dd350e847cbb6aa916ba2ecafe8627091ed858039383cd3c15036d3617f5131ab6b6dfee4e5c5e40506a35896cc32e19522ac6b6be3aeab480a3db7e68c
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), ms(:MuNil)
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) || ms(:MuNil)]
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
- mu_primitive_method :Equal, process_all(args), process(body)
123
+ primitive_method :Equal, process_all(args), process(body)
124
124
  when :hash
125
- mu_primitive_method :Hash, process_all(args), process(body)
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) || ms(:MuNil))
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) || ms(:MuNil))
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 :== then ms :Primitive, :Equal
283
- when :!= then ms :Primitive, :NotEqual
284
- when :! then ms :Primitive, :Negation
285
- when :'&&' then ms :Primitive, :And
286
- when :'||' then ms :Primitive, :Or
287
- when :hash then ms :Primitive, :Hash
288
- when :>= then ms :Primitive, :GreatherOrEqualThan
289
- when :> then ms :Primitive, :GreatherThan
290
- when :<= then ms :Primitive, :LessOrEqualThan
291
- when :< then ms :Primitive, :LessThan
292
- when :+ then ms :Primitive, :Plus
293
- when :- then ms :Primitive, :Minus
294
- when :* then ms :Primitive, :Multiply
295
- when :/ then ms :Primitive, :Divide
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
@@ -1,53 +1,11 @@
1
+ require "mulang"
2
+
1
3
  module Mulang::Ruby
2
4
  module Sexp
3
- def sequence(*contents)
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 primitive_send(sender, op, args)
50
- ms(:Send, sender, ms(:Primitive, op), args)
7
+ def none
8
+ ms(:MuNil)
51
9
  end
52
10
  end
53
11
  end
@@ -1,5 +1,5 @@
1
1
  module Mulang
2
2
  module Ruby
3
- VERSION = "5.0.0"
3
+ VERSION = "6.0.0"
4
4
  end
5
5
  end
@@ -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", "~> 5.0"
32
+ spec.add_dependency "mulang", "~> 6.0"
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: 5.0.0
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: 2019-09-27 00:00:00.000000000 Z
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: '5.0'
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: '5.0'
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
- rubyforge_project:
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
@@ -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