expressir 0.2.14-x64-mingw32 → 0.2.19-x64-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/exe/format +56 -11
- 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/formatter.rb +201 -147
- data/lib/expressir/express_exp/hyperlink_formatter.rb +6 -4
- data/lib/expressir/express_exp/parser.rb +34 -26
- data/lib/expressir/express_exp/schema_head_formatter.rb +2 -7
- data/lib/expressir/express_exp/visitor.rb +27 -54
- data/lib/expressir/model.rb +2 -1
- data/lib/expressir/model/entity.rb +6 -6
- data/lib/expressir/model/expressions/query_expression.rb +3 -3
- data/lib/expressir/model/function.rb +15 -11
- data/lib/expressir/model/informal_proposition.rb +4 -1
- data/lib/expressir/model/{renamed_ref.rb → interface_item.rb} +2 -2
- data/lib/expressir/model/interfaced_item.rb +26 -0
- data/lib/expressir/model/model_element.rb +43 -13
- data/lib/expressir/model/procedure.rb +15 -11
- data/lib/expressir/model/repository.rb +3 -3
- data/lib/expressir/model/rule.rb +16 -12
- data/lib/expressir/model/schema.rb +56 -29
- data/lib/expressir/model/statements/alias.rb +3 -3
- data/lib/expressir/model/statements/repeat.rb +3 -3
- data/lib/expressir/model/subtype_constraint.rb +1 -6
- data/lib/expressir/model/type.rb +9 -5
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/multiple.exp +23 -0
- data/original/examples/syntax/multiple.yaml +184 -0
- data/original/examples/syntax/multiple_formatted.exp +71 -0
- data/original/examples/syntax/multiple_hyperlink_formatted.exp +71 -0
- data/original/examples/syntax/multiple_schema_head_hyperlink_formatted.exp +13 -0
- data/original/examples/syntax/remark.exp +41 -41
- data/original/examples/syntax/remark.yaml +446 -0
- data/original/examples/syntax/remark_formatted.exp +62 -50
- data/original/examples/syntax/{simple.exp → single.exp} +1 -1
- data/original/examples/syntax/single.yaml +9 -0
- data/original/examples/syntax/single_formatted.exp +6 -0
- data/original/examples/syntax/single_formatted.yaml +19 -0
- data/original/examples/syntax/syntax.exp +29 -19
- data/original/examples/syntax/syntax.yaml +3439 -0
- data/original/examples/syntax/syntax_formatted.exp +271 -131
- data/original/examples/syntax/syntax_schema_head_formatted.exp +18 -0
- data/spec/expressir/express_exp/formatter_spec.rb +111 -0
- data/spec/expressir/express_exp/parser_spec.rb +98 -0
- data/spec/expressir/model/{model_element/find_spec.rb → model_element_spec.rb} +96 -10
- metadata +19 -18
- data/original/examples/syntax/hyperlink.exp +0 -8
- data/original/examples/syntax/hyperlink_formatted.exp +0 -19
- data/original/examples/syntax/source.exp +0 -16
- data/spec/expressir/express_exp/formatter/remark_spec.rb +0 -28
- data/spec/expressir/express_exp/formatter/syntax_spec.rb +0 -28
- data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +0 -24
- data/spec/expressir/express_exp/parser/head_source_spec.rb +0 -38
- data/spec/expressir/express_exp/parser/multiple_spec.rb +0 -37
- data/spec/expressir/express_exp/parser/remark_spec.rb +0 -411
- data/spec/expressir/express_exp/parser/source_spec.rb +0 -29
- data/spec/expressir/express_exp/parser/syntax_spec.rb +0 -3080
- data/spec/expressir/express_exp/schema_head_formatter_spec.rb +0 -36
- data/spec/expressir/model/model_element/hash_spec.rb +0 -66
@@ -0,0 +1,18 @@
|
|
1
|
+
SCHEMA syntax_schema 'version';
|
2
|
+
|
3
|
+
USE FROM contract_schema;
|
4
|
+
USE FROM contract_schema
|
5
|
+
(contract);
|
6
|
+
USE FROM contract_schema
|
7
|
+
(contract,
|
8
|
+
contract2);
|
9
|
+
USE FROM contract_schema
|
10
|
+
(contract AS contract2);
|
11
|
+
REFERENCE FROM contract_schema;
|
12
|
+
REFERENCE FROM contract_schema
|
13
|
+
(contract);
|
14
|
+
REFERENCE FROM contract_schema
|
15
|
+
(contract,
|
16
|
+
contract2);
|
17
|
+
REFERENCE FROM contract_schema
|
18
|
+
(contract AS contract2);
|
@@ -0,0 +1,111 @@
|
|
1
|
+
require "yaml"
|
2
|
+
require "spec_helper"
|
3
|
+
require "expressir/express_exp/parser"
|
4
|
+
require "expressir/express_exp/formatter"
|
5
|
+
require "expressir/express_exp/schema_head_formatter"
|
6
|
+
require "expressir/express_exp/hyperlink_formatter"
|
7
|
+
|
8
|
+
RSpec.describe Expressir::ExpressExp::Formatter do
|
9
|
+
describe ".format" do
|
10
|
+
it "exports an object (single.exp)" do
|
11
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "single.exp")
|
12
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "single_formatted.exp")
|
13
|
+
|
14
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
15
|
+
|
16
|
+
result = Expressir::ExpressExp::Formatter.format(repo)
|
17
|
+
# File.write(formatted_exp_file, result)
|
18
|
+
expected_result = File.read(formatted_exp_file)
|
19
|
+
|
20
|
+
expect(result).to eq(expected_result)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "exports an object (multiple.exp)" do
|
24
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
25
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple_formatted.exp")
|
26
|
+
|
27
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
28
|
+
|
29
|
+
result = Expressir::ExpressExp::Formatter.format(repo)
|
30
|
+
# File.write(formatted_exp_file, result)
|
31
|
+
expected_result = File.read(formatted_exp_file)
|
32
|
+
|
33
|
+
expect(result).to eq(expected_result)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "exports an object (remark.exp)" do
|
37
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "remark.exp")
|
38
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "remark_formatted.exp")
|
39
|
+
|
40
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
41
|
+
|
42
|
+
result = Expressir::ExpressExp::Formatter.format(repo)
|
43
|
+
# File.write(formatted_exp_file, result)
|
44
|
+
expected_result = File.read(formatted_exp_file)
|
45
|
+
|
46
|
+
expect(result).to eq(expected_result)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "exports an object (syntax.exp)" do
|
50
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.exp")
|
51
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax_formatted.exp")
|
52
|
+
|
53
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
54
|
+
|
55
|
+
result = Expressir::ExpressExp::Formatter.format(repo)
|
56
|
+
# File.write(formatted_exp_file, result)
|
57
|
+
expected_result = File.read(formatted_exp_file)
|
58
|
+
|
59
|
+
expect(result).to eq(expected_result)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "exports an object with schema head formatter (syntax.exp)" do
|
63
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.exp")
|
64
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax_schema_head_formatted.exp")
|
65
|
+
|
66
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
67
|
+
|
68
|
+
formatter = Class.new(Expressir::ExpressExp::Formatter) do
|
69
|
+
include Expressir::ExpressExp::SchemaHeadFormatter
|
70
|
+
end
|
71
|
+
result = formatter.format(repo)
|
72
|
+
# File.write(formatted_exp_file, result)
|
73
|
+
expected_result = File.read(formatted_exp_file)
|
74
|
+
|
75
|
+
expect(result).to eq(expected_result)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "exports an object with hyperlink formatter (multiple.exp)" do
|
79
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
80
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple_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
|
+
|
94
|
+
it "exports an object with schema head and hyperlink formatter (multiple.exp)" do
|
95
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
96
|
+
formatted_exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple_schema_head_hyperlink_formatted.exp")
|
97
|
+
|
98
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
99
|
+
|
100
|
+
formatter = Class.new(Expressir::ExpressExp::Formatter) do
|
101
|
+
include Expressir::ExpressExp::SchemaHeadFormatter
|
102
|
+
include Expressir::ExpressExp::HyperlinkFormatter
|
103
|
+
end
|
104
|
+
result = formatter.format(repo)
|
105
|
+
# File.write(formatted_exp_file, result)
|
106
|
+
expected_result = File.read(formatted_exp_file)
|
107
|
+
|
108
|
+
expect(result).to eq(expected_result)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require "yaml"
|
2
|
+
require "spec_helper"
|
3
|
+
require "expressir/express_exp/parser"
|
4
|
+
|
5
|
+
RSpec.describe Expressir::ExpressExp::Parser do
|
6
|
+
describe ".from_file" do
|
7
|
+
it "parses a file (single.exp)" do
|
8
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "single.exp")
|
9
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "single.yaml")
|
10
|
+
|
11
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
12
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
13
|
+
# File.write(yaml_file, result)
|
14
|
+
expected_result = File.read(yaml_file)
|
15
|
+
|
16
|
+
expect(result).to eq(expected_result)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "parses a file (multiple.exp)" do
|
20
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
21
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.yaml")
|
22
|
+
|
23
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
24
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
25
|
+
# File.write(yaml_file, result)
|
26
|
+
expected_result = File.read(yaml_file)
|
27
|
+
|
28
|
+
expect(result).to eq(expected_result)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "parses a file (syntax.exp)" do
|
32
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.exp")
|
33
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.yaml")
|
34
|
+
|
35
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
36
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
37
|
+
# File.write(yaml_file, result)
|
38
|
+
expected_result = File.read(yaml_file)
|
39
|
+
|
40
|
+
expect(result).to eq(expected_result)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "parses a file (remark.exp)" do
|
44
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "remark.exp")
|
45
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "remark.yaml")
|
46
|
+
|
47
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
48
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
49
|
+
# File.write(yaml_file, result)
|
50
|
+
expected_result = File.read(yaml_file)
|
51
|
+
|
52
|
+
expect(result).to eq(expected_result)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "parses a file including original source (multiple.exp)" do
|
56
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
57
|
+
|
58
|
+
input = File.read(exp_file)
|
59
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file, include_source: true)
|
60
|
+
|
61
|
+
schema = repo.schemas.first
|
62
|
+
start_index = input.index("SCHEMA")
|
63
|
+
stop_index = input.index("END_SCHEMA;") + "END_SCHEMA;".length - 1
|
64
|
+
expected_result = input[start_index..stop_index]
|
65
|
+
expect(schema.source).to eq(expected_result)
|
66
|
+
|
67
|
+
entity = schema.entities.first
|
68
|
+
start_index = input.index("ENTITY")
|
69
|
+
stop_index = input.index("END_ENTITY;") + "END_ENTITY;".length - 1
|
70
|
+
expected_result = input[start_index..stop_index]
|
71
|
+
expect(entity.source).to eq(expected_result)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe ".from_files" do
|
76
|
+
it "parses multiple files (single.exp, multiple.exp)" do
|
77
|
+
exp_files = [
|
78
|
+
Expressir.root_path.join("original", "examples", "syntax", "single.exp"),
|
79
|
+
Expressir.root_path.join("original", "examples", "syntax", "multiple.exp")
|
80
|
+
]
|
81
|
+
|
82
|
+
repo = Expressir::ExpressExp::Parser.from_files(exp_files)
|
83
|
+
|
84
|
+
schemas = repo.schemas
|
85
|
+
expect(schemas.count).to eq(5)
|
86
|
+
expect(schemas[0].file).to eq(exp_files[0].to_s)
|
87
|
+
expect(schemas[0].id).to eq("single_schema")
|
88
|
+
expect(schemas[1].file).to eq(exp_files[1].to_s)
|
89
|
+
expect(schemas[1].id).to eq("multiple_schema1")
|
90
|
+
expect(schemas[2].file).to eq(exp_files[1].to_s)
|
91
|
+
expect(schemas[2].id).to eq("multiple_schema2")
|
92
|
+
expect(schemas[3].file).to eq(exp_files[1].to_s)
|
93
|
+
expect(schemas[3].id).to eq("multiple_schema3")
|
94
|
+
expect(schemas[4].file).to eq(exp_files[1].to_s)
|
95
|
+
expect(schemas[4].id).to eq("multiple_schema4")
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -1,10 +1,80 @@
|
|
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
|
8
|
+
describe ".to_hash" do
|
9
|
+
it "exports an object with a formatter (single.exp)" do
|
10
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "single.exp")
|
11
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "single_formatted.yaml")
|
12
|
+
|
13
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
14
|
+
|
15
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, formatter: Expressir::ExpressExp::Formatter, skip_empty: true))
|
16
|
+
# File.write(yaml_file, result)
|
17
|
+
expected_result = File.read(yaml_file)
|
18
|
+
|
19
|
+
expect(result).to eq(expected_result)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ".from_hash" do
|
24
|
+
it "parses an object (single.yaml)" do
|
25
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "single.yaml")
|
26
|
+
|
27
|
+
input = YAML.load(File.read(yaml_file))
|
28
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
29
|
+
|
30
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
31
|
+
expected_result = File.read(yaml_file)
|
32
|
+
|
33
|
+
expect(result).to eq(expected_result)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "parses an object (multiple.yaml)" do
|
37
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "multiple.yaml")
|
38
|
+
|
39
|
+
input = YAML.load(File.read(yaml_file))
|
40
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
41
|
+
|
42
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
43
|
+
expected_result = File.read(yaml_file)
|
44
|
+
|
45
|
+
expect(result).to eq(expected_result)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "parses an object (syntax.yaml)" do
|
49
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "syntax.yaml")
|
50
|
+
|
51
|
+
input = YAML.load(File.read(yaml_file))
|
52
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
53
|
+
|
54
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
55
|
+
expected_result = File.read(yaml_file)
|
56
|
+
|
57
|
+
expect(result).to eq(expected_result)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "parses an object (remark.yaml)" do
|
61
|
+
yaml_file = Expressir.root_path.join("original", "examples", "syntax", "remark.yaml")
|
62
|
+
|
63
|
+
input = YAML.load(File.read(yaml_file))
|
64
|
+
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
65
|
+
|
66
|
+
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, skip_empty: true))
|
67
|
+
expected_result = File.read(yaml_file)
|
68
|
+
|
69
|
+
expect(result).to eq(expected_result)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
5
73
|
describe ".find" do
|
6
74
|
it "finds an object" do
|
7
|
-
|
75
|
+
exp_file = Expressir.root_path.join("original", "examples", "syntax", "remark.exp")
|
76
|
+
|
77
|
+
repo = Expressir::ExpressExp::Parser.from_file(exp_file)
|
8
78
|
|
9
79
|
# universal scope
|
10
80
|
expect(repo.find('remark_schema')).to be_instance_of(Expressir::Model::Schema)
|
@@ -12,14 +82,18 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
12
82
|
expect(repo.find('remark_schema.remark_type')).to be_instance_of(Expressir::Model::Type)
|
13
83
|
expect(repo.find('remark_schema.remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
14
84
|
expect(repo.find('remark_schema.remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
85
|
+
expect(repo.find('remark_schema.remark_type.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
86
|
+
expect(repo.find('remark_schema.remark_type.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
15
87
|
expect(repo.find('remark_schema.remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
|
16
88
|
expect(repo.find('remark_schema.remark_entity')).to be_instance_of(Expressir::Model::Entity)
|
17
89
|
expect(repo.find('remark_schema.remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
18
90
|
expect(repo.find('remark_schema.remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
19
91
|
expect(repo.find('remark_schema.remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
20
|
-
expect(repo.find('remark_schema.remark_entity.
|
92
|
+
expect(repo.find('remark_schema.remark_entity.UR1')).to be_instance_of(Expressir::Model::Unique)
|
21
93
|
expect(repo.find('remark_schema.remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
|
22
94
|
expect(repo.find('remark_schema.remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
95
|
+
expect(repo.find('remark_schema.remark_entity.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
96
|
+
expect(repo.find('remark_schema.remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
23
97
|
expect(repo.find('remark_schema.remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
|
24
98
|
expect(repo.find('remark_schema.remark_function')).to be_instance_of(Expressir::Model::Function)
|
25
99
|
expect(repo.find('remark_schema.remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
|
@@ -40,19 +114,27 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
40
114
|
expect(repo.find('remark_schema.remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
41
115
|
expect(repo.find('remark_schema.remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
|
42
116
|
expect(repo.find('remark_schema.remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
117
|
+
expect(repo.find('remark_schema.remark_rule.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
118
|
+
expect(repo.find('remark_schema.remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
43
119
|
|
44
120
|
# schema scope
|
45
121
|
schema = repo.schemas.first
|
46
122
|
expect(schema.find('remark_constant')).to be_instance_of(Expressir::Model::Constant)
|
47
123
|
expect(schema.find('remark_type')).to be_instance_of(Expressir::Model::Type)
|
124
|
+
expect(schema.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
125
|
+
expect(schema.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
126
|
+
expect(schema.find('remark_type.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
127
|
+
expect(schema.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
48
128
|
expect(schema.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
|
49
129
|
expect(schema.find('remark_entity')).to be_instance_of(Expressir::Model::Entity)
|
50
130
|
expect(schema.find('remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
51
131
|
expect(schema.find('remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
52
132
|
expect(schema.find('remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
53
|
-
expect(schema.find('remark_entity.
|
133
|
+
expect(schema.find('remark_entity.UR1')).to be_instance_of(Expressir::Model::Unique)
|
54
134
|
expect(schema.find('remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
|
55
135
|
expect(schema.find('remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
136
|
+
expect(schema.find('remark_entity.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
137
|
+
expect(schema.find('remark_entity.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
56
138
|
expect(schema.find('remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
|
57
139
|
expect(schema.find('remark_function')).to be_instance_of(Expressir::Model::Function)
|
58
140
|
expect(schema.find('remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
|
@@ -73,20 +155,26 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
73
155
|
expect(schema.find('remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
74
156
|
expect(schema.find('remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
|
75
157
|
expect(schema.find('remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
158
|
+
expect(schema.find('remark_rule.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
159
|
+
expect(schema.find('remark_rule.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
76
160
|
|
77
161
|
# type scope
|
78
162
|
type = schema.types.first
|
79
163
|
expect(type.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
80
164
|
expect(type.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
165
|
+
expect(type.find('IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
166
|
+
expect(type.find('ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
81
167
|
|
82
168
|
# entity scope
|
83
169
|
entity = schema.entities.first
|
84
170
|
expect(entity.find('remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
85
171
|
expect(entity.find('remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
86
172
|
expect(entity.find('remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
|
87
|
-
expect(entity.find('
|
173
|
+
expect(entity.find('UR1')).to be_instance_of(Expressir::Model::Unique)
|
88
174
|
expect(entity.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
89
175
|
expect(entity.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
176
|
+
expect(entity.find('IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
177
|
+
expect(entity.find('ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
90
178
|
|
91
179
|
# function scope
|
92
180
|
function = schema.functions.first
|
@@ -112,17 +200,15 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
112
200
|
expect(rule.find('remark_variable')).to be_instance_of(Expressir::Model::Variable)
|
113
201
|
expect(rule.find('WR1')).to be_instance_of(Expressir::Model::Where)
|
114
202
|
expect(rule.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
203
|
+
expect(rule.find('IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
204
|
+
expect(rule.find('ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
115
205
|
|
116
206
|
# retry search in parent scope
|
117
207
|
expect(entity.find('remark_type')).to be_instance_of(Expressir::Model::Type)
|
118
208
|
expect(entity.find('remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
|
119
209
|
expect(entity.find('remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
|
210
|
+
expect(entity.find('remark_type.IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
211
|
+
expect(entity.find('remark_type.ip:IP1')).to be_instance_of(Expressir::Model::InformalProposition)
|
120
212
|
end
|
121
213
|
end
|
122
|
-
|
123
|
-
def sample_file
|
124
|
-
@sample_file ||= Expressir.root_path.join(
|
125
|
-
"original", "examples", "syntax", "remark.exp"
|
126
|
-
)
|
127
|
-
end
|
128
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.19
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -242,6 +242,8 @@ files:
|
|
242
242
|
- lib/expressir/model/identifier.rb
|
243
243
|
- lib/expressir/model/informal_proposition.rb
|
244
244
|
- lib/expressir/model/interface.rb
|
245
|
+
- lib/expressir/model/interface_item.rb
|
246
|
+
- lib/expressir/model/interfaced_item.rb
|
245
247
|
- lib/expressir/model/literals/binary.rb
|
246
248
|
- lib/expressir/model/literals/integer.rb
|
247
249
|
- lib/expressir/model/literals/logical.rb
|
@@ -250,7 +252,6 @@ files:
|
|
250
252
|
- lib/expressir/model/model_element.rb
|
251
253
|
- lib/expressir/model/parameter.rb
|
252
254
|
- lib/expressir/model/procedure.rb
|
253
|
-
- lib/expressir/model/renamed_ref.rb
|
254
255
|
- lib/expressir/model/repository.rb
|
255
256
|
- lib/expressir/model/rule.rb
|
256
257
|
- lib/expressir/model/schema.rb
|
@@ -319,14 +320,22 @@ files:
|
|
319
320
|
- original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl
|
320
321
|
- original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi
|
321
322
|
- original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml
|
322
|
-
- original/examples/syntax/
|
323
|
-
- original/examples/syntax/
|
323
|
+
- original/examples/syntax/multiple.exp
|
324
|
+
- original/examples/syntax/multiple.yaml
|
325
|
+
- original/examples/syntax/multiple_formatted.exp
|
326
|
+
- original/examples/syntax/multiple_hyperlink_formatted.exp
|
327
|
+
- original/examples/syntax/multiple_schema_head_hyperlink_formatted.exp
|
324
328
|
- original/examples/syntax/remark.exp
|
329
|
+
- original/examples/syntax/remark.yaml
|
325
330
|
- original/examples/syntax/remark_formatted.exp
|
326
|
-
- original/examples/syntax/
|
327
|
-
- original/examples/syntax/
|
331
|
+
- original/examples/syntax/single.exp
|
332
|
+
- original/examples/syntax/single.yaml
|
333
|
+
- original/examples/syntax/single_formatted.exp
|
334
|
+
- original/examples/syntax/single_formatted.yaml
|
328
335
|
- original/examples/syntax/syntax.exp
|
336
|
+
- original/examples/syntax/syntax.yaml
|
329
337
|
- original/examples/syntax/syntax_formatted.exp
|
338
|
+
- original/examples/syntax/syntax_schema_head_formatted.exp
|
330
339
|
- original/exp2ruby.rb
|
331
340
|
- original/expsm.rb
|
332
341
|
- original/mapping_owl.rb
|
@@ -338,17 +347,9 @@ files:
|
|
338
347
|
- spec/acceptance/express_to_owl_spec.rb
|
339
348
|
- spec/acceptance/version_spec.rb
|
340
349
|
- spec/expressir/express/repository_spec.rb
|
341
|
-
- spec/expressir/express_exp/
|
342
|
-
- spec/expressir/express_exp/
|
343
|
-
- spec/expressir/
|
344
|
-
- spec/expressir/express_exp/parser/head_source_spec.rb
|
345
|
-
- spec/expressir/express_exp/parser/multiple_spec.rb
|
346
|
-
- spec/expressir/express_exp/parser/remark_spec.rb
|
347
|
-
- spec/expressir/express_exp/parser/source_spec.rb
|
348
|
-
- spec/expressir/express_exp/parser/syntax_spec.rb
|
349
|
-
- spec/expressir/express_exp/schema_head_formatter_spec.rb
|
350
|
-
- spec/expressir/model/model_element/find_spec.rb
|
351
|
-
- spec/expressir/model/model_element/hash_spec.rb
|
350
|
+
- spec/expressir/express_exp/formatter_spec.rb
|
351
|
+
- spec/expressir/express_exp/parser_spec.rb
|
352
|
+
- spec/expressir/model/model_element_spec.rb
|
352
353
|
- spec/expressr_spec.rb
|
353
354
|
- spec/spec_helper.rb
|
354
355
|
- spec/support/console_helper.rb
|