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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 182d9dc0befc244e258aad82df8004b96c4cfbf4e3c61b2267fd8eca5cea24f5
4
- data.tar.gz: 47e8caed69cf3e891b1b61edae11351d7c994153d3556676926117e9ae1f5efd
3
+ metadata.gz: c939a5ccbb3c37d4185d74b92716ec2edb749e749ba030957cf76cde4f4eca8a
4
+ data.tar.gz: d26a911d0af64e7909a3febc313609c3c4014d16f493135b095925accf8b5cae
5
5
  SHA512:
6
- metadata.gz: 9ec56318e2bead4146346ae0841a0967b51aad104ff0f45ad4e315bc6c71dada1784ce70c2d4f3128ee2bf867994528a67665d2d40e7350322effd0551b8d6be
7
- data.tar.gz: 5bded1ee77300941d9353b0ffef44b7d59d113a3d79e643a3b1278d3f5e4deb4a1787101e3026d8038489c5e208c75a09f130f657e69484ec7cd051df13e8d33
6
+ metadata.gz: 42d6d6a37862e5f72e052c45e21e1889614a27f16ee5b26e5a9155e1450fa0520b7ab29b31eee145b3a6848ea2127a1fe46ceead60d78dbcbfa94ca65b7fc84f
7
+ data.tar.gz: b982f347a29409ebcce08d54d20f766c152217c761fedb5b5229671731ca816f10c0816774d670511e08d152d2af94ae7039e04280c3641ac207c83a87a71691
data/bin/mulang CHANGED
Binary file
data/lib/mulang/code.rb CHANGED
@@ -30,8 +30,8 @@ module Mulang
30
30
  @language.sample @content
31
31
  end
32
32
 
33
- def analysis(spec)
34
- { sample: sample, spec: spec }
33
+ def analysis(spec, **options)
34
+ @language.build_analysis @content, spec, **options
35
35
  end
36
36
 
37
37
  def analyse(spec, **options)
@@ -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
- base_analysis content, {includeOutputIdentifiers: true}, **options
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
- base_analysis content, {transformationSpecs: operations}, **options
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
- base_analysis content, {includeOutputAst: true}, **options
42
+ build_analysis content, {includeOutputAst: true}, **options
29
43
  end
30
44
 
31
- private
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 base_analysis(*)
86
- super.deep_merge(spec: {originalLanguage: @name}.compact)
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
@@ -1,4 +1,4 @@
1
1
  module Mulang
2
- VERSION = "6.0.3"
3
- MULANG_VERSION = "6.0.3"
2
+ VERSION = "6.0.4"
3
+ MULANG_VERSION = "6.0.4"
4
4
  end
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.3
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-01 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-core