expressir 0.2.17-x86-mingw32 → 0.2.25-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +5 -0
- data/.github/workflows/release.yml +31 -3
- data/README.adoc +3 -3
- data/exe/format +45 -29
- data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
- data/lib/expressir/express_exp/cache.rb +48 -0
- data/lib/expressir/express_exp/formatter.rb +2 -2
- data/lib/expressir/express_exp/hyperlink_formatter.rb +10 -15
- data/lib/expressir/express_exp/model_visitor.rb +23 -0
- data/lib/expressir/express_exp/parser.rb +18 -3
- data/lib/expressir/express_exp/resolve_references_model_visitor.rb +33 -0
- data/lib/expressir/express_exp/visitor.rb +19 -18
- data/lib/expressir/model.rb +3 -1
- data/lib/expressir/model/attribute.rb +12 -5
- data/lib/expressir/model/cache.rb +13 -0
- data/lib/expressir/model/constant.rb +9 -2
- data/lib/expressir/model/entity.rb +10 -8
- data/lib/expressir/model/enumeration_item.rb +7 -0
- data/lib/expressir/model/expressions/aggregate_initializer.rb +1 -1
- data/lib/expressir/model/expressions/aggregate_item.rb +2 -2
- data/lib/expressir/model/expressions/attribute_reference.rb +2 -2
- data/lib/expressir/model/expressions/binary_expression.rb +3 -3
- data/lib/expressir/model/expressions/call.rb +2 -2
- data/lib/expressir/model/expressions/entity_constructor.rb +2 -2
- data/lib/expressir/model/expressions/group_reference.rb +2 -2
- data/lib/expressir/model/expressions/index_reference.rb +3 -3
- data/lib/expressir/model/expressions/interval.rb +5 -5
- data/lib/expressir/model/expressions/query_expression.rb +5 -3
- data/lib/expressir/model/expressions/simple_reference.rb +5 -1
- data/lib/expressir/model/expressions/unary_expression.rb +2 -2
- data/lib/expressir/model/function.rb +13 -11
- data/lib/expressir/model/identifier.rb +6 -3
- data/lib/expressir/model/interface.rb +3 -3
- data/lib/expressir/model/interface_item.rb +2 -2
- data/lib/expressir/model/interfaced_item.rb +9 -8
- data/lib/expressir/model/literals/binary.rb +1 -1
- data/lib/expressir/model/literals/integer.rb +1 -1
- data/lib/expressir/model/literals/logical.rb +1 -1
- data/lib/expressir/model/literals/real.rb +1 -1
- data/lib/expressir/model/literals/string.rb +2 -2
- data/lib/expressir/model/model_element.rb +46 -21
- data/lib/expressir/model/parameter.rb +9 -2
- data/lib/expressir/model/procedure.rb +12 -10
- data/lib/expressir/model/{informal_proposition.rb → remark_item.rb} +3 -6
- data/lib/expressir/model/repository.rb +1 -1
- data/lib/expressir/model/rule.rb +14 -12
- data/lib/expressir/model/schema.rb +13 -11
- data/lib/expressir/model/statements/alias.rb +5 -3
- data/lib/expressir/model/statements/assignment.rb +2 -2
- data/lib/expressir/model/statements/call.rb +2 -2
- data/lib/expressir/model/statements/case.rb +3 -3
- data/lib/expressir/model/statements/case_action.rb +2 -2
- data/lib/expressir/model/statements/compound.rb +1 -1
- data/lib/expressir/model/statements/if.rb +3 -3
- data/lib/expressir/model/statements/repeat.rb +9 -7
- data/lib/expressir/model/statements/return.rb +1 -1
- data/lib/expressir/model/subtype_constraint.rb +11 -4
- data/lib/expressir/model/type.rb +6 -4
- data/lib/expressir/model/types/aggregate.rb +8 -1
- data/lib/expressir/model/types/array.rb +5 -5
- data/lib/expressir/model/types/bag.rb +3 -3
- data/lib/expressir/model/types/binary.rb +2 -2
- data/lib/expressir/model/types/enumeration.rb +4 -4
- data/lib/expressir/model/types/generic.rb +7 -0
- data/lib/expressir/model/types/generic_entity.rb +7 -0
- data/lib/expressir/model/types/list.rb +4 -4
- data/lib/expressir/model/types/real.rb +1 -1
- data/lib/expressir/model/types/select.rb +5 -5
- data/lib/expressir/model/types/set.rb +3 -3
- data/lib/expressir/model/types/string.rb +2 -2
- data/lib/expressir/model/unique.rb +8 -1
- data/lib/expressir/model/variable.rb +9 -2
- data/lib/expressir/model/where.rb +8 -1
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/multiple.yaml +18 -0
- data/original/examples/syntax/remark.exp +12 -10
- data/original/examples/syntax/remark.yaml +24 -3
- data/original/examples/syntax/remark_formatted.exp +3 -1
- data/original/examples/syntax/single.exp +1 -0
- data/original/examples/syntax/single.yaml +7 -0
- data/original/examples/syntax/single_formatted.exp +4 -0
- data/original/examples/syntax/single_formatted.yaml +15 -0
- data/original/examples/syntax/syntax.yaml +82 -0
- data/original/examples/syntax/syntax_hyperlink_formatted.exp +902 -0
- data/spec/expressir/express_exp/cache_spec.rb +64 -0
- data/spec/expressir/express_exp/formatter_spec.rb +17 -0
- data/spec/expressir/express_exp/parser_spec.rb +9 -9
- data/spec/expressir/model/model_element_spec.rb +32 -29
- metadata +9 -3
@@ -0,0 +1,64 @@
|
|
1
|
+
require "yaml"
|
2
|
+
require "tempfile"
|
3
|
+
require "spec_helper"
|
4
|
+
require "expressir/express_exp/parser"
|
5
|
+
require "expressir/express_exp/cache"
|
6
|
+
|
7
|
+
RSpec.describe Expressir::ExpressExp::Cache do
|
8
|
+
TEST_VERSION = "0.0.0"
|
9
|
+
|
10
|
+
describe ".to_file" do
|
11
|
+
it "exports an object" do
|
12
|
+
temp_file = Tempfile.new
|
13
|
+
|
14
|
+
repository = Expressir::Model::Repository.new
|
15
|
+
|
16
|
+
begin
|
17
|
+
Expressir::ExpressExp::Cache.to_file(temp_file, repository, test_overwrite_version: TEST_VERSION)
|
18
|
+
|
19
|
+
size = File.size(temp_file)
|
20
|
+
|
21
|
+
expect(size).to be > 0
|
22
|
+
ensure
|
23
|
+
temp_file.close
|
24
|
+
temp_file.unlink
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe ".from_file" do
|
30
|
+
it "parses a file" do
|
31
|
+
temp_file = Tempfile.new
|
32
|
+
|
33
|
+
repository = Expressir::Model::Repository.new
|
34
|
+
|
35
|
+
begin
|
36
|
+
Expressir::ExpressExp::Cache.to_file(temp_file, repository, test_overwrite_version: TEST_VERSION)
|
37
|
+
|
38
|
+
result = Expressir::ExpressExp::Cache.from_file(temp_file, test_overwrite_version: TEST_VERSION)
|
39
|
+
|
40
|
+
expect(result).to be_instance_of(Expressir::Model::Repository)
|
41
|
+
ensure
|
42
|
+
temp_file.close
|
43
|
+
temp_file.unlink
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it "fails parsing a file from a different Expressir version" do
|
48
|
+
temp_file = Tempfile.new
|
49
|
+
|
50
|
+
repository = Expressir::Model::Repository.new
|
51
|
+
|
52
|
+
begin
|
53
|
+
Expressir::ExpressExp::Cache.to_file(temp_file, repository, test_overwrite_version: TEST_VERSION)
|
54
|
+
|
55
|
+
expect do
|
56
|
+
Expressir::ExpressExp::Cache.from_file(temp_file)
|
57
|
+
end.to raise_error(Expressir::ExpressExp::CacheLoadError)
|
58
|
+
ensure
|
59
|
+
temp_file.close
|
60
|
+
temp_file.unlink
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require "yaml"
|
1
2
|
require "spec_helper"
|
2
3
|
require "expressir/express_exp/parser"
|
3
4
|
require "expressir/express_exp/formatter"
|
@@ -74,6 +75,22 @@ RSpec.describe Expressir::ExpressExp::Formatter do
|
|
74
75
|
expect(result).to eq(expected_result)
|
75
76
|
end
|
76
77
|
|
78
|
+
it "exports an object with hyperlink formatter (syntax.exp)" do
|
79
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.exp")
|
80
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax_hyperlink_formatted.exp")
|
81
|
+
|
82
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
83
|
+
|
84
|
+
formatter = Class.new(Expressir::ExpressExp::Formatter) do
|
85
|
+
include Expressir::ExpressExp::HyperlinkFormatter
|
86
|
+
end
|
87
|
+
result = formatter.format(repo)
|
88
|
+
# File.write(formatted_exp_file, result)
|
89
|
+
expected_result = File.read(formatted_exp_file)
|
90
|
+
|
91
|
+
expect(result).to eq(expected_result)
|
92
|
+
end
|
93
|
+
|
77
94
|
it "exports an object with hyperlink formatter (multiple.exp)" do
|
78
95
|
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
79
96
|
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple_hyperlink_formatted.exp")
|
@@ -9,7 +9,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
9
9
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "single.yaml")
|
10
10
|
|
11
11
|
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
12
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
12
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
13
13
|
# File.write(yaml_file, result)
|
14
14
|
expected_result = File.read(yaml_file)
|
15
15
|
|
@@ -21,7 +21,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
21
21
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.yaml")
|
22
22
|
|
23
23
|
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
24
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
24
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
25
25
|
# File.write(yaml_file, result)
|
26
26
|
expected_result = File.read(yaml_file)
|
27
27
|
|
@@ -33,7 +33,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
33
33
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.yaml")
|
34
34
|
|
35
35
|
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
36
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
36
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
37
37
|
# File.write(yaml_file, result)
|
38
38
|
expected_result = File.read(yaml_file)
|
39
39
|
|
@@ -45,7 +45,7 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
45
45
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "remark.yaml")
|
46
46
|
|
47
47
|
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
48
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
48
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
49
49
|
# File.write(yaml_file, result)
|
50
50
|
expected_result = File.read(yaml_file)
|
51
51
|
|
@@ -83,15 +83,15 @@ RSpec.describe Expressir::ExpressExp::Parser do
|
|
83
83
|
|
84
84
|
schemas = repo.schemas
|
85
85
|
expect(schemas.count).to eq(5)
|
86
|
-
expect(schemas[0].file).to eq(exp_files[0])
|
86
|
+
expect(schemas[0].file).to eq(exp_files[0].to_s)
|
87
87
|
expect(schemas[0].id).to eq("single_schema")
|
88
|
-
expect(schemas[1].file).to eq(exp_files[1])
|
88
|
+
expect(schemas[1].file).to eq(exp_files[1].to_s)
|
89
89
|
expect(schemas[1].id).to eq("multiple_schema1")
|
90
|
-
expect(schemas[2].file).to eq(exp_files[1])
|
90
|
+
expect(schemas[2].file).to eq(exp_files[1].to_s)
|
91
91
|
expect(schemas[2].id).to eq("multiple_schema2")
|
92
|
-
expect(schemas[3].file).to eq(exp_files[1])
|
92
|
+
expect(schemas[3].file).to eq(exp_files[1].to_s)
|
93
93
|
expect(schemas[3].id).to eq("multiple_schema3")
|
94
|
-
expect(schemas[4].file).to eq(exp_files[1])
|
94
|
+
expect(schemas[4].file).to eq(exp_files[1].to_s)
|
95
95
|
expect(schemas[4].id).to eq("multiple_schema4")
|
96
96
|
end
|
97
97
|
end
|
@@ -1,5 +1,8 @@
|
|
1
|
+
|
2
|
+
require "yaml"
|
1
3
|
require "spec_helper"
|
2
4
|
require "expressir/express_exp/parser"
|
5
|
+
require "expressir/express_exp/formatter"
|
3
6
|
|
4
7
|
RSpec.describe Expressir::Model::ModelElement do
|
5
8
|
describe ".to_hash" do
|
@@ -9,7 +12,7 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
9
12
|
|
10
13
|
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
11
14
|
|
12
|
-
result = YAML.dump(repo.to_hash(
|
15
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, formatter: Expressir::ExpressExp::Formatter, skip_empty: true))
|
13
16
|
# File.write(yaml_file, result)
|
14
17
|
expected_result = File.read(yaml_file)
|
15
18
|
|
@@ -22,9 +25,9 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
22
25
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "single.yaml")
|
23
26
|
|
24
27
|
input = YAML.load(File.read(yaml_file))
|
25
|
-
repo = Expressir::Model::ModelElement.from_hash(input)
|
28
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
26
29
|
|
27
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
30
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
28
31
|
expected_result = File.read(yaml_file)
|
29
32
|
|
30
33
|
expect(result).to eq(expected_result)
|
@@ -34,9 +37,9 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
34
37
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.yaml")
|
35
38
|
|
36
39
|
input = YAML.load(File.read(yaml_file))
|
37
|
-
repo = Expressir::Model::ModelElement.from_hash(input)
|
40
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
38
41
|
|
39
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
42
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
40
43
|
expected_result = File.read(yaml_file)
|
41
44
|
|
42
45
|
expect(result).to eq(expected_result)
|
@@ -46,9 +49,9 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
46
49
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.yaml")
|
47
50
|
|
48
51
|
input = YAML.load(File.read(yaml_file))
|
49
|
-
repo = Expressir::Model::ModelElement.from_hash(input)
|
52
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
50
53
|
|
51
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
54
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
52
55
|
expected_result = File.read(yaml_file)
|
53
56
|
|
54
57
|
expect(result).to eq(expected_result)
|
@@ -58,9 +61,9 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
58
61
|
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "remark.yaml")
|
59
62
|
|
60
63
|
input = YAML.load(File.read(yaml_file))
|
61
|
-
repo = Expressir::Model::ModelElement.from_hash(input)
|
64
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
62
65
|
|
63
|
-
result = YAML.dump(repo.to_hash(skip_empty: true))
|
66
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
64
67
|
expected_result = File.read(yaml_file)
|
65
68
|
|
66
69
|
expect(result).to eq(expected_result)
|
@@ -79,8 +82,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
79
82
|
expect(repo.find('remark_schema.remark_type')).to be_instance_of(Expressir::Model::Type)
|
80
83
|
expect(repo.find('remark_schema.remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
81
84
|
expect(repo.find('remark_schema.remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
82
|
-
expect(repo.find('remark_schema.remark_type.IP1')).to be_instance_of(Expressir::Model::
|
83
|
-
expect(repo.find('remark_schema.remark_type.ip:IP1')).to be_instance_of(Expressir::Model::
|
85
|
+
expect(repo.find('remark_schema.remark_type.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
86
|
+
expect(repo.find('remark_schema.remark_type.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
84
87
|
expect(repo.find('remark_schema.remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
|
85
88
|
expect(repo.find('remark_schema.remark_entity')).to be_instance_of(Expressir::Model::Entity)
|
86
89
|
expect(repo.find('remark_schema.remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
@@ -89,8 +92,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
89
92
|
expect(repo.find('remark_schema.remark_entity.UR1')).to be_instance_of(Expressir::Model::Unique)
|
90
93
|
expect(repo.find('remark_schema.remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
|
91
94
|
expect(repo.find('remark_schema.remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
92
|
-
expect(repo.find('remark_schema.remark_entity.IP1')).to be_instance_of(Expressir::Model::
|
93
|
-
expect(repo.find('remark_schema.remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::
|
95
|
+
expect(repo.find('remark_schema.remark_entity.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
96
|
+
expect(repo.find('remark_schema.remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
94
97
|
expect(repo.find('remark_schema.remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
|
95
98
|
expect(repo.find('remark_schema.remark_function')).to be_instance_of(Expressir::Model::Function)
|
96
99
|
expect(repo.find('remark_schema.remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
|
@@ -111,8 +114,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
111
114
|
expect(repo.find('remark_schema.remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
112
115
|
expect(repo.find('remark_schema.remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
|
113
116
|
expect(repo.find('remark_schema.remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
114
|
-
expect(repo.find('remark_schema.remark_rule.IP1')).to be_instance_of(Expressir::Model::
|
115
|
-
expect(repo.find('remark_schema.remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::
|
117
|
+
expect(repo.find('remark_schema.remark_rule.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
118
|
+
expect(repo.find('remark_schema.remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
116
119
|
|
117
120
|
# schema scope
|
118
121
|
schema = repo.schemas.first
|
@@ -120,8 +123,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
120
123
|
expect(schema.find('remark_type')).to be_instance_of(Expressir::Model::Type)
|
121
124
|
expect(schema.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
122
125
|
expect(schema.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
123
|
-
expect(schema.find('remark_type.IP1')).to be_instance_of(Expressir::Model::
|
124
|
-
expect(schema.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::
|
126
|
+
expect(schema.find('remark_type.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
127
|
+
expect(schema.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
125
128
|
expect(schema.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
|
126
129
|
expect(schema.find('remark_entity')).to be_instance_of(Expressir::Model::Entity)
|
127
130
|
expect(schema.find('remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
@@ -130,8 +133,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
130
133
|
expect(schema.find('remark_entity.UR1')).to be_instance_of(Expressir::Model::Unique)
|
131
134
|
expect(schema.find('remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
|
132
135
|
expect(schema.find('remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
133
|
-
expect(schema.find('remark_entity.IP1')).to be_instance_of(Expressir::Model::
|
134
|
-
expect(schema.find('remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::
|
136
|
+
expect(schema.find('remark_entity.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
137
|
+
expect(schema.find('remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
135
138
|
expect(schema.find('remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
|
136
139
|
expect(schema.find('remark_function')).to be_instance_of(Expressir::Model::Function)
|
137
140
|
expect(schema.find('remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
|
@@ -152,15 +155,15 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
152
155
|
expect(schema.find('remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
153
156
|
expect(schema.find('remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
|
154
157
|
expect(schema.find('remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
155
|
-
expect(schema.find('remark_rule.IP1')).to be_instance_of(Expressir::Model::
|
156
|
-
expect(schema.find('remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::
|
158
|
+
expect(schema.find('remark_rule.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
159
|
+
expect(schema.find('remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
157
160
|
|
158
161
|
# type scope
|
159
162
|
type = schema.types.first
|
160
163
|
expect(type.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
161
164
|
expect(type.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
162
|
-
expect(type.find('IP1')).to be_instance_of(Expressir::Model::
|
163
|
-
expect(type.find('ip:IP1')).to be_instance_of(Expressir::Model::
|
165
|
+
expect(type.find('IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
166
|
+
expect(type.find('ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
164
167
|
|
165
168
|
# entity scope
|
166
169
|
entity = schema.entities.first
|
@@ -170,8 +173,8 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
170
173
|
expect(entity.find('UR1')).to be_instance_of(Expressir::Model::Unique)
|
171
174
|
expect(entity.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
172
175
|
expect(entity.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
173
|
-
expect(entity.find('IP1')).to be_instance_of(Expressir::Model::
|
174
|
-
expect(entity.find('ip:IP1')).to be_instance_of(Expressir::Model::
|
176
|
+
expect(entity.find('IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
177
|
+
expect(entity.find('ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
175
178
|
|
176
179
|
# function scope
|
177
180
|
function = schema.functions.first
|
@@ -197,15 +200,15 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
197
200
|
expect(rule.find('remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
198
201
|
expect(rule.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
199
202
|
expect(rule.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
200
|
-
expect(rule.find('IP1')).to be_instance_of(Expressir::Model::
|
201
|
-
expect(rule.find('ip:IP1')).to be_instance_of(Expressir::Model::
|
203
|
+
expect(rule.find('IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
204
|
+
expect(rule.find('ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
202
205
|
|
203
206
|
# retry search in parent scope
|
204
207
|
expect(entity.find('remark_type')).to be_instance_of(Expressir::Model::Type)
|
205
208
|
expect(entity.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
206
209
|
expect(entity.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
207
|
-
expect(entity.find('remark_type.IP1')).to be_instance_of(Expressir::Model::
|
208
|
-
expect(entity.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::
|
210
|
+
expect(entity.find('remark_type.IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
211
|
+
expect(entity.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::RemarkItem)
|
209
212
|
end
|
210
213
|
end
|
211
214
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expressir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.25
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -215,14 +215,18 @@ files:
|
|
215
215
|
- lib/expressir/express_exp/2.6/express_parser.so
|
216
216
|
- lib/expressir/express_exp/2.7/express_parser.so
|
217
217
|
- lib/expressir/express_exp/3.0/express_parser.so
|
218
|
+
- lib/expressir/express_exp/cache.rb
|
218
219
|
- lib/expressir/express_exp/formatter.rb
|
219
220
|
- lib/expressir/express_exp/hyperlink_formatter.rb
|
221
|
+
- lib/expressir/express_exp/model_visitor.rb
|
220
222
|
- lib/expressir/express_exp/parser.rb
|
223
|
+
- lib/expressir/express_exp/resolve_references_model_visitor.rb
|
221
224
|
- lib/expressir/express_exp/schema_head_formatter.rb
|
222
225
|
- lib/expressir/express_exp/visitor.rb
|
223
226
|
- lib/expressir/express_parser.rb
|
224
227
|
- lib/expressir/model.rb
|
225
228
|
- lib/expressir/model/attribute.rb
|
229
|
+
- lib/expressir/model/cache.rb
|
226
230
|
- lib/expressir/model/constant.rb
|
227
231
|
- lib/expressir/model/entity.rb
|
228
232
|
- lib/expressir/model/enumeration_item.rb
|
@@ -240,7 +244,6 @@ files:
|
|
240
244
|
- lib/expressir/model/expressions/unary_expression.rb
|
241
245
|
- lib/expressir/model/function.rb
|
242
246
|
- lib/expressir/model/identifier.rb
|
243
|
-
- lib/expressir/model/informal_proposition.rb
|
244
247
|
- lib/expressir/model/interface.rb
|
245
248
|
- lib/expressir/model/interface_item.rb
|
246
249
|
- lib/expressir/model/interfaced_item.rb
|
@@ -252,6 +255,7 @@ files:
|
|
252
255
|
- lib/expressir/model/model_element.rb
|
253
256
|
- lib/expressir/model/parameter.rb
|
254
257
|
- lib/expressir/model/procedure.rb
|
258
|
+
- lib/expressir/model/remark_item.rb
|
255
259
|
- lib/expressir/model/repository.rb
|
256
260
|
- lib/expressir/model/rule.rb
|
257
261
|
- lib/expressir/model/schema.rb
|
@@ -335,6 +339,7 @@ files:
|
|
335
339
|
- original/examples/syntax/syntax.exp
|
336
340
|
- original/examples/syntax/syntax.yaml
|
337
341
|
- original/examples/syntax/syntax_formatted.exp
|
342
|
+
- original/examples/syntax/syntax_hyperlink_formatted.exp
|
338
343
|
- original/examples/syntax/syntax_schema_head_formatted.exp
|
339
344
|
- original/exp2ruby.rb
|
340
345
|
- original/expsm.rb
|
@@ -347,6 +352,7 @@ files:
|
|
347
352
|
- spec/acceptance/express_to_owl_spec.rb
|
348
353
|
- spec/acceptance/version_spec.rb
|
349
354
|
- spec/expressir/express/repository_spec.rb
|
355
|
+
- spec/expressir/express_exp/cache_spec.rb
|
350
356
|
- spec/expressir/express_exp/formatter_spec.rb
|
351
357
|
- spec/expressir/express_exp/parser_spec.rb
|
352
358
|
- spec/expressir/model/model_element_spec.rb
|