mulang 6.0.3 → 6.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mulang +0 -0
- data/lib/mulang/code.rb +2 -2
- data/lib/mulang/language.rb +28 -8
- data/lib/mulang/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c939a5ccbb3c37d4185d74b92716ec2edb749e749ba030957cf76cde4f4eca8a
|
4
|
+
data.tar.gz: d26a911d0af64e7909a3febc313609c3c4014d16f493135b095925accf8b5cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42d6d6a37862e5f72e052c45e21e1889614a27f16ee5b26e5a9155e1450fa0520b7ab29b31eee145b3a6848ea2127a1fe46ceead60d78dbcbfa94ca65b7fc84f
|
7
|
+
data.tar.gz: b982f347a29409ebcce08d54d20f766c152217c761fedb5b5229671731ca816f10c0816774d670511e08d152d2af94ae7039e04280c3641ac207c83a87a71691
|
data/bin/mulang
CHANGED
Binary file
|
data/lib/mulang/code.rb
CHANGED
data/lib/mulang/language.rb
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
module Mulang::Language
|
2
|
+
CORE_LANGUAGES = %w(
|
3
|
+
Java
|
4
|
+
JavaScript
|
5
|
+
Prolog
|
6
|
+
Haskell
|
7
|
+
Python
|
8
|
+
Python2
|
9
|
+
Python3
|
10
|
+
Ruby
|
11
|
+
Php
|
12
|
+
C
|
13
|
+
Mulang
|
14
|
+
)
|
15
|
+
|
2
16
|
class Base
|
3
17
|
def identifiers(content, **options)
|
4
18
|
Mulang.analyse(identifiers_analysis(content, **options), **options)['outputIdentifiers'] rescue nil
|
5
19
|
end
|
6
20
|
|
7
21
|
def identifiers_analysis(content, **options)
|
8
|
-
|
22
|
+
build_analysis content, {includeOutputIdentifiers: true}, **options
|
9
23
|
end
|
10
24
|
|
11
25
|
def transformed_asts(content, operations, **options)
|
@@ -13,7 +27,7 @@ module Mulang::Language
|
|
13
27
|
end
|
14
28
|
|
15
29
|
def transformed_asts_analysis(content, operations, **options)
|
16
|
-
|
30
|
+
build_analysis content, {transformationSpecs: operations}, **options
|
17
31
|
end
|
18
32
|
|
19
33
|
def normalization_options(**options)
|
@@ -25,12 +39,10 @@ module Mulang::Language
|
|
25
39
|
end
|
26
40
|
|
27
41
|
def ast_analysis(content, **options)
|
28
|
-
|
42
|
+
build_analysis content, {includeOutputAst: true}, **options
|
29
43
|
end
|
30
44
|
|
31
|
-
|
32
|
-
|
33
|
-
def base_analysis(content, spec, **options)
|
45
|
+
def build_analysis(content, spec, **options)
|
34
46
|
{
|
35
47
|
sample: sample(content),
|
36
48
|
spec: {
|
@@ -57,6 +69,10 @@ module Mulang::Language
|
|
57
69
|
content: content
|
58
70
|
}
|
59
71
|
end
|
72
|
+
|
73
|
+
def core_name
|
74
|
+
@name
|
75
|
+
end
|
60
76
|
end
|
61
77
|
|
62
78
|
class External < Base
|
@@ -82,8 +98,12 @@ module Mulang::Language
|
|
82
98
|
}
|
83
99
|
end
|
84
100
|
|
85
|
-
def
|
86
|
-
super.deep_merge(spec: {originalLanguage:
|
101
|
+
def build_analysis(*)
|
102
|
+
super.deep_merge(spec: {originalLanguage: core_name}.compact)
|
103
|
+
end
|
104
|
+
|
105
|
+
def core_name
|
106
|
+
@name.in?(CORE_LANGUAGES) ? name : nil
|
87
107
|
end
|
88
108
|
|
89
109
|
private
|
data/lib/mulang/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mulang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-core
|