mulang-ruby 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +0 -4
- data/lib/mulang/ruby.rb +4 -0
- data/lib/mulang/ruby/ast_processor.rb +38 -1
- data/lib/mulang/ruby/sexp.rb +10 -0
- data/lib/mulang/ruby/version.rb +1 -1
- data/mulang-ruby.gemspec +2 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7b7e1b03608d32ac99ba99a84ecb6c00a6db128491f7705616a5783cf1bffc22
|
4
|
+
data.tar.gz: c91a2299b7cdf95dcb2f834041dc5e39a0fcb229cbc044b05eeb5ad758573be0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a00c85cfcdcda31efcc10474c4b5f29e6390131470c7ae2ea7ee841f8cd0ab23b817dc02e40aa26dfc2bc3e821d2395b785db5469e781a2fce0b77f363c13c6e
|
7
|
+
data.tar.gz: df34437984268e50839c197585716353b7d52cbc9a0577fc433a432e8156f65691a204e96e8b85366f693f82d49d02c95ff3c9fb1b655fd1380fc2675c91655a
|
data/.travis.yml
CHANGED
@@ -8,10 +8,6 @@ before_install:
|
|
8
8
|
- export PATH=$HOME/.local/bin:$PATH
|
9
9
|
# Install bundler
|
10
10
|
- gem install bundler -v 1.14.6
|
11
|
-
# Install mulang
|
12
|
-
- wget https://github.com/mumuki/mulang/releases/download/v3.1.1/mulang
|
13
|
-
- mv mulang ~/.local/bin/mulang
|
14
|
-
- chmod +x ~/.local/bin/mulang
|
15
11
|
deploy:
|
16
12
|
provider: rubygems
|
17
13
|
api_key:
|
data/lib/mulang/ruby.rb
CHANGED
@@ -23,13 +23,42 @@ module Mulang::Ruby
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def on_begin(node)
|
26
|
-
|
26
|
+
sequence(*process_all(node))
|
27
27
|
end
|
28
28
|
|
29
29
|
def on_irange(node)
|
30
30
|
ms :Other
|
31
31
|
end
|
32
32
|
|
33
|
+
def on_regexp(node)
|
34
|
+
value, _ops = *node
|
35
|
+
|
36
|
+
simple_send ms(:Reference, :Regexp), :new, [process(value)]
|
37
|
+
end
|
38
|
+
|
39
|
+
def on_dstr(node)
|
40
|
+
parts = *node
|
41
|
+
|
42
|
+
simple_send ms(:MuList, process_all(parts)), :join, []
|
43
|
+
end
|
44
|
+
|
45
|
+
def on_or(node)
|
46
|
+
value, other = *node
|
47
|
+
simple_send process(value), '||', [process(other)]
|
48
|
+
end
|
49
|
+
|
50
|
+
def on_and(node)
|
51
|
+
value, other = *node
|
52
|
+
|
53
|
+
simple_send process(value), '&&', [process(other)]
|
54
|
+
end
|
55
|
+
|
56
|
+
def on_return(node)
|
57
|
+
value = *node
|
58
|
+
|
59
|
+
ms(:Return, process(value.first))
|
60
|
+
end
|
61
|
+
|
33
62
|
def on_defs(node)
|
34
63
|
_target, id, args, body = *node
|
35
64
|
body ||= s(:nil)
|
@@ -75,6 +104,11 @@ module Mulang::Ruby
|
|
75
104
|
ms :MuString, value
|
76
105
|
end
|
77
106
|
|
107
|
+
def on_sym(node)
|
108
|
+
value, _ = *node
|
109
|
+
ms :MuSymbol, value.to_s
|
110
|
+
end
|
111
|
+
|
78
112
|
def on_float(node)
|
79
113
|
value, _ = *node
|
80
114
|
ms :MuNumber, value
|
@@ -100,6 +134,9 @@ module Mulang::Ruby
|
|
100
134
|
ms :Assignment, id, process(value)
|
101
135
|
end
|
102
136
|
|
137
|
+
alias on_ivar on_lvar
|
138
|
+
alias on_ivasgn on_lvasgn
|
139
|
+
|
103
140
|
def on_const(node)
|
104
141
|
_ns, value = *node
|
105
142
|
ms :Reference, value
|
data/lib/mulang/ruby/sexp.rb
CHANGED
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: 1.
|
4
|
+
version: 1.1.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: 2017-
|
11
|
+
date: 2017-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,16 +84,30 @@ dependencies:
|
|
84
84
|
name: mumukit-core
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '1.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mulang
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.3'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.3'
|
97
111
|
description: Ruby - Mulang Parser
|
98
112
|
email:
|
99
113
|
- franco@mumuki.org
|
@@ -139,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
153
|
version: '0'
|
140
154
|
requirements: []
|
141
155
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.7.2
|
143
157
|
signing_key:
|
144
158
|
specification_version: 4
|
145
159
|
summary: Ruby integration for the Mulang Language Analyzer
|