lutaml-lml 0.1.5 → 0.1.7
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/lib/lutaml/lml/data_processor/attribute_processing.rb +2 -1
- data/lib/lutaml/lml/formatter/graphviz/node_formatter.rb +17 -3
- data/lib/lutaml/lml/grammar/lml.artifact.json +7796 -0
- data/lib/lutaml/lml/grammar/lml.parg +173 -0
- data/lib/lutaml/lml/grammar.rb +39 -4
- data/lib/lutaml/lml/has_attributes.rb +1 -1
- data/lib/lutaml/lml/model_compiler.rb +35 -9
- data/lib/lutaml/lml/models/top_element_attribute.rb +2 -2
- data/lib/lutaml/lml/models/uml_class.rb +0 -2
- data/lib/lutaml/lml/parser.rb +11 -9
- data/lib/lutaml/lml/pipeline.rb +20 -7
- data/lib/lutaml/lml/transform.rb +4 -4
- data/lib/lutaml/lml/version.rb +1 -1
- metadata +7 -16
- data/lib/lutaml/lml/grammar/concerns/associations.rb +0 -76
- data/lib/lutaml/lml/grammar/concerns/attributes.rb +0 -126
- data/lib/lutaml/lml/grammar/concerns/data_structures.rb +0 -84
- data/lib/lutaml/lml/grammar/concerns/definitions.rb +0 -212
- data/lib/lutaml/lml/grammar/concerns/instance_rules.rb +0 -59
- data/lib/lutaml/lml/grammar/concerns/primitives.rb +0 -98
- data/lib/lutaml/lml/grammar/concerns/view_rules.rb +0 -52
- data/lib/lutaml/lml/grammar/concerns.rb +0 -17
- data/lib/lutaml/lml/grammar/core.rb +0 -71
- data/lib/lutaml/lml/grammar/full.rb +0 -12
- data/lib/lutaml/lml/grammar/instances.rb +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 43171296e53409193af9a65974a2e30adb2f425c8dd952eb5a08be556411cb6b
|
|
4
|
+
data.tar.gz: 8146fffb1c51f8fcd7d5061192596a8e73749c443a573f6a6e48c00c5885997c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e50bf16b938b8708125c81d828c2350224dc7ed7ef9526e6fd7a066f44041b7e990003bfd6f3315aee69cdc68628399691dab28aacc7c4c2a233074d43887f0d
|
|
7
|
+
data.tar.gz: ba5efefb14c289839ca8fcc03d9102847cc495797816ddf51ce5dd1177d9ba100324e415ff329bb2b74b88e8db32532baa08e040e94f4e8ffff2ae2c9f23f3d5
|
|
@@ -4,7 +4,7 @@ module Lutaml
|
|
|
4
4
|
module Lml
|
|
5
5
|
class DataProcessor
|
|
6
6
|
module AttributeProcessing
|
|
7
|
-
EXCLUDED_PASS_THROUGH_KEYS = %i[key value comments add attributes properties].freeze
|
|
7
|
+
EXCLUDED_PASS_THROUGH_KEYS = %i[key value comments add attributes properties type_literal].freeze
|
|
8
8
|
|
|
9
9
|
def process_attributes(obj)
|
|
10
10
|
case obj
|
|
@@ -31,6 +31,7 @@ module Lutaml
|
|
|
31
31
|
result = extract_name_and_value(obj)
|
|
32
32
|
convert_instance_type(result)
|
|
33
33
|
result[:extended] = !obj[:add].nil? if obj.key?(:add)
|
|
34
|
+
result[:literal] = true if obj.key?(:type_literal)
|
|
34
35
|
apply_nested_attributes(result, obj)
|
|
35
36
|
apply_remaining_keys(result, obj)
|
|
36
37
|
result
|
|
@@ -14,8 +14,8 @@ module Lutaml
|
|
|
14
14
|
symbol = ACCESS_SYMBOLS[node.visibility]
|
|
15
15
|
result = "#{symbol}#{node.name}"
|
|
16
16
|
if node.type
|
|
17
|
-
|
|
18
|
-
result += " : #{
|
|
17
|
+
stereotype = node.stereotype.empty? ? '' : node.stereotype.map { |s| "«#{s}»" }.join
|
|
18
|
+
result += " : #{stereotype}#{node.type}"
|
|
19
19
|
end
|
|
20
20
|
result += format_cardinality_bounds(node.cardinality) if node.cardinality
|
|
21
21
|
result = escape_html_chars(result)
|
|
@@ -48,9 +48,23 @@ module Lutaml
|
|
|
48
48
|
end.join(', ')
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
# Kind labels rendered above the name: guillemet stereotypes first,
|
|
52
|
+
# then the entity-kind label (enums/data types/primitives carry no
|
|
53
|
+
# user stereotypes of their own in the grammar).
|
|
54
|
+
KIND_LABELS = {
|
|
55
|
+
enums: "enumeration",
|
|
56
|
+
data_types: "dataType",
|
|
57
|
+
primitives: "primitive"
|
|
58
|
+
}.freeze
|
|
59
|
+
|
|
51
60
|
def format_class(node, hide_members = nil)
|
|
52
61
|
name = ["<B>#{escape_html_chars(node.name)}</B>"]
|
|
53
|
-
|
|
62
|
+
node.stereotype.each do |stereotype|
|
|
63
|
+
name.unshift("«#{escape_html_chars(stereotype)}»")
|
|
64
|
+
end
|
|
65
|
+
if (kind = KIND_LABELS[node.class.entity_type])
|
|
66
|
+
name.unshift("«#{kind}»")
|
|
67
|
+
end
|
|
54
68
|
name_html = build_name_table(name)
|
|
55
69
|
|
|
56
70
|
member_formatter = node.is_a?(Lml::Enum) ? method(:format_enum_member) : nil
|