mbt-gen 0.0.6 → 0.0.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/mbt-gen.rb +16 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60f33b703c44710c8f3fd4ac743eda550f72af721e6480beb9c62d4e7d1258c7
|
|
4
|
+
data.tar.gz: 53f6012841f8572350c02cffa8fb841ae7de411985c15c21f7c7e02465e191f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9143a6315fa8e359420862a2e0d8d6dbaf08efb2ae9f749d3f51a178f55ffc619602d098dba6e518cfb606a92fb5f730d2fb627216320817d37aa38a2dc706fd
|
|
7
|
+
data.tar.gz: 292e6fa9e9dc391c906b6d3ee305edc8c7c8a74b39e345380813014177c4d7c68753dfe46eb37ce64ff6ec8aa24f8da261ab97f797d44430fe72aa0ba363934d
|
data/lib/mbt-gen.rb
CHANGED
|
@@ -596,6 +596,15 @@ def translate_validation_rule_to_SMTLIB(rule, context_struct, prefix, config, op
|
|
|
596
596
|
field = resolve_field_path($1, context_struct, prefix)
|
|
597
597
|
filled_var_for_field(field)
|
|
598
598
|
end
|
|
599
|
+
.gsub(/LIST_VALUE\[[^\]]*,[^\]]*\]/) do |m|
|
|
600
|
+
unless m =~ /LIST_VALUE\[([^\]]*),([^\]]*)\]/ then
|
|
601
|
+
raise RuntimeError.new("could not parse LIST_VALUE_FIRST_ELEMENT[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
602
|
+
end
|
|
603
|
+
xpath = $1
|
|
604
|
+
index = Integer($2)
|
|
605
|
+
l = resolve_field_path(xpath, context_struct, prefix)
|
|
606
|
+
value_var_for_list(l, index)
|
|
607
|
+
end
|
|
599
608
|
.gsub(/VALUE\[[^\]]*\]/) do |m|
|
|
600
609
|
unless m =~ /VALUE\[([^\]]*)\]/ then
|
|
601
610
|
raise RuntimeError.new("could not parse VALUE[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
@@ -630,15 +639,6 @@ def translate_validation_rule_to_SMTLIB(rule, context_struct, prefix, config, op
|
|
|
630
639
|
end
|
|
631
640
|
"(or #{terms.join(" ")})"
|
|
632
641
|
end
|
|
633
|
-
.gsub(/LIST_VALUE\[[^\]]*,[^\]]*\]/) do |m|
|
|
634
|
-
unless m =~ /LIST_VALUE\[([^\]]*),([^\]]*)\]/ then
|
|
635
|
-
raise RuntimeError.new("could not parse LIST_VALUE_FIRST_ELEMENT[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
636
|
-
end
|
|
637
|
-
xpath = $1
|
|
638
|
-
index = Integer($2)
|
|
639
|
-
l = resolve_field_path(xpath, context_struct, prefix)
|
|
640
|
-
value_var_for_list(l, index)
|
|
641
|
-
end
|
|
642
642
|
.gsub(/LIST_VALUE_FIRST_ELEMENT\[[^\]]*\]/) do |m| # DEPRECATED! Please use LIST_VALUE[...] instead.
|
|
643
643
|
unless m =~ /LIST_VALUE_FIRST_ELEMENT\[([^\]]*)\]/ then
|
|
644
644
|
raise RuntimeError.new("could not parse LIST_VALUE_FIRST_ELEMENT[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
@@ -1723,7 +1723,13 @@ def validate_model(message, prefix=nil)
|
|
|
1723
1723
|
end
|
|
1724
1724
|
elsif value[:type] == :list then
|
|
1725
1725
|
unless value[:datatype] then
|
|
1726
|
-
raise RuntimeError.new("Model Problem: encountered list without
|
|
1726
|
+
raise RuntimeError.new("Model Problem: encountered list without :datatype property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1727
|
+
end
|
|
1728
|
+
unless value[:model_maxLength] then
|
|
1729
|
+
raise RuntimeError.new("Model Problem: encountered list without :model_maxLength property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1730
|
+
end
|
|
1731
|
+
unless value[:xpath_element] then
|
|
1732
|
+
raise RuntimeError.new("Model Problem: encountered list without :xpath_element property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1727
1733
|
end
|
|
1728
1734
|
if value[:datatype] == :enum then
|
|
1729
1735
|
unless value[:values] then
|